function Checkform(){
  if (document.getElementById("username").value == ""){
      alert("请输入用户名")
      document.getElementById("username").focus();
      return false;
  }

  if (document.getElementById("userpassword").value == ""){
      alert("请输入密码")
      document.getElementById("userpassword").focus();
      return false;
  }
  		 	
		var cbo = new CallBackObject();
		cbo.OnComplete = Cbo_CompleteGetUser;
		cbo.onError = Cbo_ErrorGetUser;
		cbo.DoCallBack("http://"+location.host+"/page/userlogin.asp?action=login&ppname="+document.getElementById("username").value+"&pppass="+document.getElementById("userpassword").value);
		
}			


function log_out()
{
	ht = document.getElementsByTagName("html");
	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('你确定要注销？'))
	{
		var cbo = new CallBackObject();
		cbo.OnComplete = Cbo_CompleteGetUser;
		cbo.onError = Cbo_ErrorGetUser;
		cbo.DoCallBack("http://"+location.host+"/page/userlogin.asp?action=logout");
	}
	else
	{
		ht[0].style.filter = "";
		return false;
	}
}

		function Cbo_CompleteGetUser(responseText, responseXML)
		{
			 var xml = responseXML;
			 var objselect = xml.selectNodes("//objselect");//找到是第几个User变化
			 if (objselect[0].text != ""){
			 alert(objselect[0].text);
			 }
			 else{
			 window.location.reload();
			 }
	    }

		function Cbo_ErrorGetUser(status, statusText, responseText)
		{
			alert(responseText);
		}


//js获取cookie
function getCookie(name)
{
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
if(arr=document.cookie.match(reg)) return unescape(arr[2]);
else return null;
}
//给相应的form里的input赋值
//document.getElementById("username").value=getck(sname);
//定义一个tick函数，以获取系统的时间
var year,month,day,hours,minutes,seconds,ap;
var intYear,intMonth,intDay,intHours,intMinutes,intSeconds;
var today;
today=new Date();
intHours=today.getHours();
//获取系统时间的小时数
if(intHours >= 0 && intHours < 6)
{
hours=intHours+":";
ap="凌晨好！";
}
else if(intHours >= 6 && intHours<12)
{
hours=intHours+":";
ap="早晨好！";
}
else if(intHours==12)
{
hours=intHours+":";
ap="中午好！";
}
else if(intHours >12 && intHours < 18)
{
hours=intHours+":";
ap="下午好！";
}
else
{
hours=intHours+":";
ap="晚上好！";
}

