﻿var domainnums;
var rands;
theDomain = new Array();

domainnums=1;
theDomain[0] = "c.x007.org";
 

if (domainnums>1)
{
  rands = Math.round(Math.random()*domainnums);
  while (rands >(domainnums-1)) {
   rands = Math.round(Math.random()*domainnums);
  }
}else{rands=0;}

if (rands==""){rands=0}
var codedomain=theDomain[rands];

var star8_location = window.location.href
var star8_from_url = document.referrer;
var star_width=0;
var star_height=0;

    if(self!=top)
    {
	var star8keshibody;
	star8keshibody=document.documentElement;
	if (eval(star8keshibody.clientWidth)<=0)
	{
	document.writeln("<body></body>");
	star8keshibody=document.body;
	}	
	if ((star8keshibody.clientWidth<=(parseInt(star_width)+100))||(star8keshibody.clientHeight<=(parseInt(star_height)+100)))
	top.location=self.location; 
    }

star8_location=encodeURIComponent(star8_location);
star8_from_url=encodeURIComponent(star8_from_url);

function setCookie(name,value) {
    var mini = star_t;
    if (mini>60)mini=1;
    var exp  = new Date();   
        exp.setTime(exp.getTime() + mini*60*1000);
        document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString()+";path=/";
}

function ReadCookie(name) 
{
    var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
        if(arr=document.cookie.match(reg)) return unescape(arr[2]);
        else return null;
}


if (star_userid!='0')
{
if ((ReadCookie("star_popm") == "")||(ReadCookie("star_popm") == null))
{
	document.writeln("<script type='text/javascript' language='javascript' src=\"http:\/\/"+codedomain+"\/p1.ashx?w="+star_userid+"&sid="+star_subid+"&e="+star_encode+"&furl="+star8_location+"&ffurl="+star8_from_url+"\"><\/script>");

	if (star_t!="0"){setCookie("star_popm","yes");}
}
}


