function ChangeBg(t,img)
{
	t.background=img;
}

function ChangeBgc(t,color)
{
	t.bgColor=color;
}

function QueryLottery(TypeId)
{
	var listbox=document.getElementById(TypeId);
	if (listbox.value=="")
	{
		alert("请选择该玩法下的相应查询选项。");
		return;
	}
	window.open(listbox.value,"_blank");
}

var MyAjax;
function CreateAjax()
{
	try
	{
		if (window.ActiveXObject)
		{
			MyAjax = new ActiveXObject("Microsoft.XMLHTTP");
		}
		else if (window.XMLHttpRequest)
		{
			MyAjax = new XMLHttpRequest();
			if (MyAjax.overrideMimeType)
			{
				MyAjax.overrideMimeType("text/xml");
			}
		}
	}
	catch(e)
	{
		MyAjax = null;
	}
}

function LoginIt()
{
	var u,p;
	u=document.getElementById("un").value;
	p=document.getElementById("up").value;
	if (u=="" || p=="")
	{
		alert("登录名或密码为空。");
		return;
	}
	MyAjax = null;
	CreateAjax();
	MyAjax.onreadystatechange=ValidateLogin;
	MyAjax.open("GET","ValidateLogin.aspx?un="+escape(u)+"&up="+escape(p),true);
	MyAjax.send(null);
}

function LoginIt2()
{
	var u,p;
	u=document.getElementById("un").value;
	p=document.getElementById("up").value;
	if (u=="" || p=="")
	{
		alert("登录名或密码为空。");
		return;
	}
	MyAjax = null;
	CreateAjax();
	MyAjax.onreadystatechange=ValidateLogin;
	MyAjax.open("GET","../ValidateLogin.aspx?un="+escape(u)+"&up="+escape(p),true);
	MyAjax.send(null);
}

function ValidateLogin()
{
	if (MyAjax.readyState==4)
	{
		if (MyAjax.status==200)
		{
			if (MyAjax.responseText=="0")
			{
				document.location.reload();	
			}
			else
			{
				alert(MyAjax.responseText);
			}
		}
	}	
}