function redirigerAccueil(msg,lang) { var pageAccueilURL; if (lang == 'en') { pageAccueilURL = "http://www.immigration-quebec.gouv.qc.ca/en/electronic-services/caq-electronic/index.html"; } else { pageAccueilURL = "http://www.immigration-quebec.gouv.qc.ca/fr/services/caq-electronique/index.html"; } alert(msg); location.href=pageAccueilURL; } function avertirChoixChangeNiv(choix,msg) { var idx = choix.value; if (idx == 0) { if(confirm(msg)) { return true; } else { choix.checked = false; return false; } } return true; } function avertirChoixBur(choix,msg) { var idx = choix.value; if (idx == 0 || idx == 1) { if(confirm(msg)) { return true; } else { choix.checked = false; return false; } } return true; } function avertirChoixTutNon(msg) { window.open("fermer.jspx","LogoutWindow","width=400,height=350,status=yes,resizable=yes"); } function avertirChoixTut(choix,msg,message) { var idx = choix.value; if (idx == 'TUT') { if(confirm(msg)) { return true; } else { avertirChoixTutNon(message) } } return true; } function getIEVersionNumber() { var ua = navigator.userAgent; var MSIEOffset = ua.indexOf("MSIE"); if (MSIEOffset == -1) { return 0; } else { return parseFloat(ua.substring(MSIEOffset + 5, ua.indexOf(";", MSIEOffset))); } } function myAlert(evt){ alert("sl sl sl test: "); } function doAlert(msg) { alert("You are about to exit sl sl sl test: "); } function doUnload(evt){ var left = window.screenLeft; var top = window.screenTop; var e = (window.event) ? window.event : evt; var y = e.clientY; var x = e.clientX; var abssize = document.body.offsetWidth-30; var IEVersion = getIEVersionNumber(); if (IEVersion >= 7) { if (y < 0 && x >= abssize) { //alert("You are about to exit : " + window.screenLeft + "," + window.screenTop + ",clientY: " + y); window.open("fermer.jspx","LogoutWindow","width=400,height=350,status=yes,resizable=yes"); } } else { if (left == 10004) { window.open("fermer.jspx","LogoutWindow","width=400,height=350,status=yes,resizable=yes"); } } } function parseUrlParameters(url) { var obj = new Object(); var nvpairs = url.substring(1).split("&"); for (var idx = 0; idx < nvpairs.length; idx++) { var tokens = nvpairs[idx].split("="); obj[unescape(tokens[0])] = tokens.length == 2 ? unescape(tokens[1]) : undefined; } return obj; }