﻿
/************************************************************************************/
//首页广告
/************************************************************************************/
/************************************************************************************/
//页头方法
/************************************************************************************/
function SetSize(obj, width, height)
{
    myImage = new Image();
    myImage.src = obj.src;
    if (myImage.width>0 && myImage.height>0)
    {
        var rate = 1;
        if (myImage.width>width || myImage.height>height)
        {
            if (width/myImage.width<height/myImage.height)
            {
                rate = width/myImage.width;
            }
            else
            {
                rate = height/myImage.height;
            }
        }
        if (window.navigator.appName == "Microsoft Internet Explorer")
        {
         // obj.style.zoom = rate;
          obj.width = myImage.width*rate;
          obj.height = myImage.height*rate;
 
        }
        else
        {
          obj.width = myImage.width*rate;
          obj.height = myImage.height*rate;
 
        }
    }
}
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.getElementById("Hid_URL").value+ targetPage+"?ProductGroupID="+GroupID;
    else
    window.location= document.getElementById("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("Please make sure you entered the product Qty!");
			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("Please make sure you entered the product Qty.");
			  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("Please select the " + 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("Are you sure you want to remove this item from the shopping cart?"))
	{
		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("Please make sure you entered the product Qty!");
			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("Please make sure you entered the product Qty.");
			  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("Please select " + sAlert.substring(0,sAlert.length-1) + "!" );
				return false;
			}
    }
    
    document.getElementById("Hid_ToCart").value = productID;	
    
	JS_ClearHidden("Hid_ToCart");

	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("Please select the " + sAlert.substring(0,sAlert.length-1) + "!" );
				return false;
			}
		}
	    
	document.getElementById("Hidden_ProdcutID").value=productID; 
	document.forms[0].action=document.getElementById("Hid_URL").value+ "WishList.aspx?IsAddToCart=1"; 
	document.forms[0].submit(); 
  }
  
//添加商品到收藏夹中
function JS_ToWishList(productID)
{
	document.getElementById("Hid_ToWishList").value = productID;
	JS_ClearHidden("Hid_ToWishList");
	document.forms[0].submit();
}


//从收藏夹中移除商品
function JS_RemoveWishList(productID)
{
  if(window.confirm("Are you sure to remove the product from your WishList?"))
	{
		document.getElementById("Hid_RemoveWishList").value = productID;
		
		JS_ClearHidden("Hid_RemoveWishList");

		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.getElementById("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.getElementById(id+"_L").value + "  " + document.getElementById(id+"_R").value);
 
  if(document.getElementById(id+"_L")!=undefined && document.getElementById(id+"_L").value>0)
  {
	l=document.getElementById(id+"_L").value;
	
  }
  else
  {
	document.getElementById(id+"_L").value=0;
	 l=0;
  }
    if(document.getElementById(id+"_R")!=undefined && document.getElementById(id+"_R").value>0)
  {
	r=document.getElementById(id+"_R").value;
	
  }
  else
  {
  document.getElementById(id+"_R").value=0;
	 r=0;
  }
  if(parseInt(l)>=0 || parseInt(r)>=0)
  {
    document.getElementById(id).value=parseInt(l)+parseInt(r);
  }
}
//更新商品购物的数量
function JS_UpdateQtys(subTotal)
{
	if (subTotal <= 0)
	{
		alert("You cart is empty.");
		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.getElementById("Hid_URL").value+ targetPage;
		
		if(document.getElementById("__VIEWSTATE")!=undefined)document.getElementById("__VIEWSTATE").value = "";
		if(targetPage.toLowerCase().indexOf("order.aspx")==-1)
		
		    document.forms[0].action = document.getElementById("Hid_URL").value+"Login.aspx";
		else
		    document.forms[0].action = document.getElementById("Hid_URL").value+"Login.aspx?IsGoPayment=1";
		document.forms[0].submit();
	}
	else
	{
		if(document.getElementById("Hid_URL"))
			location.href = document.getElementById("Hid_URL").value+ targetPage;
		else
			location.href =targetPage;
	}
	return true;
}

//查询验证
function JS_GoSearch()
{
	if(document.getElementById("txbSearch").value.trim().length==0)
	{
		alert("Please enter a keyword.");
		document.getElementById("txbSearch").focus();
		document.getElementById("txbSearch").select();
		return void(0);
	}
	else
	{
		location.href=document.getElementById("Hid_URL").value+ "SearchResult.aspx?SearchCondition=" + document.getElementById("txbSearch").value.trim();
		return true;
	}
}

//去下订单
function JS_GoCheckOut(isLogin,subTotal)
{   
	JS_ClearHidden();
	if (subTotal <= 0)
	{
		alert("You cart is empty.");
		return false;
	}
	else
	{
		if (isLogin)
		{
			location.href=document.getElementById("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="Information:Only type the number here.";
			return false;
		}
	}
	return true;
}


function JS_Qty_Text(txbID)
{
  if( txbID.value!="")
  {
	if ( !_IntE(txbID.value) )
		{
			txbID.value = "1";
			alert("Information:Only type the number here.");
			return false;
		}
	 if(parseInt( txbID.value)>10000)
	{  
	   
	     status="Information:The Product Quantity can't be more than the thousand!";
		alert(status);
		txbID.value = "1";
	   return false;
	}
		 if(parseInt( txbID.value)<0)
	{  
	  alert("Information:Information:the qty cannot be less than 0.");
	
		txbID.value = "1";
		 return false;
	}
}
}
//验证数量输入 函数2
function JS_QtyOnBlurValidate(txbID)
{
	if (parseInt( document.getElementById(txbID).value ) <= 0)
	{
		status="Information:the qty cannot be less than 1.";
		alert(status);
		document.getElementById(txbID).value = "1";
		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="Information:The Product Quantity can't be more than the thousand!";
		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.getElementById("ddl_CustomerCategory").options[index].text;
				if(page!='select')
				{
					sUrl="";
					//document.getElementById("div_"+page).style.display ="";
					document.getElementById("selectCategory").value = page;
					document.getElementById("selectCategoryID").value = document.getElementById("ddl_CustomerCategory").options[index].value;
				}
			}
function AddCategory()
{
	//document.getElementById("div_"+page).style.display ="";
	var page = document.getElementById("selectCategory").value;
	if(page!="0")
	{
		if(document.getElementById("select_Save").value.indexOf(document.getElementById("selectCategoryID").value)== -1)
		{
			document.getElementById("div_"+page).style.display ="";
			document.getElementById("select_Save").value = document.getElementById("select_Save").value + document.getElementById("selectCategoryID").value+",";
		}
	}
	else
	{
		alert("请首先选择一种模式.");
	}
}
function DeleteCategoryID(name,id)
{
	document.getElementById("div_"+name).style.display="none";
	if (document.getElementById("select_Save").value.indexOf(id)!= -1)
	{ 
		document.getElementById("select_Save").value.substring(0,document.getElementById("select_Save").value.length-1);   
		var start = document.getElementById("select_Save").value.indexOf(id);
		if(start!=0)
		{
			document.getElementById("select_Save").value = document.getElementById("select_Save").value.substring(0,start)+
			document.getElementById("select_Save").value.substring(start+id.length+1);
		}
		else
		{
			document.getElementById("select_Save").value = document.getElementById("select_Save").value.substring(start+id.length+1);
		}
	}
	document.forms[0].submit();
}
function SaveCategory()
{
	document.forms[0].submit();
}




/************************************************************************************/
//发送Emial给好友
/************************************************************************************/
function clearInfo()
{
	
	if(document.getElementById("TextFriendEmail")!=undefined)
	document.getElementById("TextFriendEmail").value = "";
	if(document.getElementById("TextFriendName")!=undefined)
	document.getElementById("TextFriendName").value = "";
	if(document.getElementById("TextEmailTitle")!=undefined)
	document.getElementById("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("Please enter a valid email address!");
		document.getElementById(id).select();
		return false;
	}
	return true;
	
}
function checkdata()
{
  	if (document.getElementById("TextFriendEmail").value=="") 
	{ 
		alert("The email address is required.");

		document.getElementById("TextFriendEmail").focus();
		document.getElementById("TextFriendEmail").select();
		return false;
	}
	else
	{
		if(_MailE(document.getElementById("TextFriendEmail").value) == 0)
		{
		alert("The email address entered is not valid.");
		document.getElementById("TextFriendEmail").focus();
		document.getElementById("TextFriendEmail").select();
		return false;
		}

	}
	if (document.getElementById("TextFriendName")!=undefined &&  document.getElementById("TextFriendName").value=="") 
	{ 
		alert("Your friend name is  required.");

		document.getElementById("TextFriendName").focus();
		document.getElementById("TextFriendName").select();
		return false;
	}
	if (document.getElementById("TextEmailTitle").value=="") 
	{ 
		alert("Your email's title is  required.");

		document.getElementById("TextEmailTitle").focus();
		document.getElementById("TextEmailTitle").select();
		return false;
	}
	else
	{
		document.getElementById("hid_btSend").value="1";
		document.forms[0].submit();
		return true;
	}
}


function CheckValid()
{
	var ddl=document.getElementById("Category");
	document.getElementById("SearchHid").value="Search";
	
	if( document.getElementById("txtProductName").value =="" )
	{
	
	if((document.getElementById("txtPrice01")!=undefined  &&  document.getElementById("txtPrice01").value=="") && (document.getElementById("txtPrice02")!=undefined &&  document.getElementById("txtPrice02").value==""))
		{
		document.getElementById("txtProductName").focus();
			alert("Please enter product name to search.");
		return false;
	 }
	}
	if(document.getElementById("txtProductName").value != "")
	{
	 
	var b =document.getElementById("txtProductName").value.replace("'","").replace("&","").replace("^","").replace("$","").replace("#","");
	document.getElementById("txtProductName").value=b;
	}

	return true;
}



function ChangePage(pageIndex)
{
var a=	CheckValid();
if(!a)
return false;
 document.getElementById("SearchHid").value="Search";
 document.getElementById("hidPageIndex").value=pageIndex;
 
  document.forms[0].action="SearchResult.aspx";
  
 document.forms[0].submit();
 
}
 function ChangeSelect()
{
 document.getElementById("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.getElementById("Category").selectedIndex = 0;
 if(document.getElementById("Butcategorysearch")!=undefined)
 if(document.getElementById("txtProductName")!=undefined)
 document.getElementById("txtProductName").value="";
 if(document.getElementById("txtPrice01")!=undefined)
 document.getElementById("txtPrice01").value="";
 if(document.getElementById("txtPrice02")!=undefined)
 document.getElementById("txtPrice02").value="";
}

function DoCurrencySubmit(obj)
{ 
    if(document.getElementById("Hid_Multicurrency")!=undefined)
        document.getElementById("Hid_Multicurrency").value = obj.value;
   
    setCookie( "Multicurrency",obj.value);
    document.Form1.submit();
}

function setCookie(CookieName,value) { 

    var　expireDate = new Date() 
    expireDate.setMonth(expireDate.getMonth()+6) 
    document.cookie = CookieName+"="+value+";expires=" + expireDate.toGMTString() 
}
