//打开查看页面
function openPage(url,windowName){
	window.open(url,windowName,"depended=yes,toolbar=0,height=450,width=508,top=100,left=200,resizable=no");
}
//识别回车键
function autoAction(){
	 if (window.event.keyCode == 13){
	 	doSearch();
	 }
}	
//识别手机号码
function IsTelephone(obj)
{
	if (obj == "") return true;
	var pattern=/(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)|(^0{0,1}15[0-9]{9}$)/;
	
	if(pattern.test(obj))
	{
	return true;
	}
	else
	{
	return false;
	}
}
//识别数字
function checkOnlyNum(src,info)
{
	var value = src;
    for(var i=0;i<value.length;i++)
    {
        if(value.charCodeAt(i)<48||value.charCodeAt(i)>57)
        {
        	alert(info);
            return false;
            break;
        }
    }
    return true;
}
/**
* 去掉字符串的尾空格或tab字符
* @return 去掉尾空格或tab字符的字符串
* 用法 " abc ".rtrim()  -- 返回值为"abc"
*/
String.prototype.rtrim = function()
{
  return this.replace(/(\s+$)/g,"");
}

/**
* 去掉字符串的首空格或tab字符
* @return 去掉首空格或tab字符的字符串
* 用法 " abc ".ltrim()  -- 返回值为"abc"
*/
String.prototype.ltrim = function()
{
  return this.replace(/(^\s+)/g,"");
}	
