﻿var tid=document.getElementById("C_top1_inputid").value;

startList = function() {
    if (document.all&&document.getElementById) {
        navRoot = document.getElementById("menu");
        for (i=0; i<navRoot.childNodes.length; i++) {
	        node = navRoot.childNodes[i];
	        if (node.nodeName=="LI") {
		        node.onmouseover=function() {
			        this.className+=" over";
			        document.getElementById("li"+tid+"").className=document.getElementById("li"+tid+"").className.replace("current","");
		        }
		        node.onmouseout=function() {
			        this.className=this.className.replace(" over", "");
			        document.getElementById("li"+tid+"").className="current";
		        }
	        }
        }
    }
}
window.onload=startList;

var xmlHttp = false;
try 
{
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) 
{
  try 
  {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } 
  catch (e2) 
  {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') 
{
  xmlHttp = new XMLHttpRequest();
}

function loginusername() 
{
    var username=document.getElementById("TxtUsername").value;
    var password=document.getElementById("TxtPassword").value;
    if(username=="")
    {
        alert("用户名不能为空");
        return;
    }
    if(password=="")
    {
        alert("密码为空");
        return;
    }
    var url="AjaxLogin.aspx?username="+escape(username)+"&password="+escape(password)+"&date="+new Date();
    xmlHttp.open("GET",url,true);
    xmlHttp.onreadystatechange =Check;
    xmlHttp.send(null);
}

function loginmember() 
{
    var username=document.getElementById("TxtmUsername").value;
    var password=document.getElementById("TxtmPassword").value;
    if(username=="")
    {
        alert("用户名不能为空");
        return;
    }
    if(password=="")
    {
        alert("密码为空");
        return;
    }
    var url="AjaxLogin.aspx?username="+escape(username)+"&password="+escape(password)+"&date="+new Date();
    xmlHttp.open("GET",url,true);
    xmlHttp.onreadystatechange =Check;
    xmlHttp.send(null);
}

function Check(New_id)
{
    if (xmlHttp.readyState < 4) 
    {  
    }
    if (xmlHttp.readyState == 4) 
    {
        if (xmlHttp.status == 200) 
        {
            var response = xmlHttp.responseText;  
            if(response=="0")
            {
                alert("登陆成功!");location.reload();
            }
            else
            {
                alert(response);
            }
        }
    }
}


