
function login(){
	
	var URL=window.location.href;
	
	if(document.getElementById("Lock").style.display=='block'){
	
		var Email=document.getElementById("Email").value;
		
		var Pass=document.getElementById("Pass").value;	
		
		window.location.href="/Run/Main.Asp?ID=100&Email="+Email+"&Pass="+Pass+"&URL="+URL;
		
		CloseWindow();
		
	}else{
		
		var OBJ=document.getElementById("LoginForm")
		
		var Email=OBJ.Email.value;
		
		var Pass=OBJ.Pass.value;
		
		if(Email=='Email' || Pass=='Email'){
		
			return;
			
		}else if(Email.indexOf("@")<2 || Email.indexOf("@")>Email.length-6){
			
			alert("登陆失败，你输入的Email地址不正确，请重试!!!1");					 
				
		}else if(Email.indexOf(".")<5 || Email.indexOf(".")>Email.length-3){
		
			alert("登陆失败，你输入的Email地址不正确，请重试!!!2");					 
			
		}else{
			
			LoginForm.submit();
			
		}
		
	}		
		
}

//========================================================================================================================================================================

function Blur(Objects){
	
	if(Objects.value.length<1) Objects.value="Email";		
	
}

//========================================================================================================================================================================

function Focus(Objects){
	
	if(Objects.value=="Email") Objects.value="";
	
}

//========================================================================================================================================================================

function ExecuteReg(){
	
	var OBJ=document.getElementById("RegForm");
	
	var Email=OBJ.Email.value;
	
	var Email1=OBJ.Email1.value;
	
	var Pass=OBJ.Pass.value;
	
	var Pass1=OBJ.Pass1.value;
	
	var NickName=OBJ.NickName.value;
	
	var PSN=OBJ.PSN.value;
	
	if(Email.length<9 || Email.length>50){
		
		alert("注册失败：您输入的邮箱地址不确！！！");
		
	}else if(Email!=Email1){
		
		alert("注册失败：请认真填写重新输入一遍！！！");
		
	}else if(NickName.length<2 || NickName.length>6){
		
		alert("注册失败：您忘了填写您的姓名！！！");	
		
	}else if(Pass.length<6 || Pass.length>16){
		
		alert("注册失败：您输入的密码格式不确！！！");
		
	}else if(Pass!=Pass1){
		
		alert("注册失败：请认真填写确认密码！！！");
		
	}else if(PSN.length!=4){
		
		alert("注册失败：您忘了填写验证码！！！");
		
	}else{
		
		OBJ.submit();
		
	}
	
}

//========================================================================================================================================================================

function GetPassword(){
	
	var Email=document.getElementById("Email").value;
	
	if(Email.length<9) return;
	
	window.location.href="/Run/Main.Asp?ID=104&Email="+Email;
	
}

function SetPassword(){
	
	var NewPassword=document.getElementById("NewPassword").value;
	
	if(NewPassword.length<6) return;
	
	window.location.href='/Run/Main.Asp?ID=105&NewPassword='+NewPassword;
	
}

//========================================================================================================================================================================

function DeleteProduct(ID){
	
	if(confirm('您确实要把该商品移出购物车吗？')) location.href="/Run/?ID=201&PID="+ID;

}

function Continue(){
	
	window.location.href=Cookie("URL");
	
}

function ClearShopping(){
	
	window.location.href="/Run/Main.Asp?ID=203";
	
}

//========================================================================================================================================================================

function keyDown(e){
	
	var Code;
	
	if(document.all){
		
		Code=event.keyCode;
		
	}else{
	
		Code=e.which;
		
	}
	
	switch(Code){		
		
		case 13: login(); break;
		
		default: return; break
		
	}
	
}

//========================================================================================================================================================================

function Send(PSN){
	
	var OBJ=document.getElementById("GuestBook");
	
	 OBJ.action="/Run/Main.Asp?ID=400&PSN="+PSN;
	
	 OBJ.submit();	
}

//========================================================================================================================================================================

function RecordURL(){
		
	Execute("","/Run/Main.Asp?ID=500&URL="+escape(window.location.href))
	
}


//========================================================================================================================================================================


function ShowQQ(){
	
	var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=55697e34b287973fa3984e5832d8f9b37dc144d7fec06e27bb57ffc2e8c145a31a54294eb87385f0a133b007b782c767';
	
	var oldscript=document.getElementById('testJs');
	
	var newscript=document.createElement('script');
	
	newscript.setAttribute('type','text/javascript');
	
	newscript.setAttribute('id', 'testJs');
	
	newscript.setAttribute('src',tempSrc);
	
	if(oldscript == null){
		
		document.body.appendChild(newscript);
		
	}else{
			
			oldscript.parentNode.replaceChild(newscript, oldscript);
			
	}
			
	return false;	
	
}

//========================================================================================================================================================================

function Group(id){

	var OBJ=document.getElementsByName("ListContent");
	
	if(OBJ[id].style.display=='block'){
		
		OBJ[id].style.display='none';
		
	}else{
		
		OBJ[id].style.display='block';
	
	}

}

//========================================================================================================================================================================
function UpdateInfor(RID){
	
	var OBJ=document.getElementById("Infor");
	
	OBJ.action="/Run/Main.Asp?ID=106&RID="+RID;
	
	switch(RID){
		
		case 1: if(OBJ.NickName.value.length>1) OBJ.submit(); break;
		
		case 2: if(OBJ.Password.value.length>5 && OBJ.NewPassword.value.length==OBJ.NewPassword1.value.length && OBJ.NewPassword.value.length>5) OBJ.submit(); break;		
		
		case 3:	 OBJ.submit(); break;
		
	}
	
}

//========================================================================================================================================================================

function Clearing(){	
	
	if(Cookie("UserID").length==16){
	
		window.location.href="/Members/Clearing"
		
	}else{
		
		LoginWindow();
	}
	
}

//========================================================================================================================================================================

function UseIntegral(OBJ){
	
	var FOBJ=document.getElementById("OrderForm")
	
	if(OBJ.checked==true){
		
		if(OBJ.value<1000){
			
			alert("不能使用积分，你的积分共有"+OBJ.value);
			
			OBJ.checked=false;
			
			return;
			
		}else{			
						
			FOBJ.Sum.value=FOBJ.Sum.value-10;

		}		
		
	}else{
		
		window.location.reload()
		
	}
	
}

//========================================================================================================================================================================

function Cookie(name){   
    
      var Value="";   
    
      var search=name+"=";   
    
      if(document.cookie.length>0){     
    
          offset=document.cookie.indexOf(search);   
    
          if(offset!=-1){     
    
              offset+=search.length;   
    
              end=document.cookie.indexOf(";",offset);   
    
              if(end==-1)end=document.cookie.length;   
    
              Value=unescape(document.cookie.substring(offset,end))   
    
          }   
    
      }
    
      return  Value;   
    
}