(function(){
	var g=function(n){
		var A=document.cookie;
		return A&&A.match(new RegExp("(?:^|\s*)"+n+"=([^;]*)","mi"))?unescape(RegExp.$1.replace(/^["']|["']$/gm,'')):null
	},$=function(a){return document.getElementById(a)},u=g('userinfo'),c=g('cart'),o,d=document,h=d.referrer,
	p=function(s,n,d){
		return s.match(new RegExp(n.replace(/([\[\]])/g,'\\\$1')+"=([^&\\?#]*)"),'gm')?RegExp.$1:d||null
	},s=function(n,v,e){
		document.cookie = n + "=" + escape(v) + (e ? ("; expires=" + new Date(new Date().getTime() + e*1000).toGMTString()):"")
	},S="source",eC=$('cartNum'),a=p(top.location.href,'aid'),uC=function(o){
		c='';for(var p in o){if(o[p])c+=","+p+":'"+o[p]+"'"};if(c){c="{"+c.substr(1)+"}";s(S,c,86400)}			
	};
		if(eC&&c){eval('o=['+c+']');
	var nu = o.length;
	for (var i = 0; i < o.length; i++) {
		if (o[i].itm){
			var iteml = o[i].itm.length;
			nu = nu + iteml;
		} 
	}
	eC.innerHTML=nu;};
	if(u){
		/**if($('userInfo'))$('userInfo').innerHTML="<div class=\"login\">"+"<div class=\"hui\"><p>VAAKAV 哇咔内衣专家</p><p>欢迎您的光临~！</p><p>当前账户：<a href=\"/member/index.dhtml\" title='"+u+"'>"+u.split("@")[0]+"</a></p>"+"</div><div><a href=\"/member/index.dhtml\">[进入会员中心]</a><a href=\"/logout.dhtml\">[安全退出]</a> </div>"+"<div style='color:#f00'>首次注册/登录即送100积分</div>";
		//if($('login_a'))$('login_a').innerHTML = "退出" ;
		//if($('login_a'))$('login_a').href = "/logout.dhtml";
		if($('reg_a'))$('reg_a').innerHTML = "";
		if($('reg_a'))$('reg_a').href = "";**/
			if($('userInfo'))$('userInfo').innerHTML="您好，<a href=\"/member/index.dhtml\" title='"+u+"'>"+u.split("@")[0]+"</a>欢迎访问！<a href=\"/logout.dhtml\">[退出]</a><em>|</em><a href=\"/member/index.dhtml\">会员中心</a><em>|</em>";
		//if($('login_a'))$('login_a').innerHTML = "退出" ;
		//if($('login_a'))$('login_a').href = "/logout.dhtml";
		if($('reg_a'))$('reg_a').innerHTML = "";
		if($('reg_a'))$('reg_a').href = "";
	};
	if(h||a){
		if(h.match(/(?:[a-z]\:\/\/)([^\/\?]+)(.*)/gi)){h=RegExp.$1;c=RegExp.$2}
		u=g(S);u?eval('o='+u+''):o={};
		if(a)o.aid=a;
		if(h&&h!=d.domain&&!h.match(d.domain.replace(/^www/,'').replace(/\./g,'\\.')+'$')){
			o.rfh=h;o.rfp=c
		}
		uC(o)
	}
})()