//获取登录后Cookie名称
function GetCookies(name) 
 { 
 cookie_name = name + "="; 
 cookie_length = document.cookie.length; 
 cookie_begin = 0; 
 while (cookie_begin < cookie_length) 
  { 
   value_begin = cookie_begin + cookie_name.length; 
   if (document.cookie.substring(cookie_begin, value_begin) == cookie_name) 
    { 
     var value_end = document.cookie.indexOf ( ";", value_begin); 
     if (value_end == -1) 
        { 
         value_end = cookie_length; 
        } 
        return unescape(document.cookie.substring(value_begin, value_end)); 
     } 
   cookie_begin = document.cookie.indexOf ( " ", cookie_begin) + 1; 
   if (cookie_begin == 0) 
      { 
       break; 
      } 
   } 
   return null; 
 } 
 
 //获取登录后的Cookie的值
 function GetCookieValues(P_strName,strValueName){
  if(GetCookies(P_strName)!=null){
   if(GetCookies(P_strName).split('=')[0]==strValueName){
      return GetCookies(P_strName).split('=')[1]
     }
   }
 }




if (GetCookieValues("User", "Uid") != null && GetCookieValues("User", "Uid") !="")
	{
		document.write('<span>用户名：</span>');
		document.write(unescape(GetCookieValues("info", "UserName"))+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
		document.write('<span>密码：</span>');
		document.write('******&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
		document.write('&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="退出" class="z_login_but1" onClick=location.href="/Exit.asp"; />');
	}
else
	{
		document.write('<table><tr><td><span>用户名：</span>');
		document.write('<input type="text" name="UserName" id="UserName" value="'+unescape(GetCookieValues("info", "UserName"))+'" />');
		document.write('<span>密码：</span>');
		document.write('<input type="password" name="password" id="password" />');
		document.write('<input type="submit" value="登陆" class="z_login_but1" />');
		document.write('<input type="button" value="忘记密码" class="z_login_but2" onClick=ymPrompt.win({title:"找回密码",fixPosition:true,maxBtn:false,minBtn:false,width:350,height:270,iframe:{id:"log",name:"log",src:"/forgetpass.asp"}}); /></td>');
		document.write('<td><a href="/newRes/"><img src="/newRes/Images/16-member-url.jpg" alt="" border="0" /></a></td></tr></table>');
	}