﻿function Trim(Str){	while(Str.charCodeAt(0)==32)	{		Str=Str.substr(1);	}	while (Str.charCodeAt(Str.length-1)==32)	{		Str=Str.substr(0,(Str.length-1));	}	return Str;
}//trim spaces with regular expression
String.prototype.trim = function()
{
	return this.replace(/(^\s*)|(\s*$)/g, "");
}//函数名：fucCheckNUM //功能介绍：检查是否为数字 //参数说明：要检查的数字 //返回值：false为是数字，true为不是数字 function fucCheckNUM(NUM) { var i,j,strTemp; strTemp="0123456789"; if ( NUM.length== 0) return 0 for (i=0;i<NUM.length;i++) { j=strTemp.indexOf(NUM.charAt(i)); if (j==-1) { //说明有字符不是数字 return true; } } //说明是数字 return false; }//计算字符串的位数，返回位数
//Count string byte number, return integer
String.prototype.ByteCount = function()
{
	txt = this.replace(/(<.*?>)/ig,"");
	txt = txt.replace(/([\u0391-\uFFE5])/ig, "11");
	var count = txt.length;
	return count;
}

//取浏览器值
function aa(source, name)
 {
    var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i");
    if (reg.test(source)) return RegExp.$2; return "";
 }
 
 //关闭退出信息
 function Close()
 {
    window.opener=null;
	top.close();
 }
 
//退出系统
 function CloseSystem()
 {
    alert("谢谢使用本系统");
    window.opener=null;
	top.close();
 }
