function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); }}}
function addClickEvent(a,i,func) { if (typeof a[i].onclick != 'function') { a[i].onclick = func; } }
var theDiv = '
';if (WhichBrowser()=='firefox'){theDiv = theDiv + '
';
}else{theDiv = theDiv + '
'; }theDiv = theDiv + '
';
theDiv = theDiv + '
';
theBody = document.body; if (!theBody) {theBody = document.getElementById("body"); if (!theBody) {theBody = document.getElementsByTagName("body")[0];}}
var PreventExitSplash = false;
function DisplayExitSplash(){ if(PreventExitSplash == false){ window.scrollTo(0,0);
if(navigator.userAgent.toLowerCase().indexOf('firefox') <= -1){
window.alert(exitsplashalertmessage.replace(/BUTTONTEXT/i, GetButtonText()));
}
PreventExitSplash=true; divtag = document.createElement("div"); divtag.setAttribute("id","ExitSplashMainOuterLayer"); divtag.style.position="absolute"; divtag.style.width="100%"; divtag.style.height="100%"; divtag.style.zIndex="99"; divtag.style.left="0px"; divtag.style.top="0px"; divtag.innerHTML=theDiv; theBody.innerHTML=""; theBody.topMargin="0px"; theBody.rightMargin="0px"; theBody.bottomMargin="0px"; theBody.leftMargin="0px"; theBody.style.overflow="hidden"; theBody.appendChild(divtag); return exitsplashmessage.replace(/BUTTONTEXT/i, GetButtonText()); } }
var a = document.getElementsByTagName('A'); for (var i = 0; i < a.length; i++) { if(a[i].target !== '_blank') {addClickEvent(a,i, function(){ PreventExitSplash=true; });} else{addClickEvent(a,i, function(){ PreventExitSplash=false;});}}disablelinksfunc = function(){var a = document.getElementsByTagName('A'); for (var i = 0; i < a.length; i++) { if(a[i].target !== '_blank') {addClickEvent(a,i, function(){ PreventExitSplash=true; });} else{addClickEvent(a,i, function(){ PreventExitSplash=false;});}}}
hideexitcancelbuttonimage = function(){ document.getElementById('ExitCancelButtonImageDiv').style.display='none'; }
addLoadEvent(disablelinksfunc);
disableformsfunc = function(){ var f = document.getElementsByTagName('FORM'); for (var i=0;i=4){//firefox 4 or above
return true;
}else{ return false;}//below firefox 4
}
else{ return false;}//not firefox
}
function WhichBrowser(){
var whichone = "";
if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){whichone = "firefox";
}else if(/Chrome[\/\s](\d+\.\d+)/.test(navigator.userAgent)){whichone = "chrome";
}else if(/MSIE[\/\s](\d+\.\d+)/.test(navigator.userAgent)){whichone = "msie";
}else {whichone = "other";}
return whichone;
}
function GetButtonText(){
var mybrowser = WhichBrowser();
if (mybrowser=='firefox'){return "Stay on Page";}
else if(mybrowser=='chrome'){return "Stay on this Page";}
else{return "Cancel";}
}