

/**
 * @param {Object} url
 * @param {Object} param
 * @param {Object} callback
 */
function requestService(url, param, callback, async) {
	
	if(async){
		
		async = true;
	}
	
	$.ajax({
			url		: _WEB_CONTEXT_NAME +"/"+url
		  , data 	: encodeURI(param)
		  , cache	: false
		  , async 	: async
		  , type	: 'POST'
		  , success : callback
		  , error   : whenError
	});
}

/**
 * 
 * @param url
 * @param formName
 * @param callback
 * @param async
 */
function requestServiceForm(url, formName, callback, async) {
	 
	if(async){

		async = true;
	}

	$("#" + formName).ajaxSubmit({
			
			url		: _WEB_CONTEXT_NAME +"/"+url
		  , data 	: $(this).serialize()
		  , cache	: false
		  , async 	: async
		  , type	: 'POST'
	      , success : callback
	      , error   : whenError
	
	});
}
function whenError(){

	//console.log('ajax error');

}