﻿function GoSearch(){
var iType=$("SearList");  var sWord=$("KeyWord");  var gUrl;
if (sWord.value==''){alert('请填写{搜索关键字}！');sWord.focus();return false;}else{
switch(iType.value){
case "2":
gUrl="Search_0_0_0_0_0_0_2_0_0_1_";
window.location.href(gUrl+escape(proReplaceText(sWord.value))+".html");
break; 
case "1":
gUrl="Search_0_0_0_0_0_0_1_0_0_1_";
window.location.href(gUrl+escape(proReplaceText(sWord.value))+".html");
break; 
default:
gUrl="Search_0_0_0_0_0_0_0_0_0_1_";
window.location.href(gUrl+escape(proReplaceText(sWord.value))+".html");
break; 
}
}}
function GoGaoSearch(row,width, height){
//1-商品分类,2-品牌,3-推荐,4-热卖,5-最新,6-特价,7-搜索类型,8-上架时间,9-价格范围,10-当前页,11-关键字
var iType=$("SearType"); 
var sWord=$("KeyWrd");
var gUrl;
var SortId="0";
if ($("ClassId").options[$("ClassId").selectedIndex].value!="")
{
	SortId=$("ClassId").options[$("ClassId").selectedIndex].value.replace(/\s+/g,"");
}
var BrandId="0";
if ($("pinpaiid").options[$("pinpaiid").selectedIndex].value!="")
{
	BrandId=$("pinpaiid").options[$("pinpaiid").selectedIndex].value.replace(/\s+/g,"");
}
var ReMai="0";
if ($("ReMai").checked)
{
ReMai=$("ReMai").value.replace(/\s+/g,"");
}
var TeJia="0";
if ($("TeJia").checked)
{
TeJia=$("TeJia").value.replace(/\s+/g,"");
}
var TuiJian="0";
if ($("TuiJian").checked)
{
TuiJian=$("TuiJian").value.replace(/\s+/g,"");
}
var NewSp="0";
if ($("NewSp").checked)
{
NewSp=$("NewSp").value.replace(/\s+/g,"");
}
var PriceArea=$("PriceArea").options[$("PriceArea").selectedIndex].value.replace(/\s+/g,"");
var Days=$("Days").options[$("Days").selectedIndex].value.replace(/\s+/g,"");
if (sWord.value==''){alert('请填写{搜索关键字}！');sWord.focus();return false;}
else
{
switch(iType.value){
case "2":
/*gUrl="Search_"+SortId+"_"+BrandId+"_"+TuiJian+"_"+ReMai+"_"+NewSp+"_"+TeJia+"_2_"+Days+"_"+PriceArea+"_1_";
window.location.href(gUrl+escape(proReplaceText(sWord.value))+".html");*/
var Senddata= "row="+escape(row)+"&width="+escape(width)+"&height="+escape(height)+"&SortId="+escape(SortId)+"&BrandId="+escape(BrandId)+"&TuiJian="+escape(TuiJian)+"&ReMai="+escape(ReMai)+"&NewSp="+escape(NewSp)+"&TeJia="+escape(TeJia)+"&SearType=2&Days="+escape(Days)+"&PriceArea="+escape(PriceArea)+"&startnum=1&KeyWord="+escape(proReplaceText(sWord.value));
	Ajax.Post("Control/SearchShow.ashx", Senddata, RetSearch) 
break; 
case "1":
/*gUrl="Search_"+SortId+"_"+BrandId+"_"+TuiJian+"_"+ReMai+"_"+NewSp+"_"+TeJia+"_1_"+Days+"_"+PriceArea+"_1_";
window.location.href(gUrl+escape(proReplaceText(sWord.value))+".html");*/
var Senddata= "row="+escape(row)+"&width="+escape(width)+"&height="+escape(height)+"&SortId="+escape(SortId)+"&BrandId="+escape(BrandId)+"&TuiJian="+escape(TuiJian)+"&ReMai="+escape(ReMai)+"&NewSp="+escape(NewSp)+"&TeJia="+escape(TeJia)+"&SearType=1&Days="+escape(Days)+"&PriceArea="+escape(PriceArea)+"&startnum=1&KeyWord="+escape(proReplaceText(sWord.value));
	Ajax.Post("Control/SearchShow.ashx", Senddata, RetSearch) 
break; 
default:
/*gUrl="Search_"+SortId+"_"+BrandId+"_"+TuiJian+"_"+ReMai+"_"+NewSp+"_"+TeJia+"_0_"+Days+"_"+PriceArea+"_1_";
window.location.href(gUrl+escape(proReplaceText(sWord.value))+".html");*/
var Senddata= "row="+escape(row)+"&width="+escape(width)+"&height="+escape(height)+"&SortId="+escape(SortId)+"&BrandId="+escape(BrandId)+"&TuiJian="+escape(TuiJian)+"&ReMai="+escape(ReMai)+"&NewSp="+escape(NewSp)+"&TeJia="+escape(TeJia)+"&SearType=0&Days="+escape(Days)+"&PriceArea="+escape(PriceArea)+"&startnum=1&KeyWord="+escape(proReplaceText(sWord.value));
	Ajax.Post("Control/SearchShow.ashx", Senddata, RetSearch) 
break; 
}
}}
function SearchShow(row, width, height, SortId, BrandId, TuiJian, ReMai,NewSp,TeJia,SearType,Days,PriceArea, startnum,KeyWord)
{
	//1-商品分类,2-品牌,3-推荐,4-热卖,5-最新,6-特价,7-搜索类型,8-上架时间,9-价格范围,10-当前页,11-关键字
	var Senddata= "row="+escape(row)+"&width="+escape(width)+"&height="+escape(height)+"&SortId="+escape(SortId)+"&BrandId="+escape(BrandId)+"&TuiJian="+escape(TuiJian)+"&ReMai="+escape(ReMai)+"&NewSp="+escape(NewSp)+"&TeJia="+escape(TeJia)+"&SearType="+escape(SearType)+"&Days="+escape(Days)+"&PriceArea="+escape(PriceArea)+"&startnum="+escape(startnum)+"&KeyWord="+escape(proReplaceText(KeyWord));
	Ajax.Post("Control/SearchShow.ashx", Senddata, RetSearch) 
}
function RetSearch(ret)
{
	$("Sp_Product").innerHTML =""+ret+"";
	window.location.href='#Search' ;
}
function GoGaoSearch2(){
//1-商品分类,2-品牌,3-推荐,4-热卖,5-最新,6-特价,7-搜索类型,8-上架时间,9-价格范围,10-当前页,11-关键字
var sWord=$("KeyWrd");
var gUrl;
var ReMai="0";
if ($("ReMai").checked)
{
ReMai=$("ReMai").value.replace(/\s+/g,"");
}
var TeJia="0";
if ($("TeJia").checked)
{
TeJia=$("TeJia").value.replace(/\s+/g,"");
}
var TuiJian="0";
if ($("TuiJian").checked)
{
TuiJian=$("TuiJian").value.replace(/\s+/g,"");
}
var NewSp="0";
if ($("NewSp").checked)
{
NewSp=$("NewSp").value.replace(/\s+/g,"");
}
var PriceArea=$("PriceArea").options[$("PriceArea").selectedIndex].value.replace(/\s+/g,"");
var Days=$("Days").options[$("Days").selectedIndex].value.replace(/\s+/g,"");
if (sWord.value==''){alert('请填写{搜索关键字}！');sWord.focus();return false;}
else
{
gUrl="Search_0_0_"+TuiJian+"_"+ReMai+"_"+NewSp+"_"+TeJia+"_0_"+Days+"_"+PriceArea+"_1_";
window.location.href(gUrl+escape(proReplaceText(sWord.value))+".html");
}}
function proReplaceText(str){var tmpStr=str;
tmpStr=tmpStr.replace("[", ""); //[
tmpStr=tmpStr.replace("]", ""); //]
tmpStr=tmpStr.replace("}", ""); //{
tmpStr=tmpStr.replace("{", ""); //}
tmpStr=tmpStr.replace(";", ""); //;
tmpStr=tmpStr.replace("<", ""); //<
tmpStr=tmpStr.replace(">", ""); //>
tmpStr=tmpStr.replace("'", ""); //'
tmpStr=tmpStr.replace("\"", ""); //"
tmpStr=tmpStr.replace("&", ""); //&
tmpStr=tmpStr.replace(".", ""); //.
tmpStr=tmpStr.replace("=", ""); //=
tmpStr=tmpStr.replace(" ", ""); //空格
tmpStr=tmpStr.split("+")[0];//加号
tmpStr=tmpStr.split("-")[0];//减号
tmpStr=tmpStr.split("_")[0];//下线
tmpStr=tmpStr.replace(/\s+/g,"");
return tmpStr;}
function showBtnOver(obj){
	if(obj.className.indexOf("Over")==-1)
		obj.className=obj.className+"Over";
}

function showBtnOut(obj){
	if(obj.className.indexOf("Over")>-1)
		obj.className=obj.className.replace("Over","");
}
//点击人气
function SearchWordHitNum(Id)//热门关键字
{
   var Senddata= "Flag=1&Id="+Id;
	Ajax.Post("Control/HitNum.ashx", Senddata, RetGetHit);
}
function LinkHitNum(Id)//友情连接
{
   var Senddata= "Flag=2&Id="+Id;
	Ajax.Post("Control/HitNum.ashx", Senddata, RetGetHit);
}
function AdBigHitNum(Id)//大图广告
{
   var Senddata= "Flag=3&Id="+Id;
	Ajax.Post("Control/HitNum.ashx", Senddata, RetGetHit);
}
function AdIndexHitNum(Id)//首页图片广告
{
   var Senddata= "Flag=4&Id="+Id;
	Ajax.Post("Control/HitNum.ashx", Senddata, RetGetHit);
}
function AdFlashHitNum(Id)//首页FLASH图片广告
{
   var Senddata= "Flag=5&Id="+Id;
	Ajax.Post("Control/HitNum.ashx", Senddata, RetGetHit);
}
function AdSliderHitNum(Id)//首页滑动图片广告
{
   var Senddata= "Flag=6&Id="+Id;
	Ajax.Post("Control/HitNum.ashx", Senddata, RetGetHit);
}
function RetGetHit(ret)
{
	
}
function kf_OnLine_openChatWindow()
{
window.open('http://free3.53kf.com/webCompany.php?arg=angkorwu&style=1&kflist=off&kf=&zdkf_type=1&referer='+escape(window.location.href)+'&keyword='+escape(document.referrer)+'', '_blank', 'height=544,width=700,top=120,left=380,toolbar=no,scrollbars=no,menubar=no,status=no');
return false;
}