//打开修改密码窗口

 function showEditPas()
    {
        var bowertype = window.navigator.userAgent.indexOf("MSIE");
        if (bowertype >= 1)
            window.showModalDialog("UserManage/editPassWord.aspx","","dialogHeight:140px;dialogWidth:240px;scroll:no;resizable:no;status:no;help:no;");
        else
            popWin('UserManage/editPassWord.aspx','popWindow',240,120,true);
    }
    
//隐藏元素
  function Hid(HidID,img)
    {
        var objimg = document.getElementById(img);

        if(document.getElementById(HidID).style.display=="none")
        {
            document.getElementById(HidID).style.display="";
            objimg.src = "images/list_1.gif";
        }
        else
        {
            document.getElementById(HidID).style.display="none";
            objimg.src = "images/list_2.gif";
        }
    }
 //Top菜单转向
function Redirect(LanguageID)
{
    parent.leftFrame.location.href = 'left.aspx?LanguageID=' + LanguageID;
}

function URL(url,cateID)
{
    if(url=='MenuManage/editsysMenu.aspx')//外部连接
    {
        parent.main.location.href = url + "?ID=" + cateID;
    }
    else
    {
        parent.main.location.href = url + "?cateID=" + cateID;
    }
}
function Redirect2(url)
{
    parent.main.location.href = url;
}

//关于窗口
function AboutInfo() {
        var bowertype = window.navigator.userAgent.indexOf("MSIE");
        if (bowertype >= 1)
	        return showModalDialog("about.aspx", "", "dialogWidth:418px;dialogHeight:210px;help:no;scroll:no;status:no");
        else
            return popWin('about.aspx','popWindow',418,210,true);
}

//非IE对话框
function popWin(theURL,winName,theW,theH,showAsModal) 
{
    theTop = (window.screen.height-theH)/2;
    theLeft = (window.screen.width-theW)/2;
    var features = "toolbar=0,scrollbars=yes,left=" + theLeft + ",top=" + theTop + ",width=" + theW + ",height=" + theH;
    
    window.SubWin = window.open(theURL,winName,features);
    window.SubWin.focus();
    
    if(showAsModal)
    {
        window.CtrlsDisabled = new Array();
        DisableCtrls("INPUT;SELECT;TEXTAREA;BUTTON;A");
    }

    function DisableCtrls(tagNameStr){
        var arrTags = tagNameStr.split(";");
        for(var i=0;i<arrTags.length;i++){
            var arrEle = document.getElementsByTagName(arrTags[i]);
            PushToCtrlsDisabled(arrEle);
        }

        for(var i=0;i<window.CtrlsDisabled.length;i++){
            window.CtrlsDisabled[i].disabled = true;
            window.CtrlsDisabled[i].readOnly = true;
        }
    }

    function PushToCtrlsDisabled(arrEle){
        for(var i=0;i<arrEle.length;i++){
            if(!arrEle[i].disabled){
                window.CtrlsDisabled.push(arrEle[i]);
            }
        }
    }
    
    window.onfocus = function(){
        if(window.SubWin && showAsModal){
            if(window.SubWin.closed == true || typeof(window.SubWin.closed) == "undefined"){
                for(var i=0;i<window.CtrlsDisabled.length;i++){
                    window.CtrlsDisabled[i].disabled = false;
                    window.CtrlsDisabled[i].readOnly = false;
                }
            }else{
                window.SubWin.focus();
            }
        }
    }
}

//禁止右键菜单
document.oncontextmenu=function()
{
    return false;
}
//禁止选择
document.oncopy=function()
{
    return false;
}
document.onselectstart=function()
{
    return false;
}
document.onmousemove=function()
{
    return false;
}
document.onmousedown =function()
{
    return false;
}
//禁止拖动
document.ondragstart=function()
{
    return false;
}
