// JavaScript Document
function checkuser()
{
	var ajax;
	var isajax    = false;
	var username  = document.getElementById("username").value;
	var password  = document.getElementById("password").value;
	//var strPostUrl= "http://support-cn.samsung.com/campaign/mp3/event0805_moki/checkuser.asp";
	var strPostUrl= "checkuser.asp";
	
	if(username=="")
	{
		alert("请输入用户名");
		return;
	}
	
	if(password=="")
	{
		alert("请输入密码");
		return;
	}
	
	if( window.XMLHttpRequest)
	{
		ajax = new XMLHttpRequest();
		isajax = true;
	}
	else if( window.ActiveXObject)        
	{
		ajax = new ActiveXObject("Microsoft.XMLHTTP");    
		isajax = true;
	}
	if(isajax)
	{
		ajax.open("POST", strPostUrl, true);
		ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		ajax.send("username="+username+"&password="+password);
		ajax.onreadystatechange=function()
		{
			if(ajax.readyState==4)
			{
				if(ajax.status==200)
				{
					if(ajax.responseText!="")
					{
						var strDiv;
						strDiv  = '<div id="login_1">';
						strDiv += '<p>'+ajax.responseText+'</p>';
						strDiv += '<p><img src="images/index_09.jpg" border="0" usemap="#Map3" />'
						strDiv += '<map name="Map3"><area shape="rect" coords="2,24,108,47" href="post.asp"></map></p>';
						strDiv += '</div>';
						document.getElementById("login_main").innerHTML = strDiv;
					}
					else
					{
						alert("用户名或密码不正确");
					}
				}
			}
		}
	}
}