function CSSetStylePos(s,d,p) { if (CSIsW3CDOM)d==0?document.getElementById(s).style.left=p+"px":document.getElementById(s).style.top=p+"px"; else if(IsIE())(d==0)?CSIEStyl(s).posLeft=p:CSIEStyl(s).posTop=p; else (d==0)?CSNSStyl(s).left=p:CSNSStyl(s).top=p; } function CSGetStylePos(s,d) { if (CSIsW3CDOM){CSIDOM();return parseInt((d==0)?document.getElementById(s).style.left:document.getElementById(s).style.top); } else if (IsIE()) {CSIEWinInit();return(d==0)?CSIEStyl(s).posLeft:CSIEStyl(s).posTop;} else {return (d==0)?CSNSStyl(s).left:CSNSStyl(s).top;} } function getStyleObject(objectId) { // cross-browser function to get an object's style object given its id if(document.getElementById && document.getElementById(objectId)) { // W3C DOM return document.getElementById(objectId).style; } else if (document.all && document.all(objectId)) { // MSIE 4 DOM return document.all(objectId).style; } else if (document.layers && document.layers[objectId]) { // NN 4 DOM.. note: this won't find nested layers return document.layers[objectId]; } else { return false; } } // getStyleObject function changeObjectVisibility(objectId, newVisibility) { // get a reference to the cross-browser style object and make sure the object exists var styleObject = getStyleObject(objectId); if(styleObject) { styleObject.visibility = newVisibility; return true; } else { // we couldn't find the object, so we can't change its visibility return false; } } // changeObjectVisibility function moveObject(objectId, newXCoordinate, newYCoordinate) { // get a reference to the cross-browser style object and make sure the object exists var styleObject = getStyleObject(objectId); if(styleObject) { styleObject.left = newXCoordinate; styleObject.top = newYCoordinate; return true; } else { // we couldn't find the object, so we can't very well move it return false; } } // moveObject function showMenu(menuNumber, eventObj) { // alert(eventObj); hideAllMenus(); placeTousLesCalques(); var menuId = 'menu' + menuNumber; if(changeObjectVisibility(menuId, 'visible')) { var menuTitle = getStyleObject('menuTitle' + menuNumber); menuTitle.backgroundColor = '#6692CE'; eventObj.cancelBubble = true; return true; } else { return false; } } function hideAllMenus() { //changeObjectVisibility('covering', 'hidden'); } document.onclick = hideAllMenus; window.onresize = placeTousLesCalques; function placeCalque(ar,defX){ var nPosX; for (var i = 0; i < ar.length; i++){ if (document.body.clientWidth >= 787){ nPosX = defX + (document.body.clientWidth - 787) / 2 } else { nPosX = defX; } CSSetStylePos(ar[i],0,nPosX); } } function placeTousLesCalques(){ placeCalque(Array('invisible-button-home'),6); placeCalque(Array('invisible-button-english'),737); }