document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/style.css\" >");
if(self.location != top.location)
{
top.location.href = self.location;
}

var MSIE = (navigator.userAgent.indexOf("MSIE") != -1)?true:false;
function get(name)
{
	query = window.location.search.substring(1);
	qstringsplit = query.split("&");
	t = "0";
	while(t <= qstringsplit.length-1)
	{
		eachval = qstringsplit[t];
		valsplit = eachval.split("=");
                i = "0";j = "1";
                while(i <= qstringsplit.length-1)
		{
			if(valsplit[i] == name)
			{
				returnthis = valsplit[j];
				returnthis = returnthis.replace("+"," ");
				returnthis = returnthis.replace("%20"," ");
				return returnthis;
			}
			i++;j++;
		}
		t++;
	}
}

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=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	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 eraseCookie(name)
{
	createCookie(name,"",-1);
}

function popunder(purl)
{
	if(!readCookie("__POPUNDER__"))
	{
		createCookie("__POPUNDER__",purl,"1");
		var popunder = window.open(purl,"Popunder");
		popunder.blur();
	}
}

function popTrade()
{
	if(!readCookie("__popTrade__"))
	{
		createCookie("__popTrade__","_y_e_s_","1");
		var popunder = window.open("http://www.steamyadultvisual.com/","popTrade");
		popunder.blur();
	}
}


		
function redirect(newloc)
{
	if(!readCookie("__PROMO__"))
	{
		createCookie("__PROMO__","__CREATE__","1");
		window.location = newloc;
	}
}



