if (!scdo) var scdo=false;
if (!stdo) var stdo=false;
if (!cldo) var cldo=false;
if (!redired) var redired=false;
if (!vs) var vs=0;
if (!http)
{
	var http = 'http://';
	if (document.URL.indexOf('https://')==0) http = 'https://';
}

var domain='.partycasino.com';
var pnx;
//window.onload=sc();
function sc(pn)
{
	pnx=pn;
	if(scdo) return;
	scdo=true;
	redir=gck("REDIR");
	value=0;
	wmv=0;
	if (redir)
	{
		if(redir=='1') clrdr();		
		wmv=parseInt(gck("PCWMID"));
		if (!isNaN(wmv)) value=wmv;
		redired=true;
	}
	else
	{
		wmv=parseInt(gqs("wm"));		
		if (!isNaN(wmv))
		{
			value=wmv;
			if (value>1000000)
			{
				redired=true;
				setrdr(value);
				setwm(value,30);
			}
		}
		if(top!=self) redired=true;
	}
	
	ref=document.referrer;	
	if((ref) && (ref.length > 7) && (value==0))
	{
		ref=ref.toLowerCase();
		ref=ref.substring(7);
		sl=ref.indexOf('/');
		if(sl > 0)ref=ref.substring(0,sl);
	
		if (ref.indexOf('search.')!=-1)value=2702811;
		if (ref.indexOf('google.')!=-1)
		{
			value=2702805;
			var keyword=gkwd(document.referrer, false);
			if (keyword=='partycasino') value=2790707;
			if (keyword=='party casino') value=2790708;
			if (keyword=='casino') value=2790709;			
			if (keyword=='online casino') value=2790710;
			if (keyword.length > 20) value=2790703;
		}
		if (ref.indexOf('yahoo.')!=-1)
		{
			value=2702806;
			var keyword=gkwd(document.referrer, true);
			if (keyword=='partycasino') value=2790711;
			if (keyword=='party casino') value=2790712;
			if (keyword=='casino') value=2790713;			
			if (keyword=='online casino') value=2790714;
			if (keyword.length > 20) value=2790705;
		}
		if (ref.indexOf('msn.')!=-1)
		{
			value=2702807;
			var keyword=gkwd(document.referrer, false);
			if (keyword=='partycasino') value=2790715;
			if (keyword=='party casino') value=2790716;
			if (keyword=='casino') value=2790717;			
			if (keyword=='online casino') value=2790718;
			if (keyword.length > 20) value=2790706;
		}
		if (ref.indexOf('ask.')!=-1)value=2702808;
		if (ref.indexOf('altavista.')!=-1)value=2702810;
		if (ref.indexOf('aol.')!=-1)value=2702809;
		if (ref.indexOf('myway.')!=-1)value=2702812;
		if (value>0)
		{			
			setwm(value,300);
		}
	}
	
	if (value==0) 
	{
		wmv=parseInt(gck("PCWMID"));
		if (!isNaN(wmv)) value=wmv;
	}
	
	if ((value==0) && (document.title) && (document.title.indexOf("Page not found")!=-1))
	{
		value=2238044;
		setwm(value,30);
	}
	
	if (value==0) value=1000000;
		
		
	if (http=='http://')
	{
		if (redired) f(6655000,value,0,pn); else f(6655443,value,1,pn);
	}	
}


function f(id,s,drct,pn){
if (http=='https://') return;
if(stdo){return;} stdo=true;
if(!s){s=0;xt=''}else{xt='&xt='+s;s=1;}
if(!drct){redir=gck("REDIR");if(redir)drct=0;else drct=1;}
u='stats'+domain;i='tracker.gif';h=escape(location.hostname);
if(!pn){p=escape(location.pathname);}else{p=pn;}t=escape(document.title);r=escape(document.referrer);da=new Date();
z=da.getTimezoneOffset();m=da.getTime();g=screen.height;w=screen.width;c=screen.colorDepth;q=l(window.location.search);
fp=0;if(top!=self)fp=1;
img=http+u+'/'+i+'?l='+h+'&d='+p+'&t='+t+'&r='+r+'&z='+z+'&m='+m+'&g='+g+'&w='+w+'&c='+c+'&i='+id+'&fp='+fp+'&ck='+cc()+'&dr='+drct+'&s='+s+q+xt;
ig=new Image();ig.src=img;
}

function l(q){var r='';if(q.length>1)q=q.substring(1, q.length); else return r;
for(var i=0;i<q.split("&").length;i++){r+=sf(q.split("&")[i]);}return r;}

function sf(v){return '&ql-'+v.split("=")[0]+'='+v.split("=")[1];}

function d(id,fi){s=0;xt='';u='stats'+domain;i='tracker.gif';h=escape(location.hostname);
p=escape(fi);t=escape(document.title);r=escape(document.referrer);da=new Date();
z=da.getTimezoneOffset();m=da.getTime();g=screen.height;w=screen.width;c=screen.colorDepth;q=l(window.location.search);
img=http+u+'/'+i+'?l='+h+'&d='+p+'&t='+t+'&r='+r+'&z='+z+'&m='+m+'&g='+g+'&w='+w+'&c='+c+'&i='+id+'&s='+s+q+xt;
ig=new Image();ig.src=img;}

function ck(bt){if (redired) ct(6655020,bt); else ct(7755443,bt);}

function ct(id,bt){
if(cldo){return;} 
cldo=true;s=0;xt='';
u='stats'+domain;i='tracker.gif';h=escape(location.hostname);
p=escape(location.pathname);if(pnx){p=pnx;} t=escape(document.title);r=escape(document.referrer);da=new Date();
z=da.getTimezoneOffset();m=da.getTime();g=screen.height;w=screen.width;c=screen.colorDepth;q=l(window.location.search);
img=http+u+'/'+i+'?l='+h+'&d='+p+'&t='+t+'&r='+r+'&z='+z+'&m='+m+'&g='+g+'&w='+w+'&c='+c+'&i='+id+'&ct='+escape(bt)+'&vs='+vs+'&s='+s+q+xt;
ig=new Image();ig.src=img;}

function gck(nm) {
var dock=document.cookie;var prefix=nm+"=";var begin = dock.indexOf("; "+prefix);	
if (begin == -1){begin = dock.indexOf(prefix);if (begin != 0){return null;}}else{begin+=2;}
var end=dock.indexOf(";", begin);if (end == -1) {end = dock.length;}
return unescape(dock.substring(begin + prefix.length, end));}


function clrdr(){document.cookie="REDIR=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain="+domain;}

function setrdr(vl){document.cookie="REDIR=1-wm:"+vl+"; path=/";}

function setwm(value,offset)
{var date = new Date();date.setTime(date.getTime()+(offset*86400000));
var exp="; expires="+date.toGMTString();document.cookie = "PCWMID="+value+exp+"; path=/; domain=" + domain;}

function cc(){rv=gck('TRKR');nw=0;if(rv<=2147483647)rv==null;
if(!rv){var n1=parseInt(Math.random()*922337203);var n2=parseInt(Math.random()*2147483647);
rv=''+n1+''+n2;nw=1;}xc(rv);if(nw){rv=rv+'&kn=1'}return rv;}

function xc(cv)
{var dt=new Date();dt.setTime(dt.getTime()+(365*86400000));
document.cookie="TRKR="+cv+";expires="+dt.toGMTString()+";path=/;domain="+domain;}

function gqs(nm) {var s2=window.location.search;var s1=s2.indexOf(nm+"=");
if (s1==-1) return null;var l1=s1+nm.length+1;
var e1=s2.indexOf("&",l1);if (e1==-1) return unescape(s2.substring(l1));
return unescape(s2.substring(l1,e1));}

function gkwd(ref, isyahoo)
{index=0;if (isyahoo){index=ref.toLowerCase().indexOf('p=');}else{index=ref.toLowerCase().indexOf('q=');}
if (index == -1) return ''; substr = ref.substring(index+2); endkeyword = substr.indexOf('&');
if (endkeyword==-1){return unescape(substr.toLowerCase()).replace('+',' ');}
nkeyword = substr.substring(0,endkeyword);nkeyword = unescape(nkeyword.toLowerCase()).replace('+',' ');
return nkeyword;}
