﻿function check_Login()
{
if(document.Login.username.value=="")
{
alert("用户名不能为空");
return false;
}
if(document.Login.password.value=="")
{
alert("密码不能为空");
return false;
}
if (Login.username.value!="" || Login.password.value!="")
{
var xmlhttp = Get1O(); 
	 xmlhttp.open("GET","ChkPssword.asp?username="+escape(Login.username.value)+"&password="+Login.password.value,true);
	//alert("ChkPssword.asp?username="+UrlEncode(Login.username.value)+"&password="+Login.password.value);
	 xmlhttp.onreadystatechange=function ()
	 {
	     if (4==xmlhttp.readyState)
		 {
		     if (200==xmlhttp.status)
			 {
				//alert(xmlhttp.responseText);
			     if (xmlhttp.responseText=="2")
				   {
				   alert("用户名或密码错误，请重新输入");
				 return false;
				   }
			 }
		 }
	 }
		xmlhttp.send(null); 
return true;
}
}

function Get1O()
{
     var xmlhttp=false; 
	 try 
	 {
	     xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	 } 
	 catch (e)
	 {
	     try
		    {
			   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
			}
			catch (E)
			{
			    xmlhttp = false;
			}
	 }
	 if (!xmlhttp && typeof XMLHttpRequest!='undefined')
	 {
	     xmlhttp = new XMLHttpRequest();
	 }
	 return xmlhttp;
}
function check_Search()
{
if(document.Search.KeyStr.value=="")
{
alert("搜索关键字不能为空");
return false;
}
return true;
}
function check_Down()
{
if(1==1)
{
	var xmlhttpE = Get1O(); 
	xmlhttpE.open("GET","ChkUserLogin.asp",true);
	alert("ok1");
	alert("ChkUserLogin.asp");
	xmlhttpE.onreadystatechange=function ()
	{
		alert("ok2");
		alert(xmlhttpE.readyState);
		if (4==xmlhttpE.readyState)
		{
			alert("ok3");
			alert(xmlhttpE.readyState);
			if (200==xmlhttpE.status)
			{
				LoginSign=xmlhttpE.responseText
				
				if (xmlhttpE.responseText=="2")
				{
					return false;
					}
				}
			}
		}
		xmlhttpE.send(null); 
		alert(LoginSign);
		if(LoginSign==2)
		{
alert("会员专区，请登陆后下载");
return false;
			}

}
return true;
}

function OpenWin(DringID) {
	if (DringID > 0)
		window.open("/Video.asp?DringID=" + DringID, "OpenWin", 'width=240, height=288, left=10, top=10, scrollbars=no');
}
