﻿function dispUser()
{
   var userName= "";
   if(GetCookie2("userCName")!="")
   {
        userName=GetCookie2("userCName");
   }
   else if(GetCookie2("user")!="")
   {
    userName=GetCookie2("user");
   }
   
   if(userName!="")
   {
        document.getElementById("spanLogin").style.display="none";
        document.getElementById("Exitdiv").style.display="";
   }
   else
   {
   document.getElementById("Exitdiv").style.display="none";
   document.getElementById("spanLogin").style.display="";
   }

   if(GetCookie2("ShoppingNumber")!="")
   {
        var number=GetCookie2("ShoppingNumber").split("/");
        document.getElementById("stableNumber").innerHTML=number[0];
        if(number.length>1)
        {
            document.getElementById("favoriteID").innerHTML=number[1];
        }
   }
   if(GetCookie2("integral")!="")
   {
        document.getElementById("integral").innerText=GetCookie2("integral");
   }
}
dispUser();

/*全部类别  畅销品牌*/
function refreshBrandList(id) {
if(id==1)
$('#allClassTree').load('/ProXml/TreeXML/FristTreefile.html');
else if(id==2)
$('#AllBrandTree').load('/ProXml/TreeXML/treeBrand.html');
}

$(function(){
	var object=$("#allClassTree");
	$("#categoryLink").bind("click",function(){//mouseover
	refreshBrandList(1);$("select").hide();object.fadeIn();
	});
	$("#i-category").bind("mouseleave",function(){
		object.hide();$("select").show();
	});
})
$(function(){
	var object=$("#AllBrandTree");
	$("#allBrandLink").click(function(){//mouseover
	refreshBrandList(2);object.fadeIn();$("select").hide();
	});
	$("#i-allBrand").bind("mouseleave",function(){//mouseleave
		object.hide();//object.fadeOut();
		$("select").show();
	});
})
//document.body.onclick=function(){$("#allClassTree").fadeOut();$("#AllBrandTree").fadeOut();}
/**/
function AgeCateList(id)
{
    $('#showAgeCateGroy').load("/ProXml/TreeXML/Age/"+id+".html");
}
$(function(){
	var object=$("#showAgeCateGroy");
	$("#Age21").click(function(){AgeCateList(21);object.fadeIn();$("select").hide();object[0].className="AgeCateA";});
	$("#Age28").click(function(){AgeCateList(28);object.fadeIn();$("select").hide();object[0].className="AgeCateA";});
	$("#Age26").click(function(){AgeCateList(26);object.fadeIn();$("select").hide();object[0].className="AgeCateA";});
	$("#Age16").click(function(){AgeCateList(16);object.fadeIn();$("select").hide();object[0].className="AgeCateB";});
	$("#Age24").click(function(){AgeCateList(24);object.fadeIn();$("select").hide();object[0].className="AgeCateC";});
	$("#Age27").click(function(){AgeCateList(27);object.fadeIn();$("select").hide();object.addClass("AgeCateC");});
	$("#NavAgeAll").bind("mouseleave",function(){//mouseleave
		object.hide();//object.fadeOut();
		$("select").show();
	});
})

function settopnav()
{
    var topNavUrl=window.location.href.toLowerCase();
    if(topNavUrl.indexOf("group")>0)
        document.getElementById("navLi6").className="globabyTopNav";
    else if(topNavUrl.indexOf("topicshare")>0)
        document.getElementById("navLi5").className="globabyTopNav";
    else if(topNavUrl.indexOf("lyez")>0 || topNavUrl.indexOf("lad")>0)
        document.getElementById("navLi4").className="globabyTopNav";
    else if(topNavUrl.indexOf("prolist")>0)
        document.getElementById("navLi3").className="globabyTopNav";
    else if(topNavUrl.indexOf("member")>0 && (topNavUrl.indexOf("productshoppingguide")>0 || topNavUrl.indexOf("chanpindaogou")>0))
        document.getElementById("navLi2").className="globabyTopNav";
    else
        document.getElementById("navLi1").className="globabyTopNav";
}
settopnav();//设置头部连接箭头

//google连接分析工具
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-19098827-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
