// Specify URLs to randomly select from and pop-under. Add or take away freely.
var popunder = "/survey.aspx";

// Specify the width and height of new popunder window (in pixels).
var width = '500';
var height = '520';

var p = 'scrollbars=no,resizable=yes,toolbar=no,' + 
'menubar=yes,status=yes,location=no,left=85,top=20,height=' + 
height + ',width=' + width;

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/;domain=" + document.domain;
}

function get_cookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	//alert('cookie string='+ca);
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function loadPopUp(){
    //alert("domain="+document.domain + "\n cookie=" + document.cookie);
	if ((get_cookie('showpopunder') == '') || (get_cookie('showpopunder') == 'yes')) {
		var win2 = window.open(popunder, "bw", p);
		
		if (win2 != null) {
			win2.blur();
			window.focus();
		}
		
	}

		//document.cookie="showpopunder=no;path=/";

}

