/*
var staying_in_site = false;
var domain_name = "";
function checkNavigation(e) {
	staying_in_site = !(e.target.tagName == 'undefined');
};

$(document).ready(function() {
	// if this user has submitted form even once we don't want to show aything
	if ( Cookie.get("ls_form_submit") == "true" )
		return alert("cookie" + Cookie.get("ls_form_submit") );
	
	domain_name = document.location.host;
	document.onclick = checkNavigation;
	window.onbeforeunload = popup;
});

function popup() {
	if (staying_in_site){
		staying_in_site = false;
		return; // this has to be here otherwise nounload shows confirmation box on every click.
	}
	
	var going_away = document.referrer.indexOf(domain_name)<0;
	if ( going_away ){
		window.location.href = "/consumer/mortgage-rates-listing.html?from="+window.location.href;
		window.onbeforeunload = null; // this is needed otherwise chrome and safari do not properly handle the event. infinite loop or double execution
		return "Stay to Get Refinancing Options and Rates?";
	}
}

function lead_form_submit(){
	// User is submitting lead form. We don't want to show rates to this user.
	window.onbeforeunload = null;
	Cookie.set("ls_form_submit", "true");
}	
*/
function showPop(u,w,h){ mywin = window.open(u,"pop",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='+w+',height='+h+''); }
function showPopNoScroll(u,w,h){ mywin = window.open(u,"pop",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+w+',height='+h+''); }
