﻿// JScript 文件
function trim(s)
{
    var p=/(^\s*)|(\s*$)/g;
    return s.replace(p,"");
}

	 //显示DIV
	function toggle1(targetid)
	{
        if (document.getElementById)
		{
            target=document.getElementById(targetid);
            target.style.display="block";
        }
     }
     
    //隐藏DIV
	function toggle(targetid)
	{
        if (document.getElementById)
		{
            target=document.getElementById(targetid);
            target.style.display="none";
        }
     }
     
  function operation(message)
  {
     var re=false;
     if(confirm(message))
     {
        re=true;
     }
     
     return re;
}

//只能输入数字
function JHshNumberText()
{
    if ( !(((window.event.keyCode >= 48) && (window.event.keyCode <= 57)) || (window.event.keyCode == 13) || (window.event.keyCode == 46) || (window.event.keyCode == 45)))
    {
        window.event.keyCode = 0 ;
    }
} 

function isNum(str)
{
   return !isNaN(str)
}

 
function getparastr(strname)
  {
   var hrefstr,pos,parastr,para,tempstr;
   hrefstr = window.location.href;
   pos = hrefstr.indexOf("?")
   parastr = hrefstr.substring(pos+1);
   para = parastr.split("&");
   tempstr="";
   for(i=0;i<para.length;i++)
   {
    tempstr = para[i];
    pos = tempstr.indexOf("=");
    if(tempstr.substring(0,pos) == strname)
    {
     return tempstr.substring(pos+1);
     }
   }
   return null;
  }