﻿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+encodeURIComponent(proReplaceText(sWord.value))+".html");
break; 
case "1":
gUrl="Search_0_0_0_0_0_0_1_0_0_1_";
window.location.href(gUrl+encodeURIComponent(proReplaceText(sWord.value))+".html");
break; 
default:
gUrl="Search_0_0_0_0_0_0_0_0_0_1_";
window.location.href(gUrl+encodeURIComponent(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 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":
var Senddata= "row="+encodeURIComponent(row)+"&width="+encodeURIComponent(width)+"&height="+encodeURIComponent(height)+"&SortId="+encodeURIComponent(SortId)+"&BrandId="+encodeURIComponent(BrandId)+"&SearType=2&Days="+encodeURIComponent(Days)+"&PriceArea="+encodeURIComponent(PriceArea)+"&startnum=1&KeyWord="+encodeURIComponent(proReplaceText(sWord.value));
	Ajax.Post("Control/SearchShow.ashx", Senddata, RetSearch) 
break; 
case "1":
var Senddata= "row="+encodeURIComponent(row)+"&width="+encodeURIComponent(width)+"&height="+encodeURIComponent(height)+"&SortId="+encodeURIComponent(SortId)+"&BrandId="+encodeURIComponent(BrandId)+"&SearType=1&Days="+encodeURIComponent(Days)+"&PriceArea="+encodeURIComponent(PriceArea)+"&startnum=1&KeyWord="+encodeURIComponent(proReplaceText(sWord.value));
	Ajax.Post("Control/SearchShow.ashx", Senddata, RetSearch) 
break; 
default:
var Senddata= "row="+encodeURIComponent(row)+"&width="+encodeURIComponent(width)+"&height="+encodeURIComponent(height)+"&SortId="+encodeURIComponent(SortId)+"&BrandId="+encodeURIComponent(BrandId)+"&SearType=0&Days="+encodeURIComponent(Days)+"&PriceArea="+encodeURIComponent(PriceArea)+"&startnum=1&KeyWord="+encodeURIComponent(proReplaceText(sWord.value));
	Ajax.Post("Control/SearchShow.ashx", Senddata, RetSearch) 
break; 
}
}}
function SearchShow(row, width, height, SortId, BrandId, SearType,Days,PriceArea, startnum,KeyWord)
{
	//1-商品分类,2-品牌,3-推荐,4-热卖,5-最新,6-特价,7-搜索类型,8-上架时间,9-价格范围,10-当前页,11-关键字
	var Senddata= "row="+encodeURIComponent(row)+"&width="+encodeURIComponent(width)+"&height="+encodeURIComponent(height)+"&SortId="+encodeURIComponent(SortId)+"&BrandId="+encodeURIComponent(BrandId)+"&SearType="+encodeURIComponent(SearType)+"&Days="+encodeURIComponent(Days)+"&PriceArea="+encodeURIComponent(PriceArea)+"&startnum="+encodeURIComponent(startnum)+"&KeyWord="+encodeURIComponent(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 Gift1="0";
if ($("Gift1").checked)
{
Gift1=$("Gift1").value.replace(/\s+/g,"");
}
var Gift2="0";
if ($("Gift2").checked)
{
Gift2=$("Gift2").value.replace(/\s+/g,"");
}
var Gift3="0";
if ($("Gift3").checked)
{
Gift3=$("Gift3").value.replace(/\s+/g,"");
}
var Gift4="0";
if ($("Gift4").checked)
{
Gift4=$("Gift4").value.replace(/\s+/g,"");
}
var Gift5="0";
if ($("Gift5").checked)
{
Gift5=$("Gift5").value.replace(/\s+/g,"");
}
var Gift6="0";
if ($("Gift6").checked)
{
Gift6=$("Gift6").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_"+Gift1+"_"+Gift2+"_"+Gift3+"_"+Gift4+"_"+Gift5+"_"+Gift6+"_0_"+Days+"_"+PriceArea+"_1_";
window.location.href(gUrl+encodeURIComponent(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.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 RushBuyHitNum(Id)//限时抢购优惠广告
{
   var Senddata= "Flag=7&Id="+Id;
	Ajax.Post("Control/HitNum.ashx", Senddata, RetGetHit);
}
function RetGetHit(ret)
{
	
}
function kf_OnLine_openChatWindow()
{
window.open('http://www.53kf.com/webCompany.php?arg=angkorwu&style=1&kflist=off&kf=&zdkf_type=1&referer='+encodeURIComponent(window.location.href)+'&keyword='+encodeURIComponent(document.referrer)+'', '_blank', 'height=544, width=700,top=120,left=380,toolbar=no,scrollbars=no,menubar=no,status=no');
return false;
}
