// JavaScript Document: pupop for newsletter signup

function GetCookie(name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal(j);
	i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0) break;

		}
		return "yes";
}

function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function doPopup()
	{
		var showme = null;
		showme=GetCookie('showsignup');

		if(showme=='yes')
			{
				url = "http://www.ipfrontline.com/popup/popupintro.asp";
				width = 268;  // width of window in pixels
				height = 401; // height of window in pixels
				delay = 2;    // time in seconds before popup opens
				timer = setTimeout("Start(url, width, height)", delay*1000);
			}
	}

closetime = 0; // Close window after __ number of seconds?
// 0 = do not close, anything else = number of seconds
function Start(URL, WIDTH, HEIGHT) {
	windowprops = "left=50,top=50,width=" + WIDTH + ",height=" + HEIGHT +",scrollbars=no" ;
	preview = window.open(URL, "preview", windowprops);
	if (closetime) {setTimeout("preview.close();", closetime*1000);}
}
