/***************************************************************/ /* Fonctions javascript appelées par la page d'accueil du site */ /***************************************************************/ var refresh = 0; /* rechargement de la page passée en paramètre */ function reloadOnFocus(page) { if (refresh == 1) { try { page.reload(); } catch (ex) { alert('exception javascript !'); } }else{ refresh = 1; } } /* renvoi la longueur d'un tableau * rq : un tableau a au moins 2 éléments ... sinon, ce n'est qu'un simple objet. * d'où l'utilité de la méthode. */ function tabDim(tab) { exist = 1; // teste s'il existe au moins 1 requete try { var tmp = tab.length; } catch (ex) { exist = 0; } if (exist == 1) { if (tab.length >= 2) { exist = tab.length; } } return exist; } /* Changement d'URL lors d'un changement de spécialité */ function ChangeUrl(formulaire, institution) { if (formulaire.specialite.selectedIndex != 0) { if(formulaire.specialite.options[formulaire.specialite.selectedIndex].value != "") { if (institution == 'oui') { window.top.location.href = '/institutions/' + formulaire.specialite.options[formulaire.specialite.selectedIndex].value; } else { window.top.location.href = '/' + formulaire.specialite.options[formulaire.specialite.selectedIndex].value; } } } else { alert('Veuillez choisir une spécialité.'); } } /* Popup générique pour l'affichage des messages */ function openMessageWindow(errorType, stylesheet, errorMessage, imagesPath, color) { if (errorType == 0) { openErrorWindow(stylesheet, errorMessage, imagesPath, color); } else if (errorType == 1) { openWarningWindow(stylesheet, errorMessage, imagesPath, color); } else { alert("Invalid errorType"); } } /* Popup générique pour l'affichage des messages d'erreurs */ function openErrorWindow(stylesheet, errorMessage, imagesPath, color) { // Dans certains cas la chaine est passée via URL, donc impossible d'utiliser les & errorMessage=errorMessage.replace('@#39;','''); var options = "system=no, menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, copyhistory=no"; var largeur = 450; var hauteur = 200; var top = (screen.height - hauteur)/2; var left = (screen.width - largeur)/2; var params = "top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options; var FENETRE = 1; FENETRE = window.open("", 'Erreur', params); FENETRE.document.close(); FENETRE.document.writeln(''); FENETRE.document.writeln(''); FENETRE.document.writeln(''); FENETRE.document.writeln('Erreur'); FENETRE.document.writeln(''); FENETRE.document.writeln(''); FENETRE.document.writeln(''); FENETRE.document.writeln(''); FENETRE.document.writeln(''); FENETRE.document.writeln(' '); FENETRE.document.writeln(' '); FENETRE.document.writeln(' '); FENETRE.document.writeln(' '); FENETRE.document.writeln(' '); FENETRE.document.writeln(' '); FENETRE.document.writeln(' '); FENETRE.document.writeln('
ERREUR \"Fermer\"

'); FENETRE.document.writeln('
'); FENETRE.document.writeln(''); FENETRE.document.writeln(errorMessage); FENETRE.document.writeln('
'); FENETRE.document.writeln('
'); FENETRE.document.writeln('
'); FENETRE.document.writeln(''); FENETRE.document.writeln(''); if (FENETRE != null) { FENETRE.focus(); } } /* Popup générique pour l'affichage des messages d'information */ function openWarningWindow(stylesheet, errorMessage, imagesPath, color) { // Dans certains cas la chaine est passée via URL, donc impossible d'utiliser les & errorMessage=errorMessage.replace('@#39;','''); var options = "system=no, menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, copyhistory=no"; var largeur = 450; var hauteur = 200; var top = (screen.height - hauteur)/2; var left = (screen.width - largeur)/2; var params = "top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options; var FENETRE = 1; FENETRE = window.open("", 'Erreur', params); FENETRE.document.close(); FENETRE.document.writeln(''); FENETRE.document.writeln(''); FENETRE.document.writeln(''); FENETRE.document.writeln('Information'); FENETRE.document.writeln(''); FENETRE.document.writeln(''); FENETRE.document.writeln(''); FENETRE.document.writeln(''); FENETRE.document.writeln(''); FENETRE.document.writeln(' '); FENETRE.document.writeln(' '); FENETRE.document.writeln(' '); FENETRE.document.writeln(' '); FENETRE.document.writeln(' '); FENETRE.document.writeln(' '); FENETRE.document.writeln(' '); FENETRE.document.writeln('
INFORMATION \"Fermer\"

'); FENETRE.document.writeln('
'); FENETRE.document.writeln(''); FENETRE.document.writeln(errorMessage); FENETRE.document.writeln('
'); FENETRE.document.writeln('
'); FENETRE.document.writeln('
'); FENETRE.document.writeln(''); FENETRE.document.writeln(''); if (FENETRE != null) { FENETRE.focus(); } } /* Force la sortie du mode connexion sécurisée */ function exitHttps() { var chaine = window.location.href; if(chaine.indexOf("https") >= 0){ chaine = "http"+chaine.substring(5,chaine.length); if(chaine.indexOf("login") >= 0){ chaine = chaine.substring(0,chaine.indexOf("login"))+"accueil"; } window.location.href = chaine; } } /* Remplacement des accents */ function replaceacc(chaine) { var machaine= chaine; while(machaine.indexOf(unescape('%E9')) != -1) machaine=machaine.replace(unescape('%E9'),'e'); while(machaine.indexOf(unescape('%E8')) != -1) machaine=machaine.replace(unescape('%E8'),'e'); while(machaine.indexOf(unescape('%EA')) != -1) machaine=machaine.replace(unescape('%EA'),'e'); while(machaine.indexOf(unescape('%E7')) != -1) machaine=machaine.replace(unescape('%E7'),'c'); while(machaine.indexOf(unescape('%F9')) != -1) machaine=machaine.replace(unescape('%F9'),'u'); while(machaine.indexOf(unescape('%E0')) != -1) machaine=machaine.replace(unescape('%E0'),'a'); return machaine; } /* Fonction MacroMedia */ function MM_findObj(n, d) { //v4.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p); } if(!(x=d[n])&&d.all) { x=d.all[n]; } for (i=0;!x&&i