function ShowNav(id){
    document.getElementById(id).style.display='block';
}

function HideNav(id){
    document.getElementById(id).style.display='none';
}

function IsCharNum(s) 
{ 
    var patrn=/[a-zA-Z0-9]+[a-zA-Z0-9_]+/; 
    if (!patrn.exec(s)) return false; 
    return true;
} 

function IsNum(s) 
{ 
    var patrn=/[1-9]+[0-9_]?/; 
    if (!patrn.exec(s)) return false; 
    return true;
} 

function IsValidEMail(s) 
{ 
    var patrn=/(\S)+[@]{1}(\S)+[.]{1}(\w)+/; 
    if (!patrn.exec(s)) return false; 
    return true;
} 

function GoPage(id,file,bigPage,smallClassID)
{
        txtPage=document.getElementById(id);
        if(txtPage.value=="")
        {
            alert("ÇëÊäÈëÒ³Âë!");
            txtPage.focus();
            return;
        }
        if(!IsNum(txtPage.value))
        {
            alert("ÇëÊäÈëÊý×Ö!"+txtPage.value);
            txtPage.focus();
            return;
        }
        window.location=file+"&page="+txtPage.value+"&BigPage="+bigPage+"&SmallClassID="+smallClassID;
        
}

function TopicGoPage(id,file,bigPage,TID)
{
        txtPage=document.getElementById(id);
        if(txtPage.value=="")
        {
            alert("ÇëÊäÈëÒ³Âë!");
            txtPage.focus();
            return;
        }
        if(!IsNum(txtPage.value))
        {
            alert("ÇëÊäÈëÊý×Ö!"+txtPage.value);
            txtPage.focus();
            return;
        }
        window.location=file+"&page="+txtPage.value+"&BigPage="+bigPage+"&ID="+TID;
        
}

function  getParam(name){   
          var   reg   =   new   RegExp("(^|&)"+   name   +"=([^&]*)(&|$)");   
          var   r   =   window.location.search.substr(1).match(reg);   
          if   (r!=null)   return   unescape(r[2]);   return   null;   
 }   
 
 function InsertIcon(id,dir,img)
 {
     o=document.getElementById(id);
     o.value=o.value+"[icon|"+dir+"|"+img+"/]";
 }


