/**
 * 验证控件值是否为空。如果为空，则弹出提示信息。如果focus为true，则光标焦点
 * 移动到控件上
 */
function checkElementEmpty(id, message, focus) {
	//去除字符串首位的空格
	var valueUse = $("#" + id).attr("value").replace(/(^\s*)|(\s*$)/g,"");
	//字符串长度大于0，说明字符串不为空
	if(valueUse.length > 0) {
		return true;
	}
	//空白字符串
	else {
		//显示提示信息
		if(message != undefined && message != null) {
			alert(message);
		}
		if(focus != undefined && focus == true) {
			$("#" + id).focus();
		}
		return false;
	}
	
}

/**
 * 验证Email是否符合格式
 */
function isEmail(email)
{
	var reg = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
    //var reg = new RegExp("^([0-9a-zA-Z]|[-_\.]){1,}@[0-9a-zA-Z\.]+$");
    return reg.test(email);
}
/**
 * 判断字符串是否为数字
 * @param {需要校验的字符串} digital
 */
function isDigital(digital) {
	var reg = new RegExp("^[0-9]+$");
    return (reg.test(digital));
}
