﻿
  //--------------------   防止出错   ---------------------------
  function   killErrors()   
  {
      return   true;
  }
  window.onerror   =   killErrors;
  
  //-------------------   窗口最大化   --------------------------   
  self.moveTo(0,0);
  self.resizeTo(screen.availWidth,screen.availHeight);
  self.focus();
  //   状态栏显示文字  
  
function Alert(message)
{
    var dialog=new Dialog("系统消息");
	dialog.Alert(message);
	dialog.Alert.Dispose=function ()
	{			
	};   
};
function Close() 
{ 
    var ua=navigator.userAgent;
    var ie=navigator.appName=="Microsoft Internet Explorer"?true:false;
    if(ie) 
    { 
        var IEversion=parseFloat(ua.substring(ua.indexOf("MSIE ") +5,ua.indexOf(";",ua.indexOf("MSIE ")))) 
        if(IEversion< 5.5) 
        { 
            var str  = "\"clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11\">" 
            str += "\"Command\" value=\"Close\">"; 
            document.body.insertAdjacentHTML("beforeEnd", str); 
            document.all.noTipClose.Click(); 
        } 
        else 
        { 
            window.opener =null; 
            window.open("","_self");//解决IE7关闭弹出提示问题
            window.close(); 
        } 
    } 
    else 
    { 
        window.close() 
    } 
} 
function Login()
{
	if (document.getElementById("UserNameTextBox").value=="")
		{
			var dialog=new Dialog("系统消息");
			dialog.Alert("请输入用户名!!");
			dialog.Alert.Dispose=function ()
			{
				document.getElementById("UserNameTextBox").focus();
			}      
			return false;
	}
	
	if (document.getElementById("PasswordTextBox").value=="")
	{
			var dialog=new Dialog("系统消息");
			dialog.Alert("请输入密码！");
			dialog.Alert.Dispose=function ()
			{
				document.getElementById("PasswordTextBox").focus();
			}      
			return false;
	}
//	if (document.getElementById("DropDownListBanCi").value=="")
//	{
//			var dialog=new Dialog("系统消息");
//			dialog.Alert("请选择班次！");
//			dialog.Alert.Dispose=function ()
//			{
//				document.getElementById("DropDownListBanCi").focus();
//			}      
//			var dialog=new Dialog("系统消息");
//			dialog.Alert("请选择班次！");
//			dialog.Alert.Dispose=function ()
//			{
//				document.getElementById("DropDownListBanCi").focus();
//			}      
//			return false;
//	}
//	if (document.getElementById("DropDownListDangBan").value=="")
//	{
//			var dialog=new Dialog("系统消息");
//			dialog.Alert("请选择当班！");
//			dialog.Alert.Dispose=function ()
//			{
//				document.getElementById("DropDownListDangBan").focus();
//			}      
//			var dialog=new Dialog("系统消息");
//			dialog.Alert("请选择当班！");
//			dialog.Alert.Dispose=function ()
//			{
//				document.getElementById("DropDownListDangBan").focus();
//			}      
//			return false;
//	}
 	
//strURL   =   "login.aspx?open=true&uname="+escape(document.getElementById("UserNameTextBox").value)+"&pwd="+escape(document.getElementById("PasswordTextBox").value);   
//  strURL   =   "login.aspx?open=true";
//  
//  var win=window.open(strURL, "","toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,status=no,top=0,left=0");  
//  win.moveTo(0,0);
//  win.resizeTo(screen.availWidth,screen.availHeight);
//  win.focus();
//  Close();

  return true; 
}
