﻿var isIE=document.all;
//用于验证登陆信息
function checkLogin(strLoginName,strPassword)
{
    if(strLoginName.value.length==0)
    {
        alert("请输入用户名称");
        strLoginName.focus();
        return false;
    }
    if(strPassword.value.length==0)
    {
        alert("请输入密码");
        strPassword.focus();
        return false;
    }
    return true;
}
//退出系统前的提示信息
function quitLogin()
{
    return confirm('您确定要退出系统吗？');
}
//退出系统前的提示信息(适用于菜单)
function funQuit()
{
    if(confirm("您确定要退出系统吗？"))
        parent.location="/loginOut.aspx";
    return ;
}
//阻止页面转向
function stopUrl()
{
    return ;
}
//验证修改密码
function checkModifyPwd(strPwd,strNewPwd,strVerPwd)
{
    if(strPwd.value.length==0)
    {
        alert("请输入旧密码");
        strPwd.focus();
        return false;
    }
    if(strPwd.value.length>100)
    {
        alert("旧密码的长度无效，旧密码的长度不能超过100个字符。");
        strPwd.focus();
        return false;
    }
    if(strNewPwd.value.length==0)
    {
        alert("请输入新密码");
        strNewPwd.focus();
        return false;
    }
    if(strNewPwd.value.length>100)
    {
        alert("新密码的长度无效，新密码的长度不能超过100个字符。");
        strNewPwd.focus();
        return false;
    }
    if(strVerPwd.value.length==0)
    {
        alert("请输入确认密码");
        strVerPwd.focus();
        return false;
    }
    if(strVerPwd.value.length>100)
    {
        alert("确认密码的长度无效，确认密码的长度不能超过100个字符。");
        strVerPwd.focus();
        return false;
    }
    if(strNewPwd.value!=strVerPwd.value)
    {
        alert("新密码与确认密码不一致。");
        strVerPwd.focus();
        return false;
    }
    return true;
}
//在对话框窗口中显示指定的页面信息
function ShowDialogForm(strUrl,strReturnUrl)
{
    if(strUrl.length==0)
    {
        alert("要加载的页面地址不能为空值");
        return ;
    }
    if(strReturnUrl.length==0)
    {
        alert("请为系统指定一个当点击“确定”按钮后的页面地址");
        return ;
    }
	var comeback;
	if(isIE)
	    comeback=window.showModalDialog(strUrl);
	else
	{
	    comeback=window.open(strUrl,null,'modal=yes');
	    comeback.moveTo(screen.width/2-250,screen.height/2-250);
	    comeback.resizeTo(500,500);
	    comeback.focus();
	}
//	if(comeback!='')
//		window.location=strReturnUrl;
	return ;
}
//放弃对话窗口
function cancelDialog()
{
    if(!confirm("您确定要放弃修改操作吗？"))
        return false;
    window.returnValue='';
    parent.window.opener=null;
    parent.window.close();
    return false;
}
