/********************************************************************************************/ // Overwrite des valeurs de Lightbox /********************************************************************************************/ var fileLoadingImage = "/media/image/system/loading.gif"; var fileBottomNavCloseImage = "/media/image/system/closelabel.gif"; // controls the speed of the image resizing (1=slowest and 10=fastest) var resizeSpeed = 7; // if you adjust the padding in the CSS, you will need to update this variable var borderSize = 10; /********************************************************************************************/ // Lancement des popups /********************************************************************************************/ var newWindow = null; // Fermeture des autres popups function closeWin(){ if (newWindow != null){ if(!newWindow.closed) newWindow.close(); } } // Lancement du popup function popUpWin(url, type, strWidth, strHeight){ // closeWin(); if (type == "fullScreen"){ strWidth = screen.availWidth - ((screen.availWidth/100)*10); strHeight = screen.availHeight - ((screen.availHeight/100)*10); strTop = (screen.availHeight/2)-(strHeight/2); strLeft = (screen.availWidth/2)-(strWidth/2); } else{ strTop = (screen.availHeight/2)-(strHeight/2); strLeft = (screen.availWidth/2)-(strWidth/2); } var tools=""; if (type == "standard" || type == "fullScreen") tools = "resizable, toolbar=no, location=no, scrollbars=yes, menubar=no, width="+strWidth+", height="+strHeight+", left="+strLeft+", top="+strTop+""; if (type == "console") tools = "resizable=yes, toolbar=no, location=no, scrollbars=no, width="+strWidth+", height="+strHeight+", left="+strLeft+", top="+strTop+""; newWindow = window.open(url, 'newWin', tools); newWindow.focus(); } /********************************************************************************************/ // Surligner les lignes des tableaux /********************************************************************************************/ function highlightLigne(LigneID) { // On mouse over : highlight de la ligne if (LigneID.className=='ligne') {LigneID.className='ligne hover';} // On mouse out : highlight de la ligne else {LigneID.className='ligne';} } /********************************************************************************************/ // Changer les états des champs /********************************************************************************************/ function switchfield(id, event) { var chaine=document.getElementById(id).className; switch(event) { // S'il est onfocus : le remettre sans aucune class case 'onblur': // alert (chaine); var reg=new RegExp("(onfocus)", "gi"); document.getElementById(id).className = chaine.replace(reg,''); break; case 'onmouseout': case 'onmouseover': // S'il est onfocus : ne rien faire if (chaine.indexOf('onfocus')!=-1) {break;} default: // Dans tous les autres cas : ajouter la class à la chaine if (chaine.indexOf('onmouseout')!=-1 || chaine.indexOf('onmouseover')!=-1 || chaine.indexOf('onfocus')!=-1 || chaine.indexOf('onblur')!=-1) { chaine=chaine.substring(0,chaine.lastIndexOf(" ")); } document.getElementById(id).className = chaine+' '+event; break; } } /********************************************************************************************/ // show/hide classique avec support des classes multiples, fait toujours plaisir /********************************************************************************************/ // (utilise indexOF pour situer la class notDisplay au sein d'une chaine de class comme class="chapitre notdisplay".) IndexOf retourne -1 si rien n'est trouvé. function showhide(id) { // Si invisible (notDisplayed) : l'afficher if (document.getElementById(id).className.indexOf('notDisplayed')!=-1) { var chaine=document.getElementById(id).className; var reg=new RegExp("(notDisplayed)", "gi"); document.getElementById(id).className = chaine.replace(reg,''); } // Si visible (pas notDisplayed) : le cacher else { var classname = document.getElementById(id).className+' notDisplayed'; document.getElementById(id).className = classname; } } /********************************************************************************************/ // Haut de l'écran en scroll /********************************************************************************************/ var g_USER_AGENT = getAgent(); // return NN4, NN5(Netscape 6+, Mozilla 1+?), IE4, IE5(IE5+), Unknown function getAgent(){ var userAgent = navigator.userAgent; var charIndex; var majorVersion; charIndex = userAgent.indexOf("MSIE"); if(charIndex){ majorVersion = userAgent.charAt(charIndex + 4 + 1); if(majorVersion > 4) {return("IE5");} else if(majorVersion == 4) {return("IE4");} } charIndex = userAgent.indexOf("Mozilla"); majorVersion = userAgent.charAt(charIndex + 7 + 1); if(majorVersion > 4) {return("NN5");} else if(majorVersion == 4) {return("NN4");} return("Unknown"); } /* USER_AGENT check end -------------------------------------------------- */ function getWindowYOffset(){ if(g_USER_AGENT == "IE5" || g_USER_AGENT == "IE4") {return document.body.scrollTop;} else if(g_USER_AGENT == "NN5" || g_USER_AGENT == "NN4") {return window.pageYOffset;} else {return 0;} } var waitTimer; function jumpTo(dstY, srcY, scrollRate, waitMillSec) { if(waitTimer) {clearTimeout(waitTimer);} if( ! dstY || dstY < 0 ) {dstY = 0;} if( ! srcY ) {srcY = 0 + getWindowYOffset();} if( ! scrollRate ) {scrollRate = 5;} if( ! waitMillSec ) {waitMillSec = 20;} srcY += (dstY - getWindowYOffset()) / scrollRate; if(srcY < 0){srcY = 0;} posY = Math.floor(srcY); window.scrollTo(0, posY); if(posY != dstY) {waitTimer = setTimeout("jumpTo("+ dstY +", "+ srcY +", "+ scrollRate +", "+ waitMillSec +")", waitMillSec);} else if(posY == dstY) {clearTimeout(waitTimer);} else if(posY < 1) {window.scroll(0, 0);} } function toTop(){ jumpTo(0, 0, 7, 14); } /********************************************************************************************/ // Changer l'affichage relatif/absolu /********************************************************************************************/ function display() { // Si c'est en absolu : passer en relatif if (document.getElementById('positionnement').className=='absolute') { document.getElementById('positionnement').className='relative'; hide('mncursusaux'); } // Si c'est en relatif : passer en absolu else { document.getElementById('positionnement').className='absolute'; document.getElementById('cursusdummy').className='absolute'; show('mncursusaux'); } } /********************************************************************************************/ // Show /********************************************************************************************/ function show(id) { var chaine=document.getElementById(id).className; var reg=new RegExp("(notDisplayed)", "gi"); document.getElementById(id).className = chaine.replace(reg,''); } /********************************************************************************************/ // Hide /********************************************************************************************/ function hide(id) { var classname = document.getElementById(id).className+' notDisplayed'; document.getElementById(id).className = classname; } /********************************************************************************************/ // Ecriture de la class d'invisibilité /********************************************************************************************/ document.write('');