showPopup = true;
var exitWin = null;

function openExitPopup() {
	
	showPopup = false;
	
	if(document.cookie.search(/exitPopupShown/) != -1)
		cancelPopup();
	/*var windowAtts = 'width=220,height=160'
	
	if(window.screenX){
		myX = window.screenX
		myY = window.screenY
	}
	else{
		myX = window.screenLeft;
		myY = window.screenTop;
	}
	
	var windowAtts = 'width=220,height=160,top='+(myY+10)+',left='+(myX+10);*/
	
	if(showPopup && (!exitWin || exitWin.closed)) {
		
		expireDate = new Date
		expireDate.setDate(expireDate.getDate()+1)
	  	document.cookie = "exitPopupShown=true; path=/; expires=" + expireDate.toGMTString()
	
		exitWin = window.open('/index.cfm/fuseAction/content.exitPopup/contentID/3503de54-f4de-4112-b743-928c530ac816/suppressLayout/1','exitWin','width=220,height=160');
		//exitWin.blur();
		window.focus();
		cancelPopup();
		
	}
	
}

function cancelPopup(){
	showPopup = false;
}

function enablePopup(){
	showPopup = true;
}


function captureClicks(){
		
	for(var index=0;index<document.links.length;index++){
		document.links[index].onclick = cancelPopup;
	}
	
	for(var index=0;index<document.forms.length;index++){
		document.forms[index].onclick = cancelPopup;
	}
	
	for(var index=0;index<document.embeds.length;index++){
		document.embeds[index].onclick = cancelPopup;
	}
	//alert(document.embeds.length);

}


//document.onfocus = enablePopup;