//Function for setting the cookie
function setCookie(name) 
{
	
	var quickexpdate = new Date();
	quickexpdate.setTime(quickexpdate.getTime() + 1*60*60*1000); //for one hour
    document.cookie = name + "=On;expires=" + quickexpdate.toGMTString();
}

//Function to get the cookie
function getCookie(name) 
{
   var index = document.cookie.indexOf(name + "=");
   if (index == -1) return null;
      index = document.cookie.indexOf("=", index) + 1;
   var endstr = document.cookie.indexOf(";", index);
   if (endstr == -1) endstr = document.cookie.length;
      return unescape(document.cookie.substring(index, endstr));
}

//Function for pop under
function goNewWin() 
{
	TheNewWin = window.open("http://64.40.111.20/best_rated_casino/bseries_popunder.php?site=german-sportscars&series=B&keys=casino","","toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1"); 
	TheNewWin.blur();	
}

//checks for the existance of the cookie
//Requires goNewWin, getCookie, setCookie
function CheckCook(name)
{
	if(!getCookie(name)) 
	{
		setCookie(name);
		goNewWin();
	}
}