// Cephinet - Philippe Ardit - 03/09/2008 // submit the form on the main directory server function doSubmit() { var form = document.forms[0]; var formAction = form.action.toString(); //alert(formAction); if (formAction.toLowerCase().indexOf("?login") == -1) { var index = formAction.indexOf("://"); if ( index != -1 ) { formAction = formAction.substr(index+3); index = formAction.indexOf("/"); if ( index != -1 ) formAction = formAction.substr(index+1); } form.action = "http://webmail.cephinet.info/" + formAction ; } //alert(form.action); form.submit(); }; // Cephinet - Philippe Ardit - 03/09/2008 // check and force the hostname to be in .cephinet.info for MSSO to work fine function replaceHostName() { var url1 = window.location.toString().toLowerCase(); // replaces part of host names by *.cephinet.info var re = /\.cephinet\.fr|\.cephinet\.net|\.cephinet\.com/; url2 = url1.replace(re, '.cephinet.info'); var re = /www\.bcsar38\.fr/; url2 = url2.replace(re, 'bcsar38.cephinet.info'); // if not allready in *.cephinet.info, then force to be cwp.cephinet.info if (url2.indexOf(".cephinet.info") == -1) { var re = /http:\/\/[^\/]*\/|https:\/\/[^\/]*\//; var url2 = url2.replace(re, 'http://webmail.cephinet.info/'); } if (url1 != url2 | window.location != window.top.location) { window.top.location.replace(url2); //alert("Redirecting \n" + url1 + '\nto :\n' + url2); } } // Ok with : Internet Explorer 8, Opera 9 (not working in Firefox) // Repérage utilisation de la touche entrée et Esc function checkEnter(e){ //e is event object passed from function invocation var key; //literal character code will be stored in this variable if(e && e.which){ //if which property of event object is supported (NN4) key = e.which; //character code is contained in NN4's which property } else if (window.event) { e = window.event; key = e.keyCode; //character code is contained in IE's keyCode property } if (key == 13) { doSubmit(); return false; }; if (key == 27) { window.close(); return false; }; return true; } if (document.layers) document.captureEvents(Event.KEYPRESS); document.onkeypress = checkEnter;