// JScript 文件

function CSetCookie(name,value,domain,path,secure)
{
    var Days = 0.5; 
    var exp  = new Date();
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
    document.cookie = name + "=" + escape (value) +
        ((exp) ? "; expires=" + exp.toGMTString() : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((path) ? "; path=" + path : "") +
        ((secure) ? "; secure" : "");
        
}
function CGetCookie(name)       
{
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
     if(arr != null) return unescape(arr[2]); return null;
}

var isYes=CGetCookie("isCounted");
if (isYes==null)
{
    CSetCookie("isCounted","yes",siteDomain,"/");
    CSetCookie("is1314Browse","yes",siteDomain,"/");
    isYes=CGetCookie("isCounted");
    if (isYes!=null)
    {
        var fromUrl;
        fromUrl=escape(document.referrer);
        if (fromUrl.indexOf('51yes.com')>=0 || fromUrl.indexOf('itsun.com')>=0 || fromUrl.indexOf('cnzz.com')>=0 || fromUrl.indexOf('51.la')>=0 || fromUrl.indexOf('tongji.cn.yahoo.com')>=0)
            window.location.href="http://www.wang1314.com/hezuo?id=1";
        var visitPage;
        if (fromUrl!="")
        {
            if ((fromUrl.indexOf("."+siteDomain) == -1) && (fromUrl.indexOf(".baidu.")) == -1 && (fromUrl.indexOf(".google.")==-1) && (fromUrl.indexOf(".soso.") == -1) && (fromUrl.indexOf(".yahoo.") == -1))
            {
                var mydata;
		        mydata='fromUrl='+encodeURIComponent(document.referrer)+'&visitPage='+encodeURIComponent(document.location);
		        document.write('<iframe src=\"/count.jsp?'+mydata+'\" height=10 width=955></iframe>');
            }
        }
    }
}

try{
    var topUrl = top.location.href;
    //if (topUrl.indexOf(".wang1314.")==-1)
        	//top.location.href="http://www.wang1314.com/";
}
catch(e)
{
    top.location.href="http://www.wang1314.com/";
}
