//初始化类别
	
	function initCate(url){
		var productCate=_F(url);
		
		var productCateRoot=productCate.documentElement;
		var productCateStyle=productCateRoot.childNodes;
		
		ininStyle($Id("pstyle_0")).innerHTML=initCateTd(productCateRoot,"1");
		ininStyle($Id("pstyle_1")).innerHTML=initCateTd(productCateRoot,"2");
		ininStyle($Id("pstyle_2")).innerHTML=initCateTd(productCateRoot,"4");
		ininStyle($Id("pstyle_3")).innerHTML=initCateTd(productCateRoot,"3");
		//ininStyle($Id("pstyle_4")).innerHTML=initCateTd(productCateRoot,"5");
		ininStyle($Id("pstyle_5")).innerHTML=initCateTd(productCateRoot,"6");
		
		
		ininStyle($Id("pstyle_0_inner")).innerHTML=initInnerCateTd(productCateRoot,"1");
		ininStyle($Id("pstyle_1_inner")).innerHTML=initInnerCateTd(productCateRoot,"2");
		ininStyle($Id("pstyle_2_inner")).innerHTML=initInnerCateTd(productCateRoot,"4");
		ininStyle($Id("pstyle_3_inner")).innerHTML=initInnerCateTd(productCateRoot,"3");
		//ininStyle($Id("pstyle_4_inner")).innerHTML=initInnerCateTd(productCateRoot,"5");
		ininStyle($Id("pstyle_5_inner")).innerHTML=initInnerCateTd(productCateRoot,"6");
		
	}

//初始化类别数据
	function initCateTd(productCateRoot,val){
		
		 var productStyle=productCateRoot.selectSingleNode("//productStyle[@id='" + val + "']");
		var initTd='<a target="_blank" href="'+proCateUrl+'?bigTypeId='+productStyle.getAttribute("id")+'"><font size="2" face="幼圆" color="black">'+productStyle.getAttribute("name")+'</font></a><ul><li class="c-cat-depth-2">';
	
		var nodes=productStyle.selectNodes("productCate");
		var ininA='';
		for(var i=0;i<nodes.length;i++){
				ininA+='<a target="_blank" href="'+proCateUrl+'?bigTypeId='+productStyle.getAttribute("id")+'&smallTypeId='+nodes[i].getAttribute("id")+'">'+nodes[i].selectSingleNode("name").childNodes[0].nodeValue+'</a> ';
		}
		initTd+=ininA+'</li></ul>';
		return initTd;
	}
	//初始化内页类别数据
	function initInnerCateTd(productCateRoot,val){
		
		 var productStyle=productCateRoot.selectSingleNode("//productStyle[@id='" + val + "']");
		var initTd='<a  href="'+proCateUrl+'?bigTypeId='+productStyle.getAttribute("id")+'"><font size="2" face="幼圆" color="black">'+productStyle.getAttribute("name")+'</font></a><ul><li class="c-cat-depth-2">';
	
		var nodes=productStyle.selectNodes("productCate");
		var ininA='';
		for(var i=0;i<nodes.length;i++){
				ininA+='<a  href="'+proCateUrl+'?bigTypeId='+productStyle.getAttribute("id")+'&smallTypeId='+nodes[i].getAttribute("id")+'">'+nodes[i].selectSingleNode("name").childNodes[0].nodeValue+'</a>  ';
		}
		initTd+=ininA+'</li></ul>';
		//alert(initTd);
		return initTd;
	}
	
		//追加样式
	function ininStyle(obj){
       return obj;
	}
	
	
	//插入首页的品牌
	function insertTopBrand(url){
		var productBrand=_F(url);
		var productBrandRoot=productBrand.documentElement;
		var brands=productBrandRoot.childNodes;
		
		var brandContent=$Id("brandContent");
		if(brands!=null&&brands.length>0){
			for(var i=0;i<8;i++){
				var probrand=brands[i];
				if(probrand!=null){
					var row=brandContent.insertRow();
					var proId_td=row.insertCell(0);
					proId_td.innerHTML='<a href="'+proCateUrl+'?bigTypeId='+probrand.getAttribute("bigTypeId")+'&smallTypeId='+probrand.getAttribute("smallTypeId")+'&brandId='+probrand.getAttribute("id")+'" title="'+probrand.selectSingleNode("name").childNodes[0].nodeValue+'">'+_subStrim(probrand.selectSingleNode("name").childNodes[0].nodeValue,15)+'</a>';
				}
			}
			
		}	
		
	}
	//插入团购产品
	function insertBuyPro(url){
	
		var productBuyPro=_F(url);
		var productProRoot=productBuyPro.documentElement;
		
		var pros=productProRoot.childNodes;
		var proHt="";
		
		if(pros!=null&&pros.length>0){
			for(var i=0;i<6;i++){
				var pro=pros[i];		
				if(pro!=null){
					proHt+='<li><a href="'+proDetailUrl+pro.getAttribute("id")+'" target="_blank" title="'+pro.selectSingleNode("name").childNodes[0].nodeValue+'"><img src="/pimg/product/'+pro.getAttribute("id")+'_00.jpg"   alt="'+pro.selectSingleNode("name").childNodes[0].nodeValue+'"  />'+
	                   '<span class="span1">'+_subStrim(pro.selectSingleNode("name").childNodes[0].nodeValue,32)+'</span></a><span>售价:<small>¥'+pro.getAttribute("price")+'</small></span></li>'
				}
			}
			
		}
		$Id("buyPro").innerHTML=proHt;
	}
	

	
	//插入公告
	function insertBullien(url){
		var bullienIndex=_F(url);
		
		var bullienRoot=bullienIndex.documentElement;
		var  bulliens=bullienRoot.childNodes;
		var bullienHt="";
		if(bulliens!=null&&bulliens.length>0){
			for(var i=0;i<bulliens.length;i++){
				var bullien=bulliens[i];
				if(bullien!=null){
				
					bullienHt+=' <li><a href="" title="'+_subStrim(bullien.selectSingleNode("desc").childNodes[0].nodeValue,50)+'" target="_blank">'+_subStrim(bullien.selectSingleNode("title").childNodes[0].nodeValue,15)+'</a></li>';
				}
			}
		}
		$Id("bulliens").innerHTML=bullienHt;
	}
	
	
	