function CheckIsNull(obj,alertmsg){
	obj.value=obj.value.trim();
	if (isEmpty(obj.value)){ 
		alert("请输入"+alertmsg)
		obj.focus();
		return false;
	}
	if (isCharsInBag(obj.value, "%';:[]@")){
		alert("包含的字符非法！");
		obj.focus();
		return false;
	}
}

function isEmpty(s){ 
	return ((s == null)||(s.length == 0)); 
}

String.prototype.trim = function(){
	return this.replace(/\s+/g, "" );
}

function isCharsInBag (s, bag)
{ 
	var i;
	
	for (i = 0; i < s.length; i++)
	{ 
		// Check that current character isn't whitespace.
		var c = s.charAt(i);
		if (bag.indexOf(c) > -1) return true;
	}
	return false;
}