﻿function login_click(aimDivID)
{
var username=encodeURI(document.getElementById("txtLoginName").value);
var password=encodeURI(document.getElementById("txtPassWord").value);
createXmlHttpRequest();
xmlHttp.open("get","/Ajax/Login.aspx?username="+username+"&password="+password+"&time="+Math.random(),true);
xmlHttp.onreadystatechange= function()
{
if(xmlHttp.readyState==4)//服务器响应状态
    {
        if(xmlHttp.status==200)//代码执行状态
        {
           document.getElementById("LoginInfo").innerHTML=xmlHttp.responseText;
        }
    }
}
     xmlHttp.send(null);
}
function logout_click()
{
getRequest("/Ajax/Logout.aspx?time="+Math.random(),"LoginInfo");
}

function logouttop_click()
{
getRequest("/Ajax/Logout1.aspx?time="+Math.random(),"LoginInfo_top");
}

function toSearch()
{
if (event.keyCode == 13){
    topSearch();  
}
}
function KeyDown(){ 
if(event.keyCode==13) {
//在页面form中，按回车不触发事件
return false;
}
}
function topSearch()
{
var keyword=encodeURI(document.getElementById("txtKeyword").value);
open("/Search.aspx?k="+keyword);
}
function topIndexSearch()
{
var keyword=encodeURI(document.getElementById("txtKeywordIndex").value);
var type = document.getElementById("ddlTypeIndex").value;
var address = document.getElementById("ddlProvinceIndex").value;
open("/Search.aspx?k="+keyword+"&t="+type+"&p="+address);
}
