var ExitPopURL='http://www.andysowards.com/dev/exitpop/exit.php';var AlertBox="*****************************************************\n\nWait! Stop! Don't Go!\n\nBefore leaving, please leave a comment on the \n\nscript post and share your suggestions.\n\nThanks for visiting AndySowards.com.\n\nAndy   \n\n*****************************************************";window.onload=function(){createExitPop();}
function ajaxGET(divId,page,effect)
{var xmlHttp;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{alert("Your browser does not support AJAX!");return false;}}}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4)
{if(effect=='collapse'){document.getElementById(divId).style.display='none';}
else{document.getElementById(divId).innerHTML=xmlHttp.responseText;}}}
xmlHttp.open("GET",page,true);xmlHttp.send(null);}
function createExitPop()
{var theBody=document.getElementsByTagName('body')[0];var newdiv=document.createElement('div');newdiv.setAttribute('id','ExitDiv');theBody.setAttribute('id','body');newdiv.setAttribute('style','width: 100%; height: 100%;');theBody.appendChild(newdiv);document.getElementById('ExitDiv').value=ajaxGET('ExitDiv',ExitPopURL);document.getElementById('ExitDiv').style.display="none";document.getElementById('ExitDiv').style.top='0px';document.getElementById('ExitDiv').style.left='0px';document.getElementById('ExitDiv').style.position='relative';document.getElementById('ExitDiv').style.backgroundColor='#FFFFFF';}
isExit=true;function ExitPop(isExit){if(isExit!=false){isExit=false;isPop=true;var bodyTag=document.getElementById?document.getElementsByTagName("BODY")[0]:document.body;bodyTag.setAttribute("id","body");bodyTag.innerHTML=document.getElementById('ExitDiv').innerHTML;return AlertBox;}}
window.onbeforeunload=function(){return ExitPop(isExit);}
