function setCookie(cookieName, cookieValue, cookiePath, cookieExpires)  
{ 

cookieValue = escape(cookieValue);  
if (cookieExpires == "")  
	{  
	var nowDate = new Date();  
	nowDate.setMonth(nowDate.getMonth() + 6);  
	cookieExpires = nowDate.toGMTString();  
	}  

if (cookiePath != "")  
	{  
	cookiePath = ";Path=" + cookiePath;  
	}  

document.cookie = cookieName + "=" + cookieValue +  ";expires=" + cookieExpires + cookiePath; 
} 

function getCookie(name)  
{ 
var cookieString = document.cookie;  
var index = cookieString.indexOf(name + "=");  

if (index == -1) 
	{ 
	return null;  
	} 

index = cookieString.indexOf("=", index) + 1;  
var endstr = cookieString.indexOf(";", index);  

if (endstr == -1) 
	{ 
	endstr = cookieString.length;  
	} 

return unescape(cookieString.substring(index, endstr)); 
} 

function doPopup() 
{ 
var ezine = getCookie('popupShown'); 
setCookie('popupShown', 'true', '', ''); 

if(ezine != 'true') 
 	{ // Show the popup window 
   	window.open('sprett.html', 'ezineWin', 'width=225,height=446'); 
 	} 
}
