﻿/***************登录后不刷新搜索结果页面改变顶部登录状态**************/

function ajaxFunction(url)
{
	//if(window.location.href.toLowerCase().match("tradedblist.aspx"))
	//{
		var xmlHttp;

		try
		{
			xmlHttp = new XMLHttpRequest();
		}
		catch(e)
		{
			try
			{
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e)
			{
				try
				{
					xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch(e)
				{
					alert("您的浏览器不支持AJAX");
					return false;
				}
			}
		}
xmlHttp.onreadystatechange=function()
{
//alert(xmlHttp.readyState);
	if(xmlHttp.readyState == 4)
	{
	//alert(xmlHttp.responseText);
		//获得服务器数据 来自response
		if(xmlHttp.responseText != "null")
		{
			document.getElementById(getID().div1).style.display = "none";
			document.getElementById(getID().div2).style.display = "";
			document.getElementById(getID().link).innerHTML = xmlHttp.responseText;
		}
	}
}
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
	//}
}


/*******************登出逻辑******************/


function logout()
{
	if(window.location.href.toLowerCase().match("tradedblist.aspx"))
	{
			document.getElementById(getID().div1).style.display = "";
			document.getElementById(getID().div2).style.display = "none";
			document.getElementById(getID().link).innerHTML = "";
	}
	else
	{
		document.location.href = document.location.href;
	}
}
