	charset="gb2312"; 
	 //*****************************//
	 //ajax登录//
	 var xmlhttp; 
	function checkUserName() 
	{ 	
	//用户名
   uname=this.form1.username.value; 
   pass=this.form1.password.value;
	//validcode=this.form1.validcode.value;
   try 
   { 
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
   } 
   catch (e) 
   { 
     try 
     { 
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
     } 
     catch (e) 
     { 
     try 
     { 
   xmlhttp=new XMLHttpRequest(); 
     } 
     catch (e) 
     { 
     } 
     } 
   } 

//创建请求，并使用escape对username编码，以避免乱码 
xmlhttp.open("post","../User/logincheck1.asp?username="+uname+"&password="+pass,true); 
 //+"&validcode="+validcode
 xmlhttp.onreadystatechange=function() 
   {  
     if(4==xmlhttp.readyState) 
	{  
		if(200==xmlhttp.status) 
		{
		  if (xmlhttp.responseText=="1") 
		  { 
			document.getElementById("login").innerHTML="欢迎 "+document.all.username.value+" 登录　<a href='/vip/index.asp'>进入商务中心</a>　<a href='/user/UserOut.asp'>安全退出</a>"; 
		  } else 
			{ 
			alert("用户名或密码错误");	
			}   
		} 
		else 
		{ 
		  msg="网络链接失败"; 
		} 
	} 
   } 
   xmlhttp.send(null);   
  } 
//*********************************
var cool;
function GetCookie(Name)
{
   var search = Name + "=";
   var returnvalue = "";
   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;
         returnvalue=unescape(document.cookie.substring(offset,end));
       }
    }
    return returnvalue;
} 
cool=GetCookie("userid");
if(cool!=""){
document.write("欢迎 "+GetCookie("username")+" 登录&nbsp;&nbsp;&nbsp;<a href='/vip/index.asp'>进入商务中心</a>　<a href='/user/UserOut.asp'>安全退出</a>");
}else{
document.write("<li style='width:488px; text-align:left;overflow:hidden;'><form name='form1' method='post' id='login'>用户名：<input name='username' type='text' id='username' style='width:120px' maxlength='16' />　密码：<input name='password' type='password' id='password' style='width:120px' maxlength='16' onkeydown='return SubmitKeyClick(this,event)' />　<input type='button' name='button1' style='background:#1073cf;color:#fff;border:none;width:60px;height:20px;cursor:pointer;' value='登　录' onclick='checkUserName();' /></form></li>");
}
  
  
  
  
  
  