function strim(str){
  lIdx=0;
  rIdx=str.length;
  if(strim.arguments.length==2){
    act=strim.arguments[1].toLowerCase();
    alert(act);
  }
  else{
    act="all";
  }
  for(var i=0;i<str.length;i++){
    thelStr=str.substring(lIdx,lIdx+1);
    therStr=str.substring(rIdx,rIdx-1);
    if ((act=="all" || act=="left")&&thelStr==" "){
      lIdx++;
    }
    if ((act=="all" || act=="right")&&therStr==" "){
      rIdx--;
    }
  }
  str=str.slice(lIdx,rIdx);
  return(str);
}




  function inerr(f,n){
    if(f.value=="" || f.value==null){
      alert(n);
      f.focus();
      return true;
    }
    else
      return false;
  }
  
  
  function StrLen(sString)
{
 var sStr,iCount,i,strTemp ;
 iCount = 0 ;
 sStr = sString.split("");
 for (i = 0 ; i < sStr.length ; i ++)
  {
      strTemp = escape(sStr[i]); 
   if (strTemp.indexOf("%u",0) == -1) //  表示是汉字
   { 
   iCount = iCount + 1 ;
   } 
   else 
   {
   iCount = iCount + 2 ;
   }
 }
return iCount ;
}


function contain(str,charset)// 字符串包含测试函数
{
var i;
for(i=0;i<charset.length;i++)
if(str.indexOf(charset.charAt(i))>=0)
return true;
return false;
}

function showFAQ(fID){
var fID=fID;
window.open ('../FAQ.asp?fID='+fID+'','','scrollbars=yes,resizable=no,menubar=no,width=516,height=600,top=30,left=250');
}


function showSysMessage(pID){
var pID=pID;
window.open ('../SysMessage.asp?pID='+pID+'','','scrollbars=yes,resizable=no,menubar=no,width=516,height=600,top=30,left=250');
}

function showShare(nID){
var nID=nID;
window.open ('studentShare.asp?nID='+nID+'','','scrollbars=yes,resizable=no,menubar=no,width=516,height=600,top=30,left=250');
}

function showShare2(nID){
var nID=nID;
window.open ('../studentShare.asp?nID='+nID+'','','scrollbars=yes,resizable=no,menubar=no,width=516,height=600,top=30,left=250');
}

function showNews(nID){
var nID=nID;
window.open ('news.asp?nID='+nID+'','','scrollbars=yes,resizable=no,menubar=no,width=516,height=600,top=30,left=250');
}
function showwindow(url){
window.open ('student/s_reg.asp');
}
function showBaomingbidu(btID){
var btID=btID;
window.open ('baoming_bidu.asp?btID='+btID+'','','scrollbars=yes,resizable=no,menubar=no,width=516,height=600,top=30,left=250');
}

function showmap(){
window.open ('map/index.htm','','scrollbars=yes,resizable=no,menubar=no,width=770,height=700,top=10,left=150');
}

function showmap2(){
window.open ('../map/index.htm','','scrollbars=yes,resizable=no,menubar=no,width=770,height=700,top=10,left=150');
}

function tabit(btn)
{
   var idname = new String(btn.id);
   var s = idname.indexOf("_");
   var e = idname.lastIndexOf("_")+1;
   var tabName = idname.substr(0, s);
   var id = parseInt(idname.substr(e, 10));
   //var tabNumber = btn.parentNode.childNodes.length;
   for(i=0;i<10;i++)
   {
       document.getElementById(tabName+"_div_"+i).style.display = "none";
       //document.getElementById(tabName+"_btn_"+i).style.backgroundColor = "#fff";
       //document.getElementById(tabName+"_btn_"+i).style.borderBottomColor = "#ace";
       document.getElementById(tabName+"_btn_"+i).style.cursor = "pointer";
   };
   document.getElementById(tabName+"_div_"+id).style.display = "block";
   //btn.style.backgroundColor = "#fff";
   //btn.style.borderBottomColor = "#fff";
   btn.style.cursor = "default";
}

function tabitt(btn)
{
   var idname = new String(btn.id);
   var s = idname.indexOf("_");
   var e = idname.lastIndexOf("_")+1;
   var tabName = idname.substr(0, s);
   var id = parseInt(idname.substr(e, 10));
   //var tabNumber = btn.parentNode.childNodes.length;
   for(i=0;i<4;i++)
   {
       document.getElementById(tabName+"_div_"+i).style.display = "none";
       //document.getElementById(tabName+"_btn_"+i).style.backgroundColor = "#fff";
       //document.getElementById(tabName+"_btn_"+i).style.borderBottomColor = "#ace";
       document.getElementById(tabName+"_btn_"+i).style.cursor = "pointer";
   };
   document.getElementById(tabName+"_div_"+id).style.display = "block";
   //btn.style.backgroundColor = "#fff";
   //btn.style.borderBottomColor = "#fff";
   btn.style.cursor = "default";
}

function showainfo(ID){
window.open ('a'+ID+'.asp','','scrollbars=yes,resizable=no,menubar=no,width=800,height=600,top=30,left=250');
}
function showbinfo(ID){
window.open ('b'+ID+'.asp','','scrollbars=yes,resizable=no,menubar=no,width=800,height=600,top=30,left=250');
}
function showcinfo(ID){
window.open ('c'+ID+'.asp','','scrollbars=yes,resizable=no,menubar=no,width=800,height=600,top=30,left=250');
}
function showxinfo(ID1,ID2){
window.open ('about'+ID1+'.asp?id='+ID2+'','','scrollbars=yes,resizable=no,menubar=no,width=480,height=600,top=30,left=250');
}
function showanli(ID){
window.open ('kouyu_anli'+ID+'.asp','','scrollbars=yes,resizable=no,menubar=no,width=480,height=600,top=30,left=250');
}