
/************************************************************************************/
//服务中心
/************************************************************************************/
function hdiv1()
{
document.getElementById("newzt11").style.display = "none";
}
function hdiv3()
{
document.getElementById("newzt13").style.display = "none";
}
function hdiv5()
{
document.getElementById("newzt15").style.display = "none";
}
function hdiv7()
{
document.getElementById("newzt17").style.display = "none";
}
function sdiv1()
{
document.getElementById("newzt11").style.display = "block";
document.getElementById("newzt12").style.display = "none";
document.getElementById("newzt13").style.display = "none";
document.getElementById("newzt14").style.display = "none";
document.getElementById("newzt15").style.display = "none";
document.getElementById("newzt16").style.display = "none";
document.getElementById("newzt17").style.display = "none";
document.getElementById("newzt18").style.display = "none";
}
function sdiv3()
{
document.getElementById("newzt11").style.display = "none";
document.getElementById("newzt12").style.display = "none";
document.getElementById("newzt13").style.display = "block";
document.getElementById("newzt14").style.display = "none";
document.getElementById("newzt15").style.display = "none";
document.getElementById("newzt16").style.display = "none";
document.getElementById("newzt17").style.display = "none";
document.getElementById("newzt18").style.display = "none";
}

function sdiv5()
{
document.getElementById("newzt11").style.display = "none";
document.getElementById("newzt12").style.display = "none";
document.getElementById("newzt13").style.display = "none";
document.getElementById("newzt14").style.display = "none";
document.getElementById("newzt15").style.display = "block";
document.getElementById("newzt16").style.display = "none";
document.getElementById("newzt17").style.display = "none";
document.getElementById("newzt18").style.display = "none";
}

function sdiv7()
{
document.getElementById("newzt11").style.display = "none";
document.getElementById("newzt12").style.display = "none";
document.getElementById("newzt13").style.display = "none";
document.getElementById("newzt14").style.display = "none";
document.getElementById("newzt15").style.display = "none";
document.getElementById("newzt16").style.display = "none";
document.getElementById("newzt17").style.display = "block";
document.getElementById("newzt18").style.display = "none";
}

function hdiv2()
{
document.getElementById("newzt12").style.display = "none";
}
function hdiv4()
{
document.getElementById("newzt14").style.display = "none";
}
function hdiv6()
{
document.getElementById("newzt16").style.display = "none";
}
function hdiv8()
{
document.getElementById("newzt18").style.display = "none";
}
function sdiv2()
{
document.getElementById("newzt11").style.display = "none";
document.getElementById("newzt12").style.display = "block";
document.getElementById("newzt13").style.display = "none";
document.getElementById("newzt14").style.display = "none";
document.getElementById("newzt15").style.display = "none";
document.getElementById("newzt16").style.display = "none";
document.getElementById("newzt17").style.display = "none";
document.getElementById("newzt18").style.display = "none";
}
function sdiv4()
{
document.getElementById("newzt11").style.display = "none";
document.getElementById("newzt12").style.display = "none";
document.getElementById("newzt13").style.display = "none";
document.getElementById("newzt14").style.display = "block";
document.getElementById("newzt15").style.display = "none";
document.getElementById("newzt16").style.display = "none";
document.getElementById("newzt17").style.display = "none";
document.getElementById("newzt18").style.display = "none";
}

function sdiv6()
{
document.getElementById("newzt11").style.display = "none";
document.getElementById("newzt12").style.display = "none";
document.getElementById("newzt13").style.display = "none";
document.getElementById("newzt14").style.display = "none";
document.getElementById("newzt15").style.display = "none";
document.getElementById("newzt16").style.display = "block";
document.getElementById("newzt17").style.display = "none";
document.getElementById("newzt18").style.display = "none";
}

function sdiv8()
{
document.getElementById("newzt11").style.display = "none";
document.getElementById("newzt12").style.display = "none";
document.getElementById("newzt13").style.display = "none";
document.getElementById("newzt14").style.display = "none";
document.getElementById("newzt15").style.display = "none";
document.getElementById("newzt16").style.display = "none";
document.getElementById("newzt17").style.display = "none";
document.getElementById("newzt18").style.display = "block";
}
/************************************************************************************/
//页头方法
/************************************************************************************/
function checkPrdouctAttributeValue(popup)
{

}

String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g, "")}


//清空一些隐藏框的数据
function JS_ClearHidden(currentID)
{
	var ids = new Array();
	ids.push ("Hid_GroupID");
	ids.push("Hid_ToCart");
	ids.push("Hid_RemoveCart");
	ids.push("Hid_ToWishList");
	ids.push("Hid_RemoveWishList");
	ids.push("Hid_IsUpdateQtys");
	ids.push("Hid_IsLogout");

	
	
	for(var i=0;i<ids.length;i++)
	{
		if (ids[i] != currentID)
		{
			document.getElementById(ids[i]).value = "";
		}
	}
	
	//document.getElementById("__VIEWSTATE").name = "__VIEWSTATE_REMOVE";
	//document.getElementById("__VIEWSTATE").id = "__VIEWSTATE_REMOVE";
	
	return true;
}

//启用分组显示
function JS_CartGroup(GroupID,targetPage)
{   if(targetPage.indexOf("?")==-1)
    window.location=document.all["Hid_URL"].value+ targetPage+"?ProductGroupID="+GroupID;
    else
    window.location= document.all["Hid_URL"].value+ targetPage+"&ProductGroupID="+GroupID;    
    
	//document.getElementById("Hid_GroupID").value = GroupID;
	
	//JS_ClearHidden("Hid_GroupID");
	//document.forms(0).submit();
}
//为购物车中的商品设置属性
  function Set_GS_ShoppingCartAttribute(HiddenID,ControlName)
  {
    var popup = document.getElementById(ControlName);
    if (popup.options[popup.selectedIndex].value != "")
     {
		var GetData=popup.options[popup.selectedIndex].value ;
		alert(GetData);
		var Hid1=document.getElementById (HiddenID);
		Hid1.value=GetData;
	}
  }
  


//添加商品到购物车中
function JS_AddToCart(productID,qty)
{   
   
    if (document.getElementById ("HidCount"+productID)!=undefined && document.getElementById ("HidCount"+productID).value!="0")
    {   var sAlert="";
		var has = 0;
		
		if( document.getElementById("Qty"+	productID + "L")!=undefined && document.getElementById("Qty"+	productID + "R")!=undefined)
		{
			if( document.getElementById("Qty"+	productID + "L").value =="" && document.getElementById("Qty"+	productID + "R").value=="")
			{
			alert("请确定你输入了商品的数量!");
			return false;
			}
			 if(document.getElementById("Qty"+	productID + "L").value=="")
			 
				document.getElementById("Qty"+	productID + "L").value=0;
				
			 if(document.getElementById("Qty"+	productID + "R").value=="")
				document.getElementById("Qty"+	productID + "R").value=0;
				
			var l=	document.getElementById("Qty"+	productID + "L").value;
			var r=	document.getElementById("Qty"+	productID + "R").value;
			document.getElementById("Hid_ToCartQty").value =parseInt(l)+parseInt(r);
			if(	document.getElementById("Hid_ToCartQty").value==0)
			{
			  alert("请确定你输入了商品的数量!");
			  return false;
			}
			var SubmjectMethod="";
			if(document.getElementById("Qty"+	productID + "L").value!="0")
			{
				for(var i=0;i<=document.getElementById ("HidCount"+productID).value;i++)
				{ 
					var hid="DDL_"+productID+"_" + i+"_L" ; //获是每一个下拉列表
					var popup = document.getElementById(hid);
					if (popup!=undefined && popup.options[popup.selectedIndex].value.substring(0,2) == "-1")
					{     
						has=1; 
					
						sAlert += popup.options[0].value.substring(2,popup.options[0].value.length)+",";
					}
				
				}
			}

			if(document.getElementById("Qty"+	productID + "R").value!="0")
			{
				for(var i=0;i<=document.getElementById ("HidCount"+productID).value;i++)
				{ 
					var hid="DDL_"+productID+"_" + i+"_R" ; //获是每一个下拉列表
					var popup = document.getElementById(hid);
					if (popup!=undefined && popup.options[popup.selectedIndex].value.substring(0,2) == "-1")
					{     
						has=1; 
					
					  sAlert += popup.options[0].value.substring(2,popup.options[0].value.length)+",";
					 }
				}
			}

		}
		else  //没有QTY属性时
		{
			for(var i=1;i<=document.getElementById ("HidCount"+productID).value;i++)
			{ 
				var hid="DDL_"+productID+"_" + i ; //获是每一个下拉列表
				var popup = document.getElementById(hid);
				if (popup.options[popup.selectedIndex].value.substring(0,2) == "-1")
				{     
					has=1; 
					sAlert += popup.options[0].value.substring(2,popup.options[popup.selectedIndex].value.length)+",";
				}
				
			}

        
		}
		
		if(has==1)
			{
				alert("请选择 " + sAlert.substring(0,sAlert.length-1) + "!" );
				return false;
			}
    }
    
    document.getElementById("Hid_ToCart").value = productID;
    
     
    if(document.getElementById("Hid_ToCartQty").value=="")
    {
	  if (qty != undefined && qty != "")
		document.getElementById("Hid_ToCartQty").value = qty;
	  if(qty==undefined)
		document.getElementById("Hid_ToCartQty").value = 1;
   }
	JS_ClearHidden("Hid_ToCart");
	if(document.getElementById ("goShoppingCart")!=undefined)
	{
		
		document.getElementById ("goShoppingCart").value="1";
	}
	
			document.getElementById("__VIEWSTATE").value = "";
	document.forms(0).action="ViewCart.aspx";
	document.forms(0).submit();

}

//从购物车中删去商品
function JS_RemoveCart(productID)
{   if(window.confirm("你确定要从购物车里清除此商品吗?"))
	{
		document.getElementById("Hid_RemoveCart").value = productID;
		JS_ClearHidden("Hid_RemoveCart");
		
		document.forms(0).submit();
	}
}

//修改购物车
function JS_UpdateCart(productID,CartID)
{

 if (document.getElementById ("HidCount"+productID)!=undefined && document.getElementById ("HidCount"+productID).value!="0")
    {   var sAlert="";
		var has = 0;
		if( document.getElementById("Qty"+	productID + "L")!=undefined && document.getElementById("Qty"+	productID + "R")!=undefined)
		{
			if( document.getElementById("Qty"+	productID + "L").value =="" && document.getElementById("Qty"+	productID + "R").value=="")
			{
			alert("请输入你要购买商品的数量!");
			return false;
			}
			 if(document.getElementById("Qty"+	productID + "L").value=="")
			 
				document.getElementById("Qty"+	productID + "L").value=0;
				
			 if(document.getElementById("Qty"+	productID + "R").value=="")
				document.getElementById("Qty"+	productID + "R").value=0;
				
			var l=	document.getElementById("Qty"+	productID + "L").value;
			var r=	document.getElementById("Qty"+	productID + "R").value;
			
			document.getElementById("Hid_ToCartQty").value =parseInt(l)+parseInt(r);
			if(	document.getElementById("Hid_ToCartQty").value==0)
			{
			  alert("请输入你要购买商品的数量!");
			  return false;
			}
			if(document.getElementById("Qty"+	productID + "L").value!="0")
			{
				for(var i=0;i<=document.getElementById ("HidCount"+productID).value;i++)
				{ 
					var hid="DDL_"+productID+"_" + i+"_L" ; //获是每一个下拉列表
					var popup = document.getElementById(hid);
					if (popup!=undefined && popup.options[popup.selectedIndex].value.substring(0,2) == "-1")
					{     
						has=1; 
					
						sAlert += popup.options[0].value.substring(2,popup.options[0].value.length)+",";
					}
				}
			}

			if(document.getElementById("Qty"+	productID + "R").value!="0")
			{
				for(var i=0;i<=document.getElementById ("HidCount"+productID).value;i++)
				{ 
					var hid="DDL_"+productID+"_" + i+"_R" ; //获是每一个下拉列表
					var popup = document.getElementById(hid);
					if (popup!=undefined && popup.options[popup.selectedIndex].value.substring(0,2) == "-1")
					{     
						has=1; 
					
					  sAlert += popup.options[0].value.substring(2,popup.options[0].value.length)+",";
					 }
				}
			}

		}
		else  //没有QTY属性时
		{
			for(var i=1;i<=document.getElementById ("HidCount"+productID).value;i++)
			{ 
				var hid="DDL_"+productID+"_" + i ; //获是每一个下拉列表
				var popup = document.getElementById(hid);
				if (popup.options[popup.selectedIndex].value.substring(0,2) == "-1")
				{     
					has=1; 
					sAlert += popup.options[0].value.substring(2,popup.options[popup.selectedIndex].value.length)+",";
				}
				
	   
			}

        
		}
		if(has==1)
			{
				alert("请选择 " + sAlert.substring(0,sAlert.length-1) + "!" );
				return false;
			}
    }
    
    document.getElementById("Hid_ToCart").value = productID;	
    
	JS_ClearHidden("Hid_ToCart");

	document.forms(0).submit();
	

}

//从收藏夹中移除商品
function JS_RemoveWishList(productID)
{
  if(window.confirm("你确定要从收藏夹里清除此商品吗?"))
	{
		document.getElementById("Hid_RemoveWishList").value = productID;
		
		JS_ClearHidden("Hid_RemoveWishList");

		document.forms(0).submit();
	}
}


//添加商品从收藏夹增加到购物车中
  function Fun_addtoCart(productID) 
  { 
	if (document.getElementById ("HidCount"+productID)!=undefined && document.getElementById ("HidCount"+productID).value!="0")
		{   
			var sAlert="";
			var has = 0;
			for(var i=1;i<=document.getElementById ("HidCount"+productID).value;i++)
			{ 
				var hid="DDL_"+productID+"_" + i ; //获是每一个下拉列表
				var popup = document.getElementById(hid);
				
				if (popup.options[popup.selectedIndex].value.substring(0,2) == "-1")
				{      
					has=1; 
					//alert("Please select the product Attribute with " + document.getElementById ("HidCount"+productID).value + " SelectBox first" );
					//alert("Please select the " + popup.options[popup.selectedIndex].value.substring(2,popup.options[popup.selectedIndex].value.length) + "!" );
					//return false;
				}
				sAlert += popup.options[0].value.substring(2,popup.options[popup.selectedIndex].value.length)+",";
			}
			 if(has==1)
			{
				alert("请选择 " + sAlert.substring(0,sAlert.length-1) + "!" );
				return false;
			}
		}
	    
	document.Form1.all["Hidden_ProdcutID"].value=productID; 
	document.all["Form1"].action=document.all["Hid_URL"].value+ "WishList.aspx?IsAddToCart=1"; 
	document.all["Form1"].submit(); 
  }
  
//添加商品到收藏夹中
function JS_ToWishList(productID)
{
	document.getElementById("Hid_ToWishList").value = productID;
	JS_ClearHidden("Hid_ToWishList");
	document.forms(0).action="WishList.aspx";
	document.forms(0).submit();
}


//跳转到一个页面.并传递商品ID过去.
function ToProductID(productID,targetPage)
{
	
	 window.location= "ProductInfo"+ productID +".aspx" ;
	
}

//跳转到Emailt to Friend..
function EmailToFriend(productID,targetPage)
{
	document.getElementById("Hid_ProductID").value = productID;
	if (targetPage != null && targetPage != undefined)
	{
		document.getElementById("Hid_TargetPage").value = document.all["Hid_URL"].value+ targetPage;
		JS_ClearHidden("Hid_ProductID");
		document.forms(0).action=targetPage;
		
	}
	document.forms(0).submit();

}
//商品类别浏览ID
function JS_BrowseCategory(categoryID,targetPage)
{  
     if(targetPage != null || targetPage != undefined)
     { 
       if(targetPage.indexOf("?")==-1)
       {
		window.location = "CategoryInfo" + categoryID + ".aspx";
		//window.location= targetPage+"?Hid_BrowseCategoryID="+categoryID;
		}
	   else
	   {
		window.location = "CategoryInfo" + categoryID + ".aspx";
		//window.location= targetPage+"&Hid_BrowseCategoryID="+categoryID;
		}
     }

}
//Qty 商品　数量相加
function JS_AddQty(id)
{
  id="Qty_" + id;
  var l=0;
  var r=0;
 // alert(document.all[id+"_L"].value + "  " + document.all[id+"_R"].value);
 
  if(document.all[id+"_L"]!=undefined && document.all[id+"_L"].value>0)
  {
	l=document.all[id+"_L"].value;
	
  }
  else
  {
	document.all[id+"_L"].value=0;
	 l=0;
  }
    if(document.all[id+"_R"]!=undefined && document.all[id+"_R"].value>0)
  {
	r=document.all[id+"_R"].value;
	
  }
  else
  {
  document.all[id+"_R"].value=0;
	 r=0;
  }
  if(parseInt(l)>=0 || parseInt(r)>=0)
  {
    document.all[id].value=parseInt(l)+parseInt(r);
  }
}
//更新商品购物的数量
function JS_UpdateQtys(subTotal)
{
	if (subTotal <= 0)
	{
		alert("您的购物车为空.");
		return false;
	}
	else
	{
		document.getElementById("Hid_IsUpdateQtys").value = "1";
		JS_ClearHidden("Hid_IsUpdateQtys");
		document.forms(0).submit();
	}
}

//注销用户登录
function JS_CustomerLogout()
{
	document.getElementById("Hid_IsLogout").value = "1";
	JS_ClearHidden("Hid_IsLogout");
	document.forms(0).submit();
}

//去登录页面
//targetPage:登录成功后跳转的页面
function JS_GoLogin(targetPage,dirPage)
{
	//如果为空.默认为首页(Index.aspx)
	if (targetPage == null || targetPage == undefined)
		targetPage = "index.aspx";
	if (dirPage != true)
	{
		document.getElementById("Hid_TargetPage").value = document.all["Hid_URL"].value+ targetPage;
		document.getElementById("__VIEWSTATE").value = "";
		document.forms(0).action = document.all["Hid_URL"].value+"Login.aspx";
		document.forms(0).submit();
	}
	else
	{
		location.href = document.all["Hid_URL"].value+ targetPage;
	}
	return true;
}

//查询验证
function JS_GoSearch()
{
	if(document.getElementById("txbSearch").value.trim().length==0)
	{
		alert("请输入搜索条件！");
		document.getElementById("txbSearch").focus();
		document.getElementById("txbSearch").select();
		return false;
	}
	else
	{
		location.href=document.all["Hid_URL"].value+ "SearchResult.aspx?SearchCondition=" + document.getElementById("txbSearch").value.trim();
		return true;
	}
}

//去下订单
function JS_GoCheckOut(isLogin,subTotal)
{   
	JS_ClearHidden();
	if (subTotal <= 0)
	{
		alert("您的购物车为空.");
		return false;
	}
	else
	{
		if (isLogin)
		{
			location.href=document.all["Hid_URL"].value+"Order.aspx";
		}
		else
		{
			return JS_GoLogin("Order.aspx");
		}
	
		return false;
	}
	
}

//验证数量输入 函数1
function JS_QtyKeyPressValidate(e)
{
	var c=(navigator.appName=="Netscape")?e.which:e.keyCode;
	
	if(c>31&&(c<48||c>57))
	{
		if(!(c==45||c==46))
		{
			status="警告:这里只允许输入数字.";
			return false;
		}
	}
	return true;
}


function JS_Qty_Text(txbID)
{
  if( txbID.value!="")
  {
	if ( !_IntE(txbID.value) )
		{
			txbID.value = "";
			alert("警告:这里只允许输入数字.");
			return false;
		}
	 if(parseInt( txbID.value)>10000)
	{  
	   
	   status="警告:商品的数量不能超过10000!";
		alert(status);
		txbID.value = "";
	   return false;
	}
		 if(parseInt( txbID.value)<0)
	{  
	   status="警告:商品数量不能低于0!";
		alert(status);
		txbID.value = "";
		 return false;
	}
}
}
//验证数量输入 函数2
function JS_QtyOnBlurValidate(txbID)
{
	if (parseInt( document.getElementById(txbID).value ) <= 0)
	{
		status="警告:购买数量不能小于 1.";
		alert(status);
		document.getElementById(txbID).value = "";
		return false;
	}
	else if ( !_IntE(document.getElementById(txbID).value) )
	{
		document.getElementById(txbID).value = "1";
		return false;
	}
	else if(parseInt( document.getElementById(txbID).value )>10000)
	{  
	   
	   status="警告:商品的数量不能超过10000!";
		alert(status);
		document.getElementById(txbID).value = "1";
	   return false;
	}
}

//按Tab键跳转到下一个焦点
function TabToNextFocus(nextCtlId)
{
	if (event.keyCode == 9)
	{
		document.getElementById(nextCtlId).focus();
	}
}
//按回车键执行下一个控件的事件
function EnterToNextEvent(nextctlId)
{
	if (event.keyCode == 13)
	{
		document.getElementById(nextctlId).click();
	}
}

function _IntE(v){return(v.search(/^[0-9]+$/)!=-1)||(v.search(/^-[0-9]+$/)!=-1)?1:0}


/************************************************************************************/
//首页模版用到
/************************************************************************************/
function ChangeCustomerCategory(index)
			{
				var page =document.all["ddl_CustomerCategory"].options[index].text;
				if(page!='select')
				{
					sUrl="";
					//document.all["div_"+page].style.display ="";
					document.all["selectCategory"].value = page;
					document.all["selectCategoryID"].value = document.all["ddl_CustomerCategory"].options[index].value;
				}
			}
function AddCategory()
{
	//document.all["div_"+page].style.display ="";
	var page = document.all["selectCategory"].value;
	if(page!="0")
	{
		if(document.all["select_Save"].value.indexOf(document.all["selectCategoryID"].value)== -1)
		{
			document.all["div_"+page].style.display ="";
			document.all["select_Save"].value = document.all["select_Save"].value + document.all["selectCategoryID"].value+",";
		}
	}
	else
	{
		alert("请首先选择一种模式.");
	}
}
function DeleteCategoryID(name,id)
{
	document.all["div_"+name].style.display="none";
	if (document.all["select_Save"].value.indexOf(id)!= -1)
	{ 
		document.all["select_Save"].value.substring(0,document.all["select_Save"].value.length-1);   
		var start = document.all["select_Save"].value.indexOf(id);
		if(start!=0)
		{
			document.all["select_Save"].value = document.all["select_Save"].value.substring(0,start)+
			document.all["select_Save"].value.substring(start+id.length+1);
		}
		else
		{
			document.all["select_Save"].value = document.all["select_Save"].value.substring(start+id.length+1);
		}
	}
	document.forms(0).submit();
}
function SaveCategory()
{
	document.forms(0).submit();
}




/************************************************************************************/
//发送Emial给好友
/************************************************************************************/
function clearInfo()
{
	document.all["TextFriendEmail"].value = "";
	document.all["TextFriendName"].value = "";
	document.all["TextEmailTitle"].value = "";
}


function _MailE(v){var s,r=/(\w+@\w+\.\w+)(\.{0,1}\w*)(\.{0,1}\w*)/i;	r.exec(v);if(RegExp.$3!=""&&RegExp.$3!="."&&RegExp.$2!=".")s=RegExp.$1+RegExp.$2+RegExp.$3;else if(RegExp.$2!=""&&RegExp.$2!=".")s=RegExp.$1+RegExp.$2;else s=RegExp.$1;if(s!=v)return 0;return 1}


function MailFormatValidate(emailAddress,id)
{
	
	if (_MailE(emailAddress) == 0 && document.getElementById(id).value!="")
	{
		alert("请输入一个有效的电子邮件地址!");
		document.getElementById(id).select();
		return false;
	}
	return true;
	
}
function checkdata()
{
  	if (document.all ["TextFriendEmail"].value=="") 
	{ 
		alert("电子邮件地址不能为空.");

		document.all["TextFriendEmail"].focus();
		document.all ["TextFriendEmail"].select();
		return false;
	}
	else
	{
		if(_MailE(document.all ["TextFriendEmail"].value) == 0)
		{
		alert("请输入一个有效的电子邮件地址!");
		document.all["TextFriendEmail"].focus();
		document.all ["TextFriendEmail"].select();
		return false;
		}

	}
	if (document.all ["TextFriendName"].value=="") 
	{ 
		alert("好友姓名不能为空.");

		document.all["TextFriendName"].focus();
		document.all ["TextFriendName"].select();
		return false;
	}
	if (document.all ["TextEmailTitle"].value=="") 
	{ 
		alert("邮件标题不能为空.");

		document.all["TextEmailTitle"].focus();
		document.all ["TextEmailTitle"].select();
		return false;
	}
	else
	{
		document.all ["hid_btSend"].value="1";
		document.forms(0).submit();
		return true;
	}
}
function CheckValid()
{
	var ddl=document.all["Category"];
	document.all["SearchHid"].value="Search";
	
	if( document.all["txtProductName"].value == "")
	{
		if((document.all["txtPrice01"]!=undefined  &&  document.all["txtPrice01"].value=="") && (document.all["txtPrice02"]!=undefined &&  document.all["txtPrice02"].value==""))
		{	
			
			document.all["txtProductName"].focus();
			alert("请输入商品名称信息!");
			return false;
		}
	}
	
	
	if(document.all["txtProductName"].value != "")
	{
	 
	var b =document.all["txtProductName"].value.replace("'","").replace("&","").replace("^","").replace("$","").replace("#","");
	document.all["txtProductName"].value=b;
	}

	return true;
}
function ChangePage(pageIndex)
{
var a=	CheckValid();
if(!a)
return false;
 document.all["SearchHid"].value="Search";
 document.all["hidPageIndex"].value=pageIndex;
 
  document.forms[0].action="SearchResult.aspx";
  
 document.forms[0].submit();
 
}
 function ChangeSelect()
{
 document.all["SearchHid"].value="Category";

 document.forms[0].submit();
 
}

//查询分页操作
function JS_SearchBrowseCategory(PageID,ControlID)
{
	document.getElementById("Hid_CurrentPageID").value = PageID;
	if(document.getElementById("Butcategorysearch")!=undefined)
		document.getElementById("Butcategorysearch").click();
	else
		document.forms[0].submit();

}

//排序操作
function CategoryBrowseOrder(Name,OrderBy)
{
	document.getElementById("HidOrderEventName").value=Name;
	 
	 if(OrderBy=="ASC")
	   OrderBy="DESC";
	 else
	  OrderBy="ASC";
	  
		document.getElementById("HidOrderAsc").value=OrderBy;
  
 
	if(document.getElementById("Butcategorysearch")!=undefined && document.getElementById("Butcategorysearch")!=null)
	{	
	   
		if(document.getElementById("Hid_CurrentPageID")!=undefined && document.getElementById("Hid_CurrentPageID")!=null)
		{
			document.getElementById("Hid_CurrentPageID").value = "0";
		}
		document.getElementById("Butcategorysearch").click();
	}
	else
	{
		document.forms[0].submit();
	}
}


function ClearData()
{ 
 
 document.all["Category"].selectedIndex = 0;
 document.all["txtProductName"].value="";
 if(document.all["txtPrice01"]!=undefined)
 document.all["txtPrice01"].value="";
  if(document.all["txtPrice02"]!=undefined)
 document.all["txtPrice02"].value="";
}
