/*
	一个汉字当成二个字符处理
*/
function conversion(str){
	return str.replace(/[^\x00-\xff]/g,'##').length
}

String.prototype.len=function()
{
	return this.replace(/[^\x00-\xff]/g,"**").length ;
}
String.prototype.trim = function()
{
	return this.replace(/(^\s*)|(\s*$)/g,"");
}
 String.prototype.Ltrim = function()
{
	return this.replace(/(^\s*)/g, "");
}
String.prototype.Rtrim = function()
{
	return this.replace(/(\s*$)/g, "");
}
//检查字符串是否以match结尾
String.prototype.endwith=function(match){
	var position=this.lastIndexOf(match);
	return position+match.length==this.length;
}
/*
	生成随机验证码的程序。
*/
	var verifyRandom=0; 
	function changeimg(){
		img=document.getElementById('verifyImg');
		img.src="../servlet/verimg.do?r="+verifyRandom++;
	}
function $(objId){
	return document.getElementById(objId);
}