<!--


//去除字符串的前后空白
String.prototype.trim = function(){
      return this.replace(/(^\s*)|(\s*$)/g,"");
}
//判断字符串是否全为数字
String.prototype.IsNum = function(){
    var reg = /^\d+$/g;
    return reg.test(this);
}

function CheckNumber(Obj,DescriptionStr)
{
	if (Obj.value!='' && (isNaN(Obj.value) || Obj.value<0))
	{
		alert(DescriptionStr+"应填有效数字！");
		Obj.value="";
		Obj.focus();
	}
}
    
function toDateTime(strTime) 
{
      var temp=new Array();
      strTime.replace(/(\d+)/g,function(a,b){temp.push(b)});
            
      var varDate= new Date(temp[0],(parseInt(temp[1],10)-parseInt(1)),temp[2],temp[3],temp[4]);
      if(varDate!=null)
      {
            return varDate.getTime();
      }
      else
      {
            return 0;
      }
}

position = function(x,y)
{
    this.x = x;
    this.y = y;
}

getPosition = function(oElement)
{
    var objParent = oElement
    var oPosition = new position(0,0);
    while (objParent.tagName != "BODY")
    {
        oPosition.x += objParent.offsetLeft;
        oPosition.y += objParent.offsetTop;
        objParent = objParent.offsetParent;
    }
    return oPosition;
} 

function hideSelect() 
{ 
    var selects = document.getElementsByTagName("Select"); 
    for(var i=0;i<selects.length;i++) 
    {
        selects[i].style.display="none";
    } 
} 

function showSelect() 
{ 
    var selects = document.getElementsByTagName("Select"); 
    for(var i=0;i<selects.length;i++) 
    {
        selects[i].style.display="";
    } 
} 

function setCookie(name,value)
{
  var Days = 1; //此 cookie 将被保存 1 天
  var exp  = new Date();    //new Date("December 31, 9998");
  exp.setTime(exp.getTime() + Days*24*60*60*1000);
  document.cookie = name + "="+ escape(value) +";expires="+ exp.toGMTString();
}

function getCookie(name)
{
  var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
  if(arr != null) return unescape(arr[2]); return null;
}

function delCookie(name)
{
  var exp = new Date();
  exp.setTime(exp.getTime() - 1);
  var cval=getCookie(name);
  if(cval!=null) document.cookie=name +"="+cval+";expires="+exp.toGMTString();
}

//判断是否数组
function isArray(obj)
{   
  if(obj.constructor == window.Array)   
    return true;
  else   
    return false;
}
//-->
