 
 
 function go(obj){
    window.location=obj;
 }

 function compare(){
   var counts=0;
   var pcateId="";
   var checkObj=document.getElementsByName("pcate");
   var leng=checkObj.length;
   for(var i=0;i<leng;i++){
      if(checkObj[i].checked){
          counts=counts+1;
		  pcateId=pcateId+";"+checkObj[i].value;
	  }
   }
   if(counts==0){
      alert("请选择您要比较的商品,数量最多为5个商品!");
      return false;
   }
   if(counts>5){
      alert("选择的比较的商品数量最多5个!");
      return false;
   }
   document.productCompare.action="productCompare.action?pcateId="+pcateId;
   document.productCompare.submit();
   return true;
 }

 function goSpecialSearch(){
    var specs=document.SpecialForSearch.specs;
	if(specs.value==''){
         alert("请输入你要查找商品的关键词!");
         return false;
	}

   document.SpecialForSearch.action="search.action";
   document.SpecialForSearch.submit();
   return true;

 }

 function goGeneralSearch(){
	 var specs=document.GeneralSearch.specs;
	if(specs.value==''){
         alert("请输入你要查找商品的关键词!");
         return false;
	}
   document.GeneralSearch.action="search.action";
   document.GeneralSearch.submit();
   return true;

 }

  function goGeneralSearchTop(){
	 var specs=document.GeneralSearchTop.specs;
	if(specs.value==''){
         alert("请输入你要查找商品的关键词!");
         return false;
	}
   document.GeneralSearchTop.action="search.action";
   document.GeneralSearchTop.submit();
   return true;

 }

 function lastpage(){
	 var s=document.searchPage.currpages.value-1;
   document.searchPage.action="search.action?cpage="+s;
   document.searchPage.submit();
   return true;

 }
  function nextpage(){
	 var s=0;
	  s=document.searchPage.nextpages.value;
   document.searchPage.action="search.action?cpage="+s;
   document.searchPage.submit();
   return true;

 }
  function goPage(s){
   document.searchPage.action="search.action?cpage="+s;
   document.searchPage.submit();
   return true;

 }
 function lastpageDown(){
	 var s=document.searchPageDown.currpages.value-1;
   document.searchPageDown.action="search.action?cpage="+s;
   document.searchPageDown.submit();
   return true;

 }
  function nextpageDown(){
	 var s=0;
	  s=document.searchPageDown.nextpages.value;
   document.searchPageDown.action="search.action?cpage="+s;
   document.searchPageDown.submit();
   return true;

 }
  function goPageDown(s){
   document.searchPageDown.action="search.action?cpage="+s;
   document.searchPageDown.submit();
   return true;

 }

  function goSellerSearch(){
	var seller=document.SellerForm.seller;
	if(seller.value==''){
         alert("请输入你要查找的卖家!");
         return false;
	}
   document.SellerForm.action="seller.action";
   document.SellerForm.submit();
   return true;

 }
  
 function goSellerSearchNextPage(){
   document.SellerSearchFormNextPage.action="seller.action";
   document.SellerSearchFormNextPage.submit();
   return true;

 }
  function goSellerSearchLastPage(){
   document.SellerSearchFormLastPage.action="seller.action";
   document.SellerSearchFormLastPage.submit();
   return true;
 }

 function goSellerSearchByPlace(){
   var place=document.SellerPlaceForm.place;
	if(place.value==''){
         alert("请输入你要查找的地区!");
         return false;
	}
   document.SellerPlaceForm.action="sellerPlace.action";
   document.SellerPlaceForm.submit();
   return true;

 }
 
 function goSellerSearchByPlacNextPage(){
   document.SellerSearchByPlacForm.action="sellerPlace.action";
   document.SellerSearchByPlacForm.submit();
   return true;

 }
 function goSellerSearchByPlacLastPage(){
   document.SellerSearchByPlacFormLastPage.action="sellerPlace.action";
   document.SellerSearchByPlacFormLastPage.submit();
   return true;
 }
 function goB2CSellerSearch(){
   var place=document.B2CSellerPKForm.place.value;
   var price0=document.B2CSellerPKForm.price0.value;
   var price1=document.B2CSellerPKForm.price1.value;
   var seller=document.B2CSellerPKForm.seller.value;
     if(place==''
	    &&price0==''
		&&price1==''
		&&seller==''){
		   alert("请输入要查询的条件!");
           return false;
	 }

   if(price0!=''){
	   if(!isDigit(price0)){
          alert("请输入整数子!");
           return false;
	   }
	}
	if(price1!=''){
	   if(!isDigit(price1)){
          alert("请输入整数子!");
           return false;
	   }
	}
   document.B2CSellerPKForm.action="b2cSeller.action";
   document.B2CSellerPKForm.submit();
   return true;

 }

 function goB2CSellerSearchNextPage(){
   document.B2CSellerPKFormNextPage.action="b2cSeller.action";
   document.B2CSellerPKFormNextPage.submit();
   return true;
 }
 function goB2CSellerSearchLastPage(){
   document.B2CSellerPKFormLastPage.action="b2cSeller.action";
   document.B2CSellerPKFormLastPage.submit();
   return true;
 }
 /**
*输入的是否为字母和数字
*/
function isAscCH(obj){
  var patrn=/^[0-9a-zA-Z]{1,50}$/; 
   if (!patrn.exec(obj)) return false; 
    return true; 
}
/**
*输入的是否为日期格式(2006-01-01 13:12:56)
*/
function isTime(str){
 var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/);
  if(r==null)return false; 
 var d = new Date(r[1], r[3]-1,r[4],r[5],r[6],r[7]);
  return (d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]&&d.getHours()==r[5]&&d.getMinutes()==r[6]&&d.getSeconds()==r[7]);
}
/**
*输入是否为数字，长度为20
*/
function isDigit(s){ 
  var patrn=/^[0-9]{1,20}$/; 
   if (!patrn.exec(s)) return false; 
    return true; 
}    
/**
 *输入是否为正浮点数字
 */
function isUpDigit(s){
   var patrn=/^\\d+$/;
   if (!patrn.exec(s)) return false; 
    return true; 
}
/**
*输入是否为汉字
*/
function isZhCNStr(s){
  var str=/^[\u4e00-\u9fa5]+$/;
  if (!str.exec(s)) return false; 
    return true; 
}




/*
 function adsadd(adscod,pid){
	 var refer=document.referrer;
	 var locate=document.URL;
     document.location="http://www.pkprice.com:8080/jsp/alertSo.jsp?adcd="+adscod+"&refer="+refer+"&locate="+locate+"&pid="+pid;
 }

 function ovadd(adscod,pid,outhref){
	var locate=document.URL;
	window.open("http://www.pkprice.com:8080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&locate="+locate+"&pid="+pid);
   // document.location="http://www.pkprice.com:8080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&locate="+locate+"&pid="+pid;
 }
*/
  function adsadd(adscod,pid){
	 var refer=escape(document.referrer);
	 var locate=document.URL;
	 //window.open("http://www.pkprice.com:8080/jsp/alertSo.jsp?adcd="+adscod+"&refer="+refer+"&locate="+locate+"&pid="+pid);
     document.location="http://www.pkprice.com:8080/jsp/alertSo.jsp?adcd="+adscod+"&refer="+refer+"&locate="+locate+"&pid="+pid;
 }

 function ovadd00(adscod,pid,outhref){
	var locate=document.URL;
	window.open("http://www.pkprice.com:8080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&locate="+locate+"&pid="+pid);
   //document.location="http://www.pkprice.com/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&locate="+locate+"&pid="+pid;
   
 }

 function ovadd(adscod,pid,outhref,place,price,csalesnum,salesnum,hasleg){
	 var locate=document.URL;
	 var datas='&place='+place+'&price='+price+'&csalesnum='+csalesnum+'&salesnum='+salesnum+'&hasleg='+hasleg+"&locate="+locate;
	//alert("http://localhost:9080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&locate="+locate+"&pid="+pid+datas)
	window.open("http://www.pkprice.com:8080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&pid="+pid+datas);
    // document.location="http://localhost:9080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&locate="+locate+"&pid="+pid+datas;
 }


  function ovSeller(adscod,pid,outhref,place,price,csalesnum,salesnum,hasleg,seller){
	 var locate=document.URL;
	// var ourlink=escape(outhref);
	 var datas='&place='+place+'&price='+price+'&csalesnum='+csalesnum+'&salesnum='+salesnum+'&hasleg='+hasleg+'&seller='+seller+"&locate="+locate;
	//alert("http://www.pkprice.com:8080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&pid="+pid+datas)
	window.open("http://www.pkprice.com:8080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&pid="+pid+datas);
     //document.location="http://www.pkprice.com:8080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&pid="+pid+datas;
 }

  function ovSellerNew(adscod,pid,outhref,place,price,csalesnum,salesnum,hasleg,seller,linkname){
	 var locate=document.URL;
	 var datas='&place='+place+'&price='+price+'&csalesnum='+csalesnum+'&salesnum='+salesnum+'&hasleg='+hasleg+'&seller='+seller+"&locate="+locate;
	//alert("http://www.pkprice.com:8080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&pid="+pid+datas)
	document.getElementById(linkname).target="_blank";
	window.open("http://www.pkprice.com:8080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&pid="+pid+datas);
    // document.location="http://localhost:8080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&locate="+locate+"&pid="+pid+datas;
 }


 function ovPromoSeller(adscod,pid,outhref,place,price,csalesnum,salesnum,hasleg,seller){
	 var locate=document.URL;
	 var seller=encodeURI(encodeURI(seller));
     // alert(seller);
	 var datas='&place='+place+'&price='+price+'&csalesnum='+csalesnum+'&salesnum='+salesnum+'&hasleg='+hasleg+'&seller='+seller+"&locate="+locate;
	//alert("http://www.pkprice.com:8080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&pid="+pid+datas)
	window.open("http://www.pkprice.com:8080/jsp/lvcai.jsp?adcd="+adscod+"&outhref="+outhref+"&pid="+pid+datas);
     //document.location="http://www.pkprice.com:8080/jsp/valert.jsp?adcd="+adscod+"&outhref="+outhref+"&pid="+pid+datas;
 }
          
 function ovNewPromoSeller(adscod,pid,outhref,place,price,csalesnum,salesnum,hasleg,seller){
	 var locate=document.URL;
	 var seller=encodeURI(encodeURI(seller));
	 var outhref=encodeURI(encodeURI(outhref));
	 var locate=encodeURI(encodeURI(locate));
	  var place=encodeURI(encodeURI(place));
	 // alert(outhref);
      var datas='&place='+place+'&price='+price+'&csalesnum='+csalesnum+'&salesnum='+salesnum+'&hasleg='+hasleg+'&seller='+seller+"&locate="+locate;
	  //alert("http://www.pkprice.com:8080/jsp/newlvcai.jsp?adcd="+adscod+"&pid="+pid+datas+"&outhref="+outhref)
	  window.open("http://www.pkprice.com:8080/jsp/newlvcai.jsp?adcd="+adscod+"&pid="+pid+datas+"&outhref="+outhref);
	  //document.location="http://www.pkprice.com:8080/jsp/newlvcai.jsp?adcd="+adscod+"&pid="+pid+datas+"&outhref="+outhref;
 }

  function ovNewPromoSeller_a(adscod,pid,outhref,place,price,csalesnum,salesnum,hasleg,seller,serviceid){
	 var locate=document.URL;
	 var seller=encodeURI(encodeURI(seller));
	 var outhref=encodeURI(encodeURI(outhref));
	 var locate=encodeURI(encodeURI(locate));
	  var place=encodeURI(encodeURI(place));
	  //alert(outhref);
     var datas='&place='+place+'&price='+price+'&csalesnum='+csalesnum+'&salesnum='+salesnum+'&hasleg='+hasleg
		       +'&seller='+seller+'&serviceid='+serviceid+"&locate="+locate;
	  //alert("http://www.pkprice.com:8080/jsp/newdacai.jsp?adcd="+adscod+"&pid="+pid+datas+"&outhref="+outhref)
	  window.open("http://www.pkprice.com:8080/jsp/newdlvcai.jsp?adcd="+adscod+"&pid="+pid+datas+"&outhref="+outhref);

 }

  function ovNewPromoSeller_b(adscod,pid,outhref,place,price,csalesnum,salesnum,hasleg,seller,tokelink){
	 var locate=document.URL;
	 var seller=encodeURI(encodeURI(seller));
	 var outhref=encodeURI(encodeURI(outhref));
	 var locate=encodeURI(encodeURI(locate));
	  var place=encodeURI(encodeURI(place));
	  //alert(outhref);
     var datas='&place='+place+'&price='+price+'&csalesnum='+csalesnum+'&salesnum='+salesnum+'&hasleg='+hasleg
		       +'&seller='+seller+'&tokelink='+tokelink+"&locate="+locate;
	  //alert("http://www.pkprice.com:8080/jsp/newdacai.jsp?adcd="+adscod+"&pid="+pid+datas+"&outhref="+outhref)
	  window.open("http://www.pkprice.com:8080/jsp/newtdlvcai.jsp?adcd="+adscod+"&pid="+pid+datas+"&outhref="+outhref);

 }

 function ovNewPromoSeller_d(adscod,pid,outhref,place,price,csalesnum,salesnum,hasleg,seller,tokelink,tbid){
	 var locate=document.URL;
	 var seller=encodeURI(encodeURI(seller));
	 var outhref=encodeURI(encodeURI(outhref));
	 var locate=encodeURI(encodeURI(locate));
	  var place=encodeURI(encodeURI(place));
	  //alert(outhref);
     var datas='&place='+place+'&price='+price+'&csalesnum='+csalesnum+'&salesnum='+salesnum+'&hasleg='+hasleg
		       +'&seller='+seller+'&tbid='+tbid+'&tokelink='+tokelink+"&locate="+locate;
	  //alert("http://www.pkprice.com:8080/jsp/newdacai.jsp?adcd="+adscod+"&pid="+pid+datas+"&outhref="+outhref)
	  window.open("http://www.pkprice.com:8080/jsp/newjincai.jsp?adcd="+adscod+"&pid="+pid+datas+"&outhref="+outhref);

 }

 function ovNewPromoSeller_e(adscod,pid,outhref,place,price,csalesnum,salesnum,hasleg,seller,tokelink){
	 var locate=document.URL;
	 var seller=encodeURI(encodeURI(seller));
	 var outhref=encodeURI(encodeURI(outhref));
	 var locate=encodeURI(encodeURI(locate));
	  var place=encodeURI(encodeURI(place));
	  //alert(outhref);
     var datas='&place='+place+'&price='+price+'&csalesnum='+csalesnum+'&salesnum='+salesnum+'&hasleg='+hasleg
		       +'&seller='+seller+'&tokelink='+tokelink+"&locate="+locate;
	  //alert("http://www.pkprice.com:8080/jsp/newdacai.jsp?adcd="+adscod+"&pid="+pid+datas+"&outhref="+outhref)
	  window.open("http://www.pkprice.com:8080/jsp/dajincai.jsp?adcd="+adscod+"&pid="+pid+datas+"&outhref="+outhref);

 }

 function ovNewPromoSeller_f(adscod,pid,outhref,place,price,csalesnum,salesnum,hasleg,seller,tokelink,tbid,outposi){
	 var locate=document.URL;
	 var seller=encodeURI(encodeURI(seller));
	 var outhref=encodeURI(encodeURI(outhref));
	 var locate=encodeURI(encodeURI(locate));
	  var place=encodeURI(encodeURI(place));
	  //alert(outhref);
     var datas='&place='+place+'&price='+price+'&csalesnum='+csalesnum+'&salesnum='+salesnum+'&outposi='+outposi+'&hasleg='+hasleg
		       +'&seller='+seller+'&tbid='+tbid+'&tokelink='+tokelink+"&locate="+locate;
	  //alert("http://www.pkprice.com:8080/jsp/newjincai.jsp?adcd="+adscod+"&pid="+pid+datas+"&outhref="+outhref)
	  window.open("http://www.pkprice.com:8080/jsp/newjincai.jsp?adcd="+adscod+"&pid="+pid+datas+"&outhref="+outhref);

 }


 function specsDisplay(){
	   document.getElementById("specs001").style.display="none";
       document.getElementById("specs0").style.display="block";
 }

 function specsNoDisplay(){
	   document.getElementById("specs0").style.display="none";
	   document.getElementById("specs001").style.display="block";
      
 }


  function paihangBrandDisplay(){
	   document.getElementById("paihangBrandList").style.display="none";
	   document.getElementById("paihangAllBrandList").style.display="block";
 }

 function paihangBrandNoDisplay(){
	   document.getElementById("paihangAllBrandList").style.display="none";
       document.getElementById("paihangBrandList").style.display="block";
	  
      
 }

function searchOtherTaobao(specs){
	var url = "http://search8.taobao.com/browse/search_auction.htm?q="+specs+"&pid=mm_14546284_0_0&cat=0&search_type=auction&commend=all&at_topsearch=1";
	//alert(url);
	window.open(url);
}

function searchOtherGoogle(specs){
	var url = "http://www.google.com.hk/custom?hl=zh-CN&safe=strict&client=pub-2620455760367270&cof=FORID%3A13%3BAH%3Aleft%3BCX%3Apkprice%2520%25E7%25AB%2599%25E5%2586%2585%25E6%2590%259C%25E7%25B4%25A2%3BL%3Ahttp%3A%2F%2Fwww.google.com%2Fintl%2Fzh-CN%2Fimages%2Flogos%2Fcustom_search_logo_sm.gif%3BLH%3A30%3BLP%3A1%3BKMBOC%3A%23336699%3B&adkw=AELymgU6ed8FP27zlINpyKWaNjXCy7H6FeFV-Z64IN04SjkbmaQHpFpOkcuvncccbpoK4R4tJcg2N0kZoySfAxn8N90UpUnKEwpCXjaz0raU9rOZz-HoYvE&boostcse=0&cx=012262405915171299962%3Aut_fopn3uti&q="+specs;
	//alert(url);
	window.open(url);
}

function searchOtherBaidu(specs){
	var url = "http://www.baidu.com/s?tn=pkprice_pg&tr=CM9BTOIcFbf&word="+specs;
	//alert(url);
	window.open(url);
}

function searchOtherSougou(specs){
	var url = "http://www.sogou.com/websearch/corp/search.jsp?pid=wanggoubanlv&searchtype=0&query="+specs;
	//alert(url);
	window.open(url);
}

function searchOtherYoudao(specs){
	//var url = "http://www.youdao.com/search?q="+specs+"&keyfrom=web.index.suggest";
	var url = "http://www.youdao.com/search?keyfrom=1.1084_107736&vendor=1.1084_107736&q="+specs+"";
	//alert(url);
	window.open(url);
}

function searchOtherSoSo(specs){
	var url = "http://www.soso.com/q?ie=utf-8&pid=smb.i&w="+specs;
	//alert(url);
	window.open(url);
}




        function hotChange(obj,menu)  
        {
         if(menu=='hota')
         {
          document.getElementById("hota").style.display="block";
		  document.getElementById("hotb").style.display="none"; 
		  document.getElementById("hotc").style.display="none"; 
         }
		 if(menu=='hotb')
         {
           document.getElementById("hotb").style.display="block";
		   document.getElementById("hota").style.display="none"; 
		   document.getElementById("hotc").style.display="none"; 
         }
		 if(menu=='hotc')
         {
           document.getElementById("hotc").style.display="block";
		   document.getElementById("hota").style.display="none"; 
		   document.getElementById("hotb").style.display="none"; 
         }
		}

		function motChange(obj,menu)  
        {
         if(menu=='mota')
         {
          document.getElementById("mota").style.display="block";
		  document.getElementById("motb").style.display="none"; 
		  document.getElementById("motc").style.display="none"; 
         }
		 if(menu=='motb')
         {
           document.getElementById("motb").style.display="block";
		   document.getElementById("mota").style.display="none"; 
		   document.getElementById("motc").style.display="none"; 
         }
		 if(menu=='motc')
         {
           document.getElementById("motc").style.display="block";
		   document.getElementById("mota").style.display="none"; 
		   document.getElementById("motb").style.display="none"; 
         }
		}

		function cotChange(obj,menu)  
        {
         if(menu=='cota')
         {
          document.getElementById("cota").style.display="block";
		  document.getElementById("cotb").style.display="none"; 
		  document.getElementById("cotc").style.display="none"; 
         }
		 if(menu=='cotb')
         {
           document.getElementById("cotb").style.display="block";
		   document.getElementById("cota").style.display="none"; 
		   document.getElementById("cotc").style.display="none"; 
         }
		 if(menu=='cotc')
         {
           document.getElementById("cotc").style.display="block";
		   document.getElementById("cota").style.display="none"; 
		   document.getElementById("cotb").style.display="none"; 
         }
		}

		function potChange(obj,menu)  
        {
         if(menu=='pota')
         {
          document.getElementById("pota").style.display="block";
		  document.getElementById("potb").style.display="none"; 
		  document.getElementById("potc").style.display="none"; 
         }
		 if(menu=='potb')
         {
           document.getElementById("potb").style.display="block";
		   document.getElementById("pota").style.display="none"; 
		   document.getElementById("potc").style.display="none"; 
         }
		 if(menu=='potc')
         {
           document.getElementById("potc").style.display="block";
		   document.getElementById("pota").style.display="none"; 
		   document.getElementById("potb").style.display="none"; 
         }
		}

		function sotChange(obj,menu)  
        {
         if(menu=='sota')
         {
          document.getElementById("sota").style.display="block";
		  document.getElementById("sotb").style.display="none"; 
		  document.getElementById("sotc").style.display="none"; 
         }
		 if(menu=='sotb')
         {
           document.getElementById("sotb").style.display="block";
		   document.getElementById("sota").style.display="none"; 
		   document.getElementById("sotc").style.display="none"; 
         }
		 if(menu=='sotc')
         {
           document.getElementById("sotc").style.display="block";
		   document.getElementById("sota").style.display="none"; 
		   document.getElementById("sotb").style.display="none"; 
         }
		}


		function fotChange(obj,menu)  
        {
         if(menu=='fota')
         {
          document.getElementById("fota").style.display="block";
		  document.getElementById("fotb").style.display="none"; 
		  document.getElementById("fotc").style.display="none"; 
         }
		 if(menu=='fotb')
         {
           document.getElementById("fotb").style.display="block";
		   document.getElementById("fota").style.display="none"; 
		   document.getElementById("fotc").style.display="none"; 
         }
		 if(menu=='fotc')
         {
           document.getElementById("fotc").style.display="block";
		   document.getElementById("fota").style.display="none"; 
		   document.getElementById("fotb").style.display="none"; 
         }
		}
		
 