// JavaScript Document

    $("#Login").wBox({
    requestType: "ajax",
    title:"<div class='demo'>会员登录</div>",
	target:"/Login.asp"
   });
     $("#Register").wBox({
    requestType: "ajax",
    title:"<div class='demo'>会员注册</div>",
	target:"/Register.asp"
   }
);
function ShowRegs()
{
 $("#Register").wBox({
    requestType: "ajax",
    show:true,
    title:"<div class='demo'>会员注册</div>",
	target:"/Register.asp"
 });
init_reg();
}


function ShowGetPass()
{
$("#Login").wBox({
    requestType: "ajax",
    show:true,
    title:"<div class='demo'>找回密码</div>",
	target:"/GetPass.asp"
   });
}

function ShowGetPassa(Str)
{
$("#Login").wBox({
    requestType: "ajax",
    show:true,
    title:"<div class='demo'>找回密码</div>",
	target:"/GetPassa.asp?User="+Str
   });
}


function ShowLogin()
{
$("#Login").wBox({
    requestType: "ajax",
    show:true,
    title:"<div class='demo'>会员登录</div>",
	target:"/Login.asp"
   });
}


function ShowLogins()
{
$("#Login").wBox({
    requestType: "ajax",
    show:true,
    title:"<div class='demo'>会员登录</div>",
	target:"/Login_A.asp"
   });
  

}
//判断是否已经登录 
function Member_Loginok()
{
Url="/Member/Member_Ok.Asp"
var xmlhttp;
   if (window.ActiveXObject) {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }else if(window.XMLHttpRequest)  {
      xmlhttp=new XMLHttpRequest();
   }
   if (xmlhttp) {
        xmlhttp.onreadystatechange=function () {
		  if(xmlhttp.readyState==4)  {
		   // document.getElementById("shop_count").innerHTML="载入.";
			//document.getElementById("price").innerHTML="载入.";
             if(xmlhttp.status==200)  {
	            var yy=unescape(xmlhttp.responseText);
if(yy==0){
ShowLogins();
}else{
  $("#Form_Order_Ok").attr("action", "Order_Lvxingxiang.asp");
  $("#Form_Order_Ok").submit();
}
	         }else {
		     //  alert("error");
	         }
          }
		}  
	    xmlhttp.open("get",Url);
		xmlhttp.send(null);
    }		

}

//判断是否已经登录，加载欢迎提示 
function Member_Loginoks()
{
Url="/Member/Member_Ok.Asp"
var xmlhttp;
   if (window.ActiveXObject) {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }else if(window.XMLHttpRequest)  {
      xmlhttp=new XMLHttpRequest();
   }
   if (xmlhttp) {
        xmlhttp.onreadystatechange=function () {
		  if(xmlhttp.readyState==4)  {
		   // document.getElementById("shop_count").innerHTML="载入.";
			//document.getElementById("price").innerHTML="载入.";
             if(xmlhttp.status==200)  {
	            var yy=unescape(xmlhttp.responseText);
if(yy==0){
Shopshows("/Loginstr.Asp?Sid=1","Loginstr");
}else{
Shopshows("/Loginstr.Asp?Sid=1","Loginstr");
Shopshows("/Loginstr.Asp?Sid=2","loginyes");
$("#LoginBox").hide();
//document.getElementById("Loginstr").innerHTML="";
}
	         }else {
		     //  alert("error");
	         }
          }
		}  
	    xmlhttp.open("get",Url);
		xmlhttp.send(null);
    }		

}
Member_Loginoks();
function Member_Logins()
{
document.getElementById('GET_Login').disabled = true;
Url="/Member_Login.Asp?User="+ document.getElementById("Username").value +"&Pass="+ document.getElementById("Password").value;
var xmlhttp;
   if (window.ActiveXObject) {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }else if(window.XMLHttpRequest)  {
      xmlhttp=new XMLHttpRequest();
   }
   if (xmlhttp) {
        xmlhttp.onreadystatechange=function () {
		  if(xmlhttp.readyState==4)  {
		   // document.getElementById("shop_count").innerHTML="载入.";
			//document.getElementById("price").innerHTML="载入.";
             if(xmlhttp.status==200)  {
	            var yy=unescape(xmlhttp.responseText);
if(yy==1){
   $('#Login').wBox({title:"登录成功提示",show:true,html:"<div class='Box_Yes'>您已成功登录会员平台！</div>",timeout:2000});
   history.go(0);
}else{
 alert("对不起，您输入的用户名或密码错误，登录失败！");
 ShowLogins();
}
	         }else {
		     //  alert("error");
	         }
          }
		}  
	    xmlhttp.open("get",Url);
		xmlhttp.send(null);
    }		

}



function Member_GetPass()
{
Url="/Member_GetPass.Asp?User="+ document.getElementById("Username").value;
var xmlhttp;
   if (window.ActiveXObject) {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }else if(window.XMLHttpRequest)  {
      xmlhttp=new XMLHttpRequest();
   }
   if (xmlhttp) {
        xmlhttp.onreadystatechange=function () {
		  if(xmlhttp.readyState==4)  {
		   // document.getElementById("shop_count").innerHTML="载入.";
			//document.getElementById("price").innerHTML="载入.";
             if(xmlhttp.status==200)  {
	            var yy=unescape(xmlhttp.responseText);
if(yy==1){
ShowGetPassa(document.getElementById("Username").value);
}else{
 alert("对不起，您输入的用户名错误，请重新填写！");
 ShowGetPass();
}
	         }else {
		     //  alert("error");
	         }
          }
		}  
	    xmlhttp.open("get",Url);
		xmlhttp.send(null);
    }		

}


function Member_GetPassa()
{
document.getElementById('GetPass').disabled = true;
Url="/Member_GetPass_ok.Asp?User="+ document.getElementById("Username").value +"&Email="+ document.getElementById("Email").value +"&codeStr="+document.getElementById("codeStr").value ;
var xmlhttp;
   if (window.ActiveXObject) {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }else if(window.XMLHttpRequest)  {
      xmlhttp=new XMLHttpRequest();
   }
   if (xmlhttp) {
        xmlhttp.onreadystatechange=function () {
		  if(xmlhttp.readyState==4)  {
		   // document.getElementById("shop_count").innerHTML="载入.";
			//document.getElementById("price").innerHTML="载入.";
             if(xmlhttp.status==200)  {
	            var yy=unescape(xmlhttp.responseText);
if(yy==1){
 alert("恭喜您，您的密码已经找回并发送到您的邮箱里，请登录您的电子邮箱获取密码！");
 history.go(0);
}else{
 alert("对不起，您输入的验证信息错误，请重新填写！");
 ShowGetPass();
}
	         }else {
		     //  alert("error");
	         }
          }
		}  
	    xmlhttp.open("get",Url);
		xmlhttp.send(null);
    }		

}
 