(function()
{
function s(b)
{
	return b!=null?'"'+b+'"':'""'
}
function e(b)
{
	if(typeof encodeURIComponent=="function")
	{
		return encodeURIComponent(b)
	}
	else
	{
		return encodeURI(b)
	}
}
function G(n,v)
{
	if(v)
	{
		window.s_url+="&"+n+"="+v
	}
}
function D(w,t,d)
{
	var s=w.screen,j='0';
	var z_ran = Math.floor(Math.random()*10000);
	tz=-t.getTimezoneOffset();
	if(navigator.javaEnabled())j='1';
	if(s)
	{
		G("s_type",w.s_type);
		G("s_sh",s.height);//分辨率->高
		G("s_sw",s.width);//分辨率->宽
		G("s_scd",s.colorDepth)//分辨率->颜色
	}
	G("s_url",w.union_code_url);//来源
	G("s_uref",w.union_ref_url);//上级来源
	G("s_urefk",w.union_ref_k);
	G("s_utz",tz/60);//时区
	G("s_ran",z_ran);//时区
	G("s_uhis",history.length);
	G("s_ujava",j);
	G("s_ufv",F());//浏览器版本
	if(navigator.plugins)
	{
		G("s_unplug",navigator.plugins.length)
	}
	if(navigator.mimeTypes)
	{
		G("s_unmime",navigator.mimeTypes.length)
	}
}

function B(w,d)
{
	return w.top.location==d.location
}
function S(w,a,sr)
{
	if(w.s_type=="1")//Iframe广告
	{
		a.write('<iframe name="s_iframe" width='+s(w.s_width)+" height="+s(w.s_height)+" frameborder=0 src="+s(sr)+' marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no">');
		a.write("</iframe>")
	}
	else//JS广告
	{
		a.write('<script language="JavaScript1.1" src='+s(sr)+" charset=gbk><\/script>")
	}
}
function A()
{
	var w=window,d=document,t=new Date;
	w.s_url="http://page.sinoloong.com/show.php?";
	w.s_url+="s_sid="+w.s_client;
	w.s_url+="&s_slotid="+w.s_slot;
	w.s_url+="&s_width="+w.s_width;
	w.s_url+="&s_height="+w.s_height;
	if(w.union_num_ads_zone)
	{
		w.union_num_ads_zone=w.union_num_ads_zone+1
	}
	else
	{
		w.union_num_ads_zone=1
	}
	if(w.union_num_ads_zone>20)
	{
		return
	}
	if(B(w,d)&&d.body)
	{
		var j=d.body.scrollHeight,v=d.body.clientHeight;
		if(v&&j)
		{
			G("s_uc_ks",Math.round(j))
		}
	}
	D(w,t,d);
	S(w,d,w.s_url)
}
function C(w,d)
{
	return true
}
function E()
{
	var w=window,d=document,e=null;
	g=d.referrer,w.onerror123=C;
	if(w.union_code_url==e)
	{
		w.union_code_url=escape(w.location);
		if(!B(w,d))
		{
			w.union_code_url=g
		}
	}
	w.union_ref_url='';
	if(B(w,d)&&g)
	{
		w.union_ref_url=escape(g)
	}
}
var Z={};
function ya(b)
{
	if(b in Z)return Z[b];
	return Z[b]=navigator.userAgent.toLowerCase().indexOf(b)!=-1
}
function F()
{
	if(navigator.plugins&&navigator.mimeTypes.length)
	{
		var b=navigator.plugins["Shockwave Flash"];
		if(b&&b.description)return b.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s)+r/,".")
	}
	else if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0)
	{
		var a=3,c=1;
		while(c)
		try
		{
			c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+(a+1));
			a++
		}
		catch(e)
		{
			c=null
		}
		return a.toString()
	}
	else if(ya("msie")&&!window.opera)
	{
		var c=null;
		try
		{
			c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")
		}
		catch(e)
		{
			var a=0;
			try
			{
				c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				a=6;
				c.AllowScriptAccess="always"
			}
			catch(e)
			{
				if(a==6)return a.toString()
			}
			try
			{
				c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")
			}
			catch(e)
			{
			}
		}
		if(c!=null)
		{
			var a=c.GetVariable("$version").split(" ")[1];
			return a.replace(/,/g,".")
		}
	}
	return"0"
}
function K(r)
{
	var s=["wd","p","q","keyword","kw","w","key","word","query","q1","name"];
	if(r!=""&&r!=null)
	{
		for(var i=0;i<s.length;i++)
		{
			var re=new RegExp("[^1-9a-zA-Z]"+s[i]+"=\([^&]*\)");
			var kk=r.match(re);
			if(kk!=null)
			{
				return kk[1]
			}
		}
	}
	return""
}
E();//获取来源页面
A();
})();
