﻿var xmlDom = false;//XMLHTTP对象
var arr_UserName = new Array();//保存已经查询过的 用户名
var arr_BackInfo = new Array();//保存查询过的用户名 是否可以注册的信息
var canSubmit = false;//用户点击注册按钮，是否可以提交到服务器

//创建一个xmlhttp
try
{
	xmlDom = new ActiveXObject("Msxml2.XMLHTTP"); //IE高版本创建XMLHTTP
} 
catch (E)
{
	try
	{
		xmlDom = new ActiveXObject("Microsoft.XMLHTTP");//IE低版本创建XMLHTTP
	}
	catch (E)
	{
		  xmlDom = new XMLHttpRequest(); //兼容非ie浏览器，直接创建XMLHTTP对象
	}
} 
//检查用户是否已登陆
 function checkUser()
 {  
      var d = new Date();
      xmlDom.onreadystatechange = function(){           
          if(xmlDom.readyState == 4){          
              if (xmlDom.status == 200){                   
                   var data  = xmlDom.responseText;  
                   if(data=="0"){
                       window.close("/login/jetblue/index.aspx");              
                       window.open("/login/index.aspx","_parent")  
                   }                   
               }   
           }   
      }       
      xmlDom.open("POST","/login/ashx/login.ashx?type=2"+ "&guid=" + d.getTime());   
      xmlDom.send(null);   
 }
   
//注销  
function loginout()
{   
      xmlDom.onreadystatechange = function(){              
          if(xmlDom.readyState == 4){                  
              if (xmlDom.status == 200){     
                    window.close("/login/jetblue/index.aspx");              
                    window.open("/login/index.aspx","_parent")                        
               }   
           }   
      }       
      xmlDom.open("POST","/login/ashx/signout.ashx");   
      xmlDom.send(null);                                          
}

 function getCustomer(id,big,boy,baby)
 {            
          xmlDom.onreadystatechange = function(){              
          if(xmlDom.readyState == 4){                  
              if (xmlDom.status == 200){     
                    document.getElementById ("gCustomer").innerHTML =xmlDom.responseText;                         
               }   
           }   
         }       
         xmlDom.open("POST","/login/jetblue/getCustomer.aspx?ID="+id+"&big="+big+"&boy="+boy+"&baby="+baby);   
         xmlDom.send(null);                                          
 }
 
 function getCustomer_jb(id,big,boy,baby)
 {            
          xmlDom.onreadystatechange = function(){              
          if(xmlDom.readyState == 4){                  
              if (xmlDom.status == 200){     
                    document.getElementById ("gCustomer").innerHTML =xmlDom.responseText;                         
               }   
           }   
         }       
         xmlDom.open("POST","/login/jetblue/getCustomer_jb.aspx?ID="+id+"&big="+big+"&boy="+boy+"&baby="+baby);   
         xmlDom.send(null);                                          
 }
