function locationReplace(url){
setExitPopupFlag();
location.href = url;
}


/* Sets "exit_popup_flag" to "Y", which means do not show (see winOnUnLoad() below). */
function setExitPopupFlag() {
document.myform.exit_popup_flag.value = "Y";
return;
}


/* Pops up the exit pop page. */
function winOnUnLoad(url, features){
var isIE = "0";
var isNS = "0";
var hyperText;
var HrefLocation;
var Server;
var Folder;
var PageName;

HrefLocation = location.href.split("/");
hyperText = HrefLocation[0];
Server = HrefLocation[2];
Folder = HrefLocation[3];
PageName = HrefLocation[4];
PageName = PageName.split("?");
PageName = PageName[0].split(".");
PageName = PageName[0];

fullurl =hyperText + "//" + Server + "/" + Folder + "/" + url;

if (navigator.userAgent.indexOf("MSIE") != -1){
 var isIE = "1";
} else {
 var isNS = "1";
}

/* The page level hidden input field, exit_popup_flag, means "do not show the exit pop page".If set to "Y", the page will not show.
 * If set to N, the page will show.See immediately below.
 */
var do_not_show_exit_popup = document.myform.exit_popup_flag.value;
if (do_not_show_exit_popup != "Y") {
 if (isIE == "1") {
parent_size= "width="+document.body.clientWidth+
",height="+document.body.clientHeight;
fullurl = fullurl + '&psize='+parent_size;
window.open (fullurl, PageName, features);
} else {
parent_size= "width="+window.outerWidth+
",height="+window.outerHeight;
fullurl = fullurl + '&psize='+parent_size;
window.open (fullurl, PageName, features);
}
}
}

function imgNoThanks_onclick() {
var bAns;
bAns = confirm("By closing this window, you will miss this great offer.");

if (bAns)
top.close();
}

function open_nothanks_redirect_page(strRedirectPageName,strAffiliateKey){
	var boolConfirm;
	var strURL;
	boolConfirm = confirm("By closing this window, you will miss this great offer.");
	
	if(boolConfirm){
		if(strRedirectPageName != ''){
			strURL = '../pxp/hug/' + strAffiliateKey + '/' + strRedirectPageName;
			location.href = strURL;
		}else {
			window.close();
		}
	}
}