

/**
*	拼接context_path至url	
*/
function appendContextPath(url) {
	return CONTEXT_PATH + url;
}

Validate = new Object();

Validate.isInteger = function(v) {
	return /^[-+]?[\d]+$/.test(v);
}

Validate.isPositiveInteger = function(v) {
	return /^[\d]+$/.test(v);
}



/**
*	@author	danson
*/
function getEntityIds() {
	var jq = jQuery ? jQuery : $;
	var entityIds = new Array();
	jq("[name=entityIds]").each(function() {
		if (jq(this).attr("checked")) {
			entityIds.push(jq(this).val());
		}
	});
	return entityIds;
}


/**
*	@author	danson
*/
function getEntityId() {
	return getEntityIds()[0];
}

/**
*	@author	danson
*/
function checkEntitySelected() {
	var entityId = getEntityId();
	if (!entityId) {
		jAlert('请选择一条记录进行该操作！', "提示");
	}
	return entityId != void 0;
}
