String.prototype.isNum=function()
{
var patrn=/^([0-9])+$/;   
if (!patrn.exec(this))
    return false;  
return true;  
};
String.prototype.isNull=function()
{
if(this==undefined||this==null||this.trim()=="")
	return true;
return false;  
};
String.prototype.matching=function(reg)
{
if(reg)
{
var patrn=reg;
if (!patrn.exec(this))
    return false;  
return true;
}
return false;
};
String.prototype.isNumber=function()
{
var patrn=/^([0-9])+(.)?([0-9])*$/;   
if (!patrn.exec(this))
    return false;  
return true;  
};
String.prototype.isEmail=function()
{
var patrn=/^([a-z.A-Z0-9_-])+(@)([a-zA-Z0-9_-])+([.a-zA-Z0-9_-])+(\.){1}(com|cn|net|org){1}$/;    
if (!patrn.exec(this))
    return false;  
return true; 	
};
String.prototype.isMobile=function()
{
var patrn=/^[0]{0,1}(13|15|18){1}[-]?(\d){9}$/;   
if (!patrn.exec(this))
    return false;  
return true;  	
};
String.prototype.isPhone=function()
{
var patrn=/^(\d){3,4}(-){1}(\d){7,8}$/;   
if (!patrn.exec(this))
    return false;  
return true;  	
};
String.prototype.isChinese=function()
{
var patrn=/^([\u4e00-\u9fa5]){2,4}$/;
if (!patrn.exec(this))
    return false;  
return true;  	
};
String.prototype.isBigChinese=function()
{
var patrn=/^([\u4e00-\u9fa5]){4,10}$/;
if (!patrn.exec(this))
    return false;  
return true;  	
};
var selectAllCheck=function(checkName)
{
  var obj=document.getElementsByName(checkName);
  if(obj)
  {
	 var len=obj.length;
	 for(var i=0;i<len;i++)
	 {
		obj[i].checked=true;		 
	 }
  }
};
var unSelectAllCheck=function(checkName)
{
  var obj=document.getElementsByName(checkName);
  if(obj)
  {
	 var len=obj.length;
	 for(var i=0;i<len;i++)
	 {
		obj[i].checked=false;		 
	 }
  }
};
var getSelectText=function(selectId)
{
var obj=getE(selectId);
if(obj&&obj.options.length>0)	
   {
     return obj.options[obj.selectedIndex].text;
	}
else
	{
	return "";
	}
};
var resetSelectByValue=function(selectId,optionValue)
{
  var obj=getE(selectId);
  var option="";
  if(obj)	
    {
	 var len=obj.options.length;
	 for(var i=0;i<len;i++)
	 {
		option=obj.options[i];
	    if(option.value==optionValue)
		    option.selected=true;
	 }		
	}	
};
var resetSelectByText=function(selectId,optionText)
{
  var obj=getE(selectId);
  var option="";
  if(obj)	
    {
	 var len=obj.options.length;
	 for(var i=0;i<len;i++)
	 {
		option=obj.options[i];
	    if(option.text==optionText)
		    option.selected=true;
	 }		
	}	
};
var getRadioValue=function(radioName)
{
var txt="";
var obj=getN(radioName);
if(obj)
{
	var objlen=obj.length;
	for(var i=0;i<objlen;i++)
	{
		if(obj[i].checked)
		  {
			  txt=obj[i].value;	
		  	  break;
		  }
	}
}
return txt;
};
var resetRadioByValue=function(radioName,radioValue)
{
var obj=getN(radioName);
if(obj)
{
	var objlen=obj.length;
	for(var i=0;i<objlen;i++)
	{
		if(obj[i].value==radioValue)
		  obj[i].checked=true;		
	}
}
};
var getCheckBoxValue=function(checkboxName)
{
var arr=new Array(); 
var txt="";
var obj=getN(checkboxName);
if(obj)
{
	var objlen=obj.length;
	for(var i=0;i<objlen;i++)
	{
		if(obj[i].checked)
		{
		  	arr.push(obj[i].value);
		}
	}
	txt=arr.join(";");
}
return txt;
};
var resetCheckBoxValue=function(checkboxName,txt)
{
var arr=txt.split(";");
var arrLen=arr.length;
if(arrLen>0)
{
	var j=0;
	var obj=getN(checkboxName);
	if(obj)
	{
		var objlen=obj.length;
		for(var n=0;n<arrLen;n++)
		{
			for(var i=j;i<objlen;i++)
			{
				if(obj[i].value==arr[n])
				{
					obj[i].checked=true;
					break;
				}
			}
			j=i;
		}
    }
}
};