function openWindow(url, name, width, height) {
window.open( url, name, 'toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,scrollbars=yes,width='+width+',height='+height+',top=30,left=230');
}
function CheckNumber(Obj,DescriptionStr)
{
    if (Obj.value!='' && (isNaN(Obj.value) || Obj.value<0))
    {
        alert(DescriptionStr+"只允许填写数字(Only Allowed To Fill In Numbers)！");
        Obj.value="";
        Obj.focus();
    }
}
function CheckEnglishStr(Obj,DescriptionStr)
{
    var TempStr=Obj.value,i=0,ErrorStr='',CharAscii;
    if (TempStr!='')
    {
        for (i=0;i<TempStr.length;i++)
        {
            CharAscii=TempStr.charCodeAt(i);
            if (CharAscii>=255||CharAscii<=31)
            {
                ErrorStr=ErrorStr+TempStr.charAt(i);
            }
            else
            {
                if (!CheckClassErrorStr(CharAscii))
                {
                    ErrorStr=ErrorStr+TempStr.charAt(i);
                }
            }
        }
        if (ErrorStr!='')
        {
            alert(DescriptionStr+'非法字符(Illegal Characters)：'+ErrorStr);
            Obj.focus();
            return false;
        }
        if (!(((TempStr.charCodeAt(0)>=48)&&(TempStr.charCodeAt(0)<=57))||((TempStr.charCodeAt(0)>=65)&&(TempStr.charCodeAt(0)<=90))||((TempStr.charCodeAt(0)>=97)&&(TempStr.charCodeAt(0)<=122))))
        {
            alert(DescriptionStr+'首字符只允许为数字或字母(The First Character Is Number Or Letter Only)！');
            Obj.focus();
            return false;
        }
    }
    return true;
}
function chkselect(s,divid)
{
var divname='Issubport';
var chkreport;
    s=Number(s)
    if (divid=="knowmail")
    {
    divname=divname+s;
    }
    if (divid=="knowupload")
    {
    s+=4;
    if (s==1003){s=999;}
    divname=divname+s;
    }
    if (divid=="knowpreview")
    {
    s+=9;
    if (s==1008){s=999;}
    divname=divname+s;
    }
document.getElementById(divid).innerHTML=divname;
chkreport=document.getElementById(divname).innerHTML;
document.getElementById(divid).innerHTML=chkreport;
}
function fIsNumber (sV,sR){
var sTmp;
if(sV.length==0){ return (false);}
for (var i=0; i < sV.length; i++){
sTmp= sV.substring (i, i+1);
if (sR.indexOf (sTmp, 0)==-1) {return (false);}
}
return (true);
}
function doHighlight(elementName)
{
var defaultBGcolor="#eee";
var defaultFGcolor="#000";
var hoverBGcolor="#EFF";
var hoverFGcolor="#006";
for (var i=0;i<whatTag(elementName).length;i++)
    {
    var currentEl=whatTag(elementName)[i];
    if (document.getElementById)
        {
        currentEl.onfocus=function(){this.style.backgroundColor=hoverBGcolor;this.style.color=hoverFGcolor;};
        currentEl.onblur=function(){this.style.backgroundColor=defaultBGcolor;this.style.color=defaultFGcolor;};
        }
    }
}
function highlightFormInput()
{
doHighlight("INPUT");
doHighlight("TEXTAREA");
doHighlight("SELECT");
}
function whatTag(tagName)
{
var value=document.getElementByTagName?document.getElementByTagName(tagName):document.all.tags(tagName);
    return value;
}
if (document.all)
    {
    window.onload = highlightFormInput;
    }
var notAlpha    = /[^a-z \-\.\,']/gi;
var isEmail     = /^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-z]{2,6}(\.[a-z]{2})?$/i;
var isDecimal   = /^\d+(\.\d+)?$/;
function checkall(all)
{
  var a = document.getElementsByName("IDText");
  for (var i=0; i<a.length; i++) a[i].checked = all.checked;
}
function ConfirmDel()
{
   if(confirm("确定删除吗(Sure To Delete It)？"))
     return true;
   else
     return false;
}
function ConfirmNoDel()
{
   if(confirm("由于有下属栏目或内容无法删除(As A Subordinate Part Or Content Can Not Be Deleted)！"))
     return true;
   else
     return false;
}