﻿    var xmlhttp;//声明一个变量
    try
    {
        xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');
    }
    catch(e)
    {
        try
        {
            xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');
        }
        catch(e)
        {
            try
            {
                xmlhttp=new XMLHttpRequest();
            }
            catch(e)
            {
            }
        }
    }
    var temp=new Array();
    var url="/InfoClass/WebService.asmx/LoginCheck";
    xmlhttp.open("post",url,true);        
    xmlhttp.onreadystatechange=function()
    {
        if(xmlhttp.readyState==4)
        {
            if(xmlhttp.status==200)
            {
                var xmldoc=xmlhttp.responseText;
                xmldoc=xmldoc.replace(/&lt;/gi,"<");
                xmldoc=xmldoc.replace(/&gt;/gi,">");
                var xmlDoc2 = new ActiveXObject("Microsoft.XMLDOM");
                xmlDoc2.async="false";
                xmlDoc2.loadXML(xmldoc);
                if(xmlDoc2.parseError.errorCode == 0)
                {
                   if(xmlDoc2.readyState==4)
                    {
                        var name = xmlDoc2.documentElement.selectNodes("//username");
                        var link = xmlDoc2.documentElement.selectNodes("//hyplink");
                        var username=name(0).text;
                        var hyplink=link(0).text;
                        if(username=="nologin")
                       { var temp="";
                        temp="<table width=\"95%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
                        temp+="<tr align=\"center\" valign=\"middle\">";
                        temp+="<th nowrap=\"nowrap\" width=\"100%\" colspan=\"6\" scope=\"col\"><span class=\"youwenzi\" style=\"float:right;\">您还没有登录，请<a class=\"ac\" href=/login.aspx>登录</a>！</span></th>";
                        temp+="<tr align=\"center\" valign=\"middle\">";
                        temp+="<th  width=\"15%\"  class=\"huise\" scope=\"col\"><a href=\"/login.aspx\" class=\"ac\">登录</a></th>";
                         temp+="<th  width=\"5%\"  class=\"huise\" scope=\"col\"></th>";
                        temp+="<th  width=\"15%\" class=\"huise\" scope=\"col\" ><a href=\"/UserRegister.aspx\" class=\"ac\">注册</a></th>";
                            temp+="<th  width=\"5%\"  class=\"huise\" scope=\"col\"></th>";
                        temp+="<th  width=\"30%\"  nowrap=\"nowrap\" class=\"huise\" scope=\"col\" ><a href=\"/help/help_1.htm\" class=\"ac\">客服中心</a></th>";
                        temp+="<th  width=\"30%\" nowrap=\"nowrap\" class=\"huise\" scope=\"col\" ><a href=\"/SiteMap.html\" class=\"ac\">网站地图</a></th>";
                        temp+="</tr></table> ";

                          document.getElementById("list").innerHTML=temp;
                          }
                        else        
                        {                
                        var temp="";
                        
                        
                        temp="<table width=\"95%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
                        temp+="<tr align=\"center\" valign=\"middle\">";
                       temp+="<th  width=\"30%\"  class=\"huise\" scope=\"col\"><span class=\"chengse\" >欢迎您,</span></th>";
                        temp+="<th  width=\"15%\" class=\"huise\" scope=\"col\" ><span class=\"chengse\" >"+username+"!</span></th>";
                        temp+="<th  width=\"30%\"  nowrap=\"nowrap\" class=\"huise\" scope=\"col\" ><span class=\"youwenzi\"><a  href=\""+hyplink+"\" target='_top' class=\"ac\">我的空间</a></span></th></tr>";
                        temp+="<tr align=\"center\" valign=\"middle\">";
                        temp+="<th  width=\"30%\"  nowrap=\"nowrap\" class=\"huise\" scope=\"col\" ><a href=\"/help/help_1.htm\" class=\"ac\">客服中心</a></th>";
                        temp+="<th  width=\"30%\" nowrap=\"nowrap\" class=\"huise\" scope=\"col\" ><a href=\"/SiteMap.html\" class=\"ac\">网站地图</a></th>";
                        temp+="<th  width=\"25%\" nowrap=\"nowrap\" class=\"huise\" scope=\"col\" ><span class=\"youwenzi\">[<a href=\"/exit.aspx?t=2\" class=\"ac\">退出</a>]</span></th>";
                        temp+="</tr></table> ";
                        
                        
                        
                        
                        
//                         temp="<div style=\"width:100%;text-align:center;\"><span class=\"chengse\" >欢迎您，"+username+"！</span>&nbsp;&nbsp;<span class=\"youwenzi\"><a  href=\"/member/myinfo.aspx\" target='_top' class=\"ab\">我的空间</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<a href=\"/exit.aspx?t=2\" class=\"ab\">退出</a>]</span></div>";
                            document.getElementById("list").innerHTML=temp;   
                                                      
                            }     
                    }
                }
            }
        }
    }
    xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");   
    xmlhttp.send(null);        
