﻿// JScript 文件

function onlyNum() //只能数字和小数点
{
    var realKey=String.fromCharCode(event.keyCode);
    var myReg = /^(-|\+)?\d+(((\.\d+)|(\.))|((\/\d+)|(\/)))?$/;
    if(myReg.test(event.srcElement.value+realKey)==false)
    {
        event.returnValue=false;
    }
}      

function onlyNum2()//只能数字
{
    var realKey=String.fromCharCode(event.keyCode);
    var myReg = /^(-|\+)?\d+(((\.\d+))|((\/\d+)|(\/)))?$/;
    if(myReg.test(event.srcElement.value+realKey)==false)
    {
        event.returnValue=false;
    }
}

function HideById(id) //隐藏第一部分
{
    var bt = document.getElementById (id) ;
    bt.style.display="none";
}

function chkAll(tag,bool)  //check全选
{
    //debugger
    var chks=$TN(document,'input');
    for(var i=0;i<chks.length;i++)
    {
        if(chks[i].type == 'checkbox')
        {
            if(chks[i].id.indexOf(tag) !=-1)
            {
                chks[i].checked=bool;
            }
        }
    }
}
      
function chkUnAll(tag)  //checkBox反选
{
    var chks=$TN(document,'input');
    for(var i=0;i<chks.length;i++)
    {
        if(chks[i].type == 'checkbox')
        {
            if(chks[i].id.indexOf(tag) !=-1)
            {
                chks[i].checked=!chks[i].checked;
            }
        }
    }
}

function confirm_delete()
{
    return confirm("删除标签将影响到所有使用该标签的试题分类，确认删除选中的标签？");
}

function confirm_Superdelete()
{
    return confirm("确认删除选中的标签超集？");
}


function openwin(url,height,width)
{
    window.open(url,"","height="+height+",width="+width+",toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no");

}

      
   
