function pass_id(value)//传值
	{
		
		document.server.passid.value = value;
		
		document.server.submit();
	}	

		function LTrim(str){ 
		   var i;
		   for(i=0;i<str.length;i++){
		     if(str.charAt(i)!=" ") break; 
		   }
		   str = str.substring(i,str.length);
		   return str;
		 }
		 
		 //去除左边空格
	function RTrim(str){
		   var i;
		   for(i=str.length-1;i>=0;i--){
		     if(str.charAt(i)!=" ") break;
		   }
		   str = str.substring(0,i+1);
		   return str;
		 }
		 
		 //去除两边空格
	function Trim(str){
		   return LTrim(RTrim(str));
		 }
			
	

	function check(ch)//检测字符串合法性
	{
	 	var patrn=/^[0-9]{1,7}$/;
		if(!patrn.test(ch.quantity.value))
		{
			alert("Please check your quantity!");
			ch.quantity.select();
			return false;
		}
		if(s==1){
			alert ('Please login!') ;
			top.document.customer_login.email.focus();
			return false;
		}

		
		if(Trim(ch.ware_user.value) =="" )
	 	{
	
	 		alert("Please input your chracter name!");
	 		ch.ware_user.focus();
	 		return false;
	 	}
	 	
	 	
	 	
	 	if(Trim(ch.quantity.value) == "")
	 	{
	 		alert("Please input the  quantity! ");
	 		ch.quantity.focus();
	 		return false;
	 		
	 	}
	 	
		return true;
		
		
		
		
	}	
	
	function del()
		{
			var del;
			del = confirm("Sure to remove?");

			return del;
		}

	function affirm()
	{
		var aff;
		aff = confirm("submit your order?");
		return aff;
	}
	
	function cart_affirm()
	{
		if(s==1){
			alert ('Please login!') ;
			document.customer_login.email.focus();
			return false;
		}
		if(c==1)
		{
			alert('Your shopping  cart item is empty!');
			
			return false;
		}
		return true;
	}	
	
	function order_affirm()
		{
		if(s==1){
			alert ('Please login!') ;
			document.customer_login.email.focus();
			return false;
		}
		if(o==1)
		{
			alert('Empty order information!');
			return false;
		}
		
		return true;
	}
	
	function order_affirm2()
		{
		if(s==1){
			alert ('Please login!') ;
			document.customer_login.email.focus();
			return false;
		}

		if(n==1)
		{
			alert('Empty order information!');
			return false;
		}
		return true;
	}
	
	function pass_type_name_id(value)//传值
	{
		
		document.type_name.passid.value = value;
		
		document.type_name.submit();
	}
	function tishi()
	{
		paypal.submit();
		//document.open("ddddd");
		 var a=confirm("Please click \"Return To Merchant\" button when finish paying!!!");
	/*	 if(a==1)
		 {return false;}*/
	}	
	
	function SetLoginWindow()
{
    document.getElementById("cover").style.visibility="hidden";
}
function ReSizeLoginWindow()
{
    if(document.getElementById("cover").style.visibility=="hidden")
    {
        return false;
    }
    else
    {
	document.getElementById("cover").style.visibility="visible";
	var sWidth=document.body.offsetWidth;
	var sHeight=document.body.offsetHeight;
            var bgObj = document.getElementById("cover");
			bgObj.style.position="absolute";
			bgObj.style.top="0";
			bgObj.style.background="#ccc";
			bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=55,finishOpacity=85)";
			bgObj.style.opacity="0.8";
			bgObj.style.left="0";
		//	bgObj.style.width="1025px";
		//	bgObj.style.height="1776px";
			bgObj.style.width=sWidth+"px";
			bgObj.style.height=sHeight+"px";
			bgObj.style.zIndex = "10000";
    
    var msgw,msgh,bordercolor;
			msgw=400;//提示窗口的宽度
			msgh=150;//提示窗口的高度
			titleheight=25 //提示窗口标题高度
			bordercolor="#336699";//提示窗口的边框颜色
			titlecolor="#ffffff";//提示窗口的标题颜色
            msgObj = document.getElementById("LoginWindow");
           	DivObj = document.getElementById("bDiv1");
           	conObj = document.getElementById("con");
          	DivObj.style.color = titlecolor;
			DivObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
			DivObj.setAttribute("align","left");
			conObj.style.color = titlecolor;
			conObj.style.font = "18px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
            msgObj.setAttribute("align","center");
			msgObj.style.background="black";
			msgObj.style.border="1px solid " + bordercolor;
	    	msgObj.style.position = "absolute";
            msgObj.style.left = "50%";
            msgObj.style.top = "20%";
            msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
            msgObj.style.marginLeft = "-225px" ;
            msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px";
            msgObj.style.width = msgw + "px";
            msgObj.style.height =msgh + "px";
            msgObj.style.textAlign = "center";
            msgObj.style.lineHeight ="25px";
            msgObj.style.zIndex = "10001";
	}
}
function ShowLoginWindow()
{
	document.getElementById("cover").style.visibility="visible";
	var sWidth=document.body.offsetWidth;
	var sHeight=document.body.offsetHeight;
            var bgObj = document.getElementById("cover");
			bgObj.style.position="absolute";
			bgObj.style.top="0";
			bgObj.style.background="#ccc";
			bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=55,finishOpacity=85)";
			bgObj.style.opacity="0.8";
			bgObj.style.left="0";
		//	bgObj.style.width="1025px";
		//	bgObj.style.height="1776px";
			bgObj.style.width=sWidth+"px";
			bgObj.style.height=sHeight+"px";
			bgObj.style.zIndex = "10000";
    
    var msgw,msgh,bordercolor;
			msgw=400;//提示窗口的宽度
			msgh=150;//提示窗口的高度
			titleheight=25 //提示窗口标题高度
			bordercolor="#336699";//提示窗口的边框颜色
			titlecolor="#ffffff";//提示窗口的标题颜色
            msgObj = document.getElementById("LoginWindow");
           	DivObj = document.getElementById("bDiv1");
           	conObj = document.getElementById("con");
          	DivObj.style.color = titlecolor;
			DivObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
			DivObj.setAttribute("align","left");
			conObj.style.color = titlecolor;
			conObj.style.font = "18px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
            msgObj.setAttribute("align","center");
			msgObj.style.background="black";
			msgObj.style.border="1px solid " + bordercolor;
	    	msgObj.style.position = "absolute";
            msgObj.style.left = "50%";
            msgObj.style.top = "20%";
            msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
            msgObj.style.marginLeft = "-225px" ;
            msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px";
            msgObj.style.width = msgw + "px";
            msgObj.style.height =msgh + "px";
            msgObj.style.textAlign = "center";
            msgObj.style.lineHeight ="25px";
            msgObj.style.zIndex = "10001";
                 
}
function HiddenLoginWindow()
{
	//document.getElementById("lblMessage").innerHTML="";
	document.getElementById("cover").style.visibility="hidden";
} 
	