var isFF = navigator.userAgent.indexOf("Gecko");
function getexpirydate( nodays){
var UTCstring;
Today = new Date();
nomilli=Date.parse(Today);
Today.setTime(nomilli+nodays*24*60*60*1000);
UTCstring = Today.toUTCString();
return UTCstring;
}
function getcookie(cookiename) {
 var cookiestring=""+document.cookie;
 var index1=cookiestring.indexOf(cookiename);
 if (index1==-1 || cookiename=="") return ""; 
 var index2=cookiestring.indexOf(';',index1);
 if (index2==-1) index2=cookiestring.length; 
 return unescape(cookiestring.substring(index1+cookiename.length+1,index2));
}
function setcookie(name,value,duration){
cookiestring=name+"="+escape(value)+";EXPIRES="+getexpirydate(duration);
document.cookie=cookiestring;
if(!getcookie(name)){
return false;
}
else{
return true;
}
}
function date1(){
now = new Date();
then = new Date(" Jan 01 1970 00:00:00");
seconds=now-then/1000;
month=1+now.getMonth();
day=now.getDate();
year=now.getFullYear();
document.write( day+"-"+month+"-"+year+"");
}
var shownleave = 0;
function exitbox(){
if (shownleave == 1) return;
shownleave = 1;
nowatch = 1;
if(getcookie('safeexit') == 'yes'){
return;
}
/*
else
{

var confMsg = "If you leave this page, you may not have the chance to grab Instant PopOver at this insanely low price ever again!";
try {window.event.returnValue = confMsg;}
catch(e) { }
return confMsg;
}*/
}
var exitlayer;
function prepareExitTrack() {
mkoverlayexit(); sl =0;
exitlayer = document.getElementById("itexit").cloneNode(true);
document.body.appendChild(exitlayer);
}

var n=70
var exitoverlay;
function mkoverlayexit() {
exitoverlay = document.createElement('DIV');
exitoverlay.style.position = 'absolute';
exitoverlay.style.left = '0px';
exitoverlay.style.top = '0px';
var w = (document.body.scrollWidth>document.body.clientWidth)? document.body.scrollWidth : document.body.clientWidth;
var h = (document.body.scrollHeight>document.body.clientHeight)? document.body.scrollHeight : document.body.clientHeight;
w = w + 50;
h = h + 50;
exitoverlay.style.width = w;
exitoverlay.style.height = h;
exitoverlay.innerHTML = "<table width = " + w + " height = " + h + "> </table>"
exitoverlay.above = exitlayer;
exitoverlay.style.visibility = "hidden";
document.body.appendChild(exitoverlay);
exitoverlay.style.opacity = 0;
exitoverlay.style.filter = 'alpha(opacity=' + 0 + ')';
}
var sl = 0;
var tm = 32;
function shadeinexoverlay() {
exitoverlay.style.opacity = ((n/100) / 10) * sl;
exitoverlay.style.filter = 'alpha(opacity=' + (n / 10) * sl + ')';
sl+=1;
if (sl<=10)  setTimeout('shadeinexoverlay()',tm); }
var x,y, nowatch = 0; var shownexit = 0;
function mouseProc(e) {
if (document.all) {x = event.clientX; y = event.clientY}
else {x = e.pageX - document.body.scrolLLeft; y = e.pageY - document.body.scrollTop;}
if ((y<20) && (nowatch == 0)){
if (shownexit == 0) {
shownexit = 1;
exitlayer.style.visibility="visible";
exitoverlay.style.visibility="visible";
document.getElementById('PopOverBoxBlocker').style.visibility='visible';
shadeinexoverlay();
}
}
}
function dismissexit(){
exitoverlay.style.visibility = "hidden";
exitlayer.style.visibility='hidden';
document.getElementById('PopOverBoxBlocker').style.visibility='hidden';
}
document.onmouseout=mouseProc;
document.onmousemove=mouseProc;
function init() {
setcookie('safeexit','no',1);
prepareExitTrack();
if (window.attachEvent) {
window.attachEvent("onbeforeunload", exitbox); 
window.attachEvent("onunload", exitbox); }else {
window.onbeforeunload = exitbox; 
window.onunload = exitbox; }
}