var adownerid="";
var adpid="194335";
window.onerror=function(){return true};
var toprefer="ZJSTAT";
var parentlocation="";
var parentrefer="ZJSTAT";
var selflocation=window.location;
var selfrefer=document.referrer;
var realrefer="";
var reallocation="";
var hourvisitnum=1;
var realvisitnum=1;
var nowdate=new Date();
var clientcolor="";
if (navigator.appName=="Netscape")
{clientcolor=screen.pixelDepth;}
else 
{clientcolor=screen.colorDepth;}

parentlocation=window.parent.location;

realrefer=selfrefer;
if(parentrefer!=="ZJSTAT")
{realrefer=parentrefer;}
if(toprefer!=="ZJSTAT")
{realrefer=toprefer;}
reallocation=parentlocation;
try{lainframe}catch(e){reallocation=selflocation;}
                                                                                                                    
var homtype=getCookie('firstpage');
if((reallocation+"").indexOf('www.myhousecare.com.cn/Product/IframeTest')>-1
  ||reallocation=='http://www.myhousecare.cn'||reallocation=='http://www.myhousecare.com.cn'||reallocation=='http://www.myhousecare.cn/static/default.aspx'||reallocation=='http://www.myhousecare.com.cn/static/default.aspx'
  ||reallocation=='http://myhousecare.cn'||reallocation=='http://myhousecare.com.cn'||reallocation=='http://myhousecare.cn/static/default.aspx'||reallocation=='http://myhousecare.com.cn/static/default.aspx'	  
  ||(reallocation+"").indexOf('http://www.myhousecare.cn/home/')>-1
  ||(reallocation+"").indexOf('http://www.myhousecare.com.cn/home/')>-1  
  ||(reallocation+"").indexOf('http://myhousecare.com.cn/home/')>-1  
  ||(reallocation+"").indexOf('http://myhousecare.cn/home/')>-1  
  ||reallocation=='http://www.myhousecare.com.cn/product/IframeTest.aspx'
  ||reallocation=='http://www.myhousecare.cn/product/IframeTest.aspx'
  ||reallocation=='http://myhousecare.cn/product/IframeTest.aspx'
  ||reallocation=='http://myhousecare.cn/Product/IframeTest.aspx'
  ||reallocation=='http://myhousecare.com.cn/product/IframeTest.aspx'
  ||reallocation=='http://myhousecare.com.cn/Product/IframeTest.aspx'){
	document.writeln("<SCRIPT src='http://zjs.ipinyou.com/ecommerce/myhousecaret_new.js' type='text/javascript'></SCRIPT>");
}else{
	//产品页cookies-----------------------------------------------------------------
	//访问过产品页写cookies

		
	if((reallocation+"").indexOf("washer")>-1||
	   (reallocation+"").indexOf("icebox")>-1||
	   (reallocation+"").indexOf("aircondition")>-1||
	   (reallocation+"").indexOf("pipelineunchoke")>-1){
		//搜索过家居清洁除菌产品类人群
		SetCookie('isQingjChuj',1);
	}else{
		SetCookie('isQingjChuj',0);
	}
	
	
	if((reallocation+"").indexOf("Aiye_")>-1){
		//点击过艾叶的人群
		SetCookie('isAiye',1);
	}else{
		SetCookie('isAiye',0);
	}
	
	
	if((reallocation+"").indexOf("/Product/")>-1){
		//搜索过产品信息的人群
		SetCookie('isProduct',1);
	}else{
		SetCookie('isProduct',0);
	}
	
	
	
	//首页cookies--------------------------------------------------------

	var firstPageAd = "";
	if((reallocation+"").indexOf("/Product/")>-1||(reallocation+"").indexOf("/product/")>-1){
		//搜索过家安产品类的人群 展示"最新活动"板块
		firstPageAd="1";
	}else if((reallocation+"").indexOf("news.aspx")>-1||(reallocation+"").indexOf("NewsDetail.aspx")>-1){
		//搜索过家安新闻类的人群 展示"最新活动"板块
		firstPageAd="1";
	}else if((reallocation+"").indexOf("campaign.aspx")>-1){
		//搜索过家安活动类人群 展示"最新活动"板块
		firstPageAd="1";
	}else if((reallocation+"").indexOf("Expert.aspx")>-1||(reallocation+"").indexOf("Research.aspx")>-1){
		//搜索过家安家居类咨询的人群 展示“家居新天地”版块
		firstPageAd="3";
	}else if((reallocation+"").indexOf("BBS")>-1){
		//登陆过家安论坛人群 展示“我爱我家会员俱乐部”
		firstPageAd="4";
	}else{
		firstPageAd="2";
	} 
	SetCookie('firstpage',firstPageAd);

	//论坛页
	var bbsAd = ""
	if((reallocation+"").indexOf("/Furniture/")>-1){
		//搜索家居生活方法类人群 位置1、显示“达人巧生活”2显示“清洁宝典”
		SetCookie('isFurniture',1);
	}else{
		SetCookie('isFurniture',0);
	}
	if((reallocation+"").indexOf("washer")>-1||
	   (reallocation+"").indexOf("icebox")>-1||
	   (reallocation+"").indexOf("aircondition")>-1||
	   (reallocation+"").indexOf("pipelineunchoke")>-1){
		//搜索过家居清洁产品类人群
		SetCookie('isQjProduct',1);
	}else{
		SetCookie('isQjProduct',0);
	}
	
}

document.writeln('<div style="visibility: hidden;" ><img style="width:0px;height:0px" src="http://www.ipinyou.com/collect.jsp?collectCodeType=4&hourVisitNum='+hourvisitnum+'&totalVisitNum='+realvisitnum+'&zone='+(0-nowdate.getTimezoneOffset()/60)+'&screenColor='+clientcolor+'&screen='+screen.width+','+screen.height+'&referUrl='+escape(realrefer)+'&url='+escape(reallocation)+'&adpid='+adpid+'&adownerid='+adownerid+'"/></div>');

function SetCookie(name,value)//两个参数，一个是cookie的名子，一个是值
{
    var Days = 30; //此 cookie 将被保存 30 天
    var exp  = new Date();    //new Date("December 31, 9998");
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
  //  document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
   document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString()+";path=/";
}

function getCookie(objName){//获取指定名称的cookie的值  
	var arrStr = document.cookie.split("; ");   
	for(var i = 0;i < arrStr.length;i ++){    
		var temp = arrStr[i].split("=");
		if(temp[0] == objName) return unescape(temp[1]);
		}
	}

