function fcnSwapImage(name, imageName)
{
//alert("fcnSwapImage(" + name + "," + imageName + ")");
var imgObj = document.images[name];
//alert("retrieved the image object to swap: imgObj.src = " + imgObj.src);
eval("var newImageObj = " + imageName);
//alert("grabbed the image variable: newImageObj.src = " + newImageObj.src);
imgObj.src = newImageObj.src;
}
/** Standard popup window open
* The first parameter will be the new URL.
* Subsequent parameters will be (if supplied) the width and height.
* If not specified the width and height will be 500 and 200 respectively.
*/
function openWin()
{
var url, width=600, height=200, menu=""; args = arguments;
url = args[0];
if (args.length>1)
{
width=args[1];
}
if (args.length>2)
{
height=args[2];
}
if (args.length>3)
{
if (args[3])
{
menu=",menubar=yes,toolbar=yes";
}
}
var newwin = window.open(url, 'newWin', 'width='+width+',height='+height+',scrollbars,resizable' + menu);
}
function openNonEncodedUrlWin()
{
var url, width=600, height=200, menu=""; args = arguments;
url = args[0];
if (args.length>1)
{
width=args[1];
}
if (args.length>2)
{
height=args[2];
}
if (args.length>3)
{
if (args[3])
{
menu=",menubar=yes,toolbar=yes";
}
}
var newwin = window.open(url, 'newWin', 'width='+width+',height='+height+',scrollbars,resizable' + menu);
}
//end hide me-->
// Global variables
var isCSS, isW3C, isIE4, isNN4, isIE6CSS;
// initialize upon load to let all browsers establish content objects
function initDHTMLAPI () {
if (document.images) {
isCSS = (document.body && document.body.style) ? true : false;
isW3C = (isCSS && document.getElementById) ? true : false;
isIE4 = (isCSS && document.all) ? true : false;
isNN4 = (document.layers) ? true : false;
isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
}
}
// set event handler to initialize API
window.onload = initDHTMLAPI;
// seek nested NN4 layer from string name
function seekLayer(doc, name) {
var theObj;
for (var i=0; i < doc.layers.length; i++) {
if (doc.layers[i].name == name) {
theObj = doc.layers[i];
break;
}
// dive into nested layers if necessary
if (doc.layers[i].document.layers.length > 0) {
theObj = seekLayer(document.layers[i].document, name);
}
}
return theObj;
}
// convert object name string or object reference
// into a valid element object reference
function getRawObject(obj) {
var theObj;
if (typeof obj == "string") {
if (isW3C) {
theObj = document.getElementById(obj);
} else if (isIE4) {
theObj = document.all(obj);
} else if (isNN4) {
theObj = seekLayer(document, obj);
}
} else {
//pass through object reference
theObj = obj;
}
return theObj;
}
// Convert object name string  or object reference
// into a valid style (or NN4  layer) reference
function getObject(obj) {
var theObj = getRawObject(obj);
if (theObj && isCSS) {
theObj = theObj.style;
}
return theObj;
}
// position the object at a specific pixel coordinate
function shiftTo(obj, x, y) {
var theObj = getObject(obj);
if (theObj) {
if (isCSS) {
// equalize incorrect numeric value type
var units = (typeof theObj.left == "string") ? "px" : 0;
theObj.left = x + units;
theObj.top = y + units;
} else if (isNN4) {
theObj.moveTo(x,y);
}
}
}
// move an object by x and/or y pixels
function shiftBy(obj, deltaX, deltaY) {
var theObj = getObject(obj);
if (theObj) {
if (isCSS) {
// equalize incorrect numeric value type
var units = (typeof theObj.left == "string") ? "px" : 0;
theObj.left = getObjectLeft(obj) + deltaX + units;
theObj.top = getObjectTop(obj) + deltaY + units;
} else if (isNN4) {
theObj.moveBy(deltaX, deltaY);
}
}
}
// set the Z order of an object
function setZIndex(obj, zOrder) {
var theObj = getObject(obj);
if (theObj) {
theObj.zIndex = zOrder;
}
}
// set the background color of an object
function setBGColor(obj, color) {
var theObj = getObject(obj);
if (theObj) {
if (isNN4) {
theObj.bgColor = color;
} else if (isCSS) {
theObj.backgroundColor = color;
}
}
}
//set the visibility of an object to visible
function show(obj) {
var theObj = getObject(obj);
if (theObj) {
theObj.display = "block";
}
}
//set the visibility of an object to hidden
function hide(obj) {
var theObj = getObject(obj);
if (theObj) {
theObj.display = "none";
}
}
// retrieve the x coordinate  of a positionable object
function getObjectLeft(obj) {
var elem = getRawObject(obj);
var result = 0;
if (document.defaultView) {
var style = document.defaultView;
var cssDec1 = style.getComputedStyle(elem, "");
result = cssDec1.getPropertyValue("left");
} else if (elem.currentStyle) {
result = elem.currentStyle.left;
} else if (elem.style) {
result = elem.style.left;
} else if (isNN4) {
result = elem.left;
}
return parseInt(result);
}
function getObjectTop(obj) {
var elem = getRawObject(obj);
var result = 0;
if (document.defaultView) {
var style = document.defaultView;
var cssDec1 = style.getComputedStyle(elem, "");
result = cssDec1.getPropertyValue("top");
} else if (elem.currentStyle) {
result = elem.currentStyle.top;
} else if (elem.style) {
result = elem.style.top;
} else if (isNN4) {
result = elem.top;
}
return parseInt(result);
}
// retrieve the rendered width of an element
function getObjectWidth(obj) {
var elem = getRawObject(obj);
var result = 0;
if (elem.offsetWidth) {
if (elem.scrollWidth && (elem.offsetWidth != elem.scrollWidth)) {
result = elem.scrollWidth;
} else {
result = elem.offsetWidth;
}
} else if (elem.clip && elem.clip.width) {
result = elem.clip.width;
} else if (elem.style && elem.style.pixelWidth) {
result = elem.style.pixelWidth;
}
return parseInt(result);
}
// return the rendered height of an element
function getObjectHeight(obj) {
var elem = getRawObject(obj);
var result = 0;
if (elem.offsetHeight) {
result = elem.offsetHeight;
} else if (elem.clip && elem.clip.height) {
result = elem.clip.height;
} else if (elem.style && elem.style.pixelHeight) {
return elem.style.pixelHeight;
}
return parseInt(result);
}
// return available content width space in browser window
function getInsideWindowWidth() {
if (window.innerWidth) {
return window.innerWidth;
} else if (isIE6CSS) {
//measure the HTML element's clientWidth
return document.body.parentElement.clientWidth;
} else if (document.body && document.body.clientWidth) {
return document.body.clientWidth;
}
return 0;
}
// return the available content height space in the browser window
function getInsideWindowHeight() {
if (window.innerHeight) {
return window.innerHeight;
} else if (isIE6CSS) {
//measure the HTML element's clientWidth
return document.body.parentElement.clientHeight;
} else if (document.body && document.body.clientHeight) {
return document.body.clientHeight;
}
return 0;
}
function printPage() {
if (window.print)
window.print()
else
alert( "Sorry, your browser doesn't support this feature. Please use the Print menu option of this browser to print the page. " );
}
function disableButton(theButton)
{
theButton.value="Processing...";
theButton.disabled = true;
theButton.form.submit();
}
function submitForm(myForm) {
myForm.submit( );
submitForm = blockIt;
return false;
}
function submitEncryptedLoginForm(myform) {
var oldPassword = myform.password.value;
myform.password.value = base64encode(utf16to8(myform.password.value));
myform.submit( );
myform.password.value = oldPassword;
submitEncryptedLoginForm = blockIt;
return false;
}
function enterSubmitLogin(myform) {
if (window.event && window.event.keyCode == 13){
submitEncryptedLoginForm(myform);
enterSubmitLogin = blockIt;
}
else
return true;
}
function enterSubmit(myform) {
if (window.event && window.event.keyCode == 13){
submitForm(myform);
enterSubmit = blockIt;
}
else
return true;
}
function blockIt( ) {
return false;
}
var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
function base64encode(str) {
var out, i, len;
var c1, c2, c3;
len = str.length;
i = 0;
out = "";
while(i < len) {
c1 = str.charCodeAt(i++) & 0xff;
if(i == len)
{
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt((c1 & 0x3) << 4);
out += "==";
break;
}
c2 = str.charCodeAt(i++);
if(i == len)
{
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
out += base64EncodeChars.charAt((c2 & 0xF) << 2);
out += "=";
break;
}
c3 = str.charCodeAt(i++);
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6));
out += base64EncodeChars.charAt(c3 & 0x3F);
}
return out;
}
function utf16to8(str) {
var out, i, len, c;
out = "";
len = str.length;
for(i = 0; i < len; i++) {
c = str.charCodeAt(i);
if ((c >= 0x0001) && (c <= 0x007F)) {
out += str.charAt(i);
} else if (c > 0x07FF) {
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
out += String.fromCharCode(0x80 | ((c >>  6) & 0x3F));
out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));
} else {
out += String.fromCharCode(0xC0 | ((c >>  6) & 0x1F));
out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));
}
}
return out;
}
//------------------------------------------------------------------------------------------------------//
//                          FONCTION DEVELOPPEE PAR SOGETI JCY EN 06/2007                               //
//------------------------------------------------------------------------------------------------------//


        //Fonction laissant la possibilité a l'utilisateur de saisir uniquement des chiffres
        function SUC(champ) //Saisir uniquement chiffres
        //~~~~~~~~~~~~~~~~~~~~~~~~~~
        {
         this.champ=champ;
         var Lui=this;
         var ie = false; /*@cc_on ie = true; @*/
         if ( ie ) {
             this.champ.onkeypress = Lui.IE;
            }
         else  { 
             this.champ.onkeyup = function(e)
              {
               Lui.FF(this, e);
              }
            }
        }
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        SUC.prototype.IE=function() //~~ pour Internet Explorer ~~
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        {
         if ( event.keyCode<0x30 || event.keyCode>0x39 )
         {
          event.returnValue= false;
         }
        }
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        SUC.prototype.FF=function(zone,evt) //~~ pour FireFox ~~
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        {
         if ( evt.which<0x30 || evt.which>0x39 )
         {
          zone.value=zone.value.replace(/[^0-9]/g,"");
         }
        }

        //Mettre une pause de durée déterminée avant de lancer la fonction
        function Attendre(Duree,lafonction)
        {
          a = setTimeout(lafonction,Duree);
        }

        //Affiche une fenetre de type popup au centre de l'écran
        function PopupCentrer(page,largeur,hauteur,options) {
          var top=(screen.height-hauteur)/2;
          var left=(screen.width-largeur)/2;
          window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
        }
        

//------------------------------------------------------------------------------------------------------//
//                      FIN DES FONCTIONS DEVELOPPEE PAR SOGETI JCY EN 06/2007                          //
//------------------------------------------------------------------------------------------------------//
