////////////////////////////////////////////////////////
// Common
////////////////////////////////////////////////////////
function serverPost(script, data, callback){
/*
	$.post( script, data, function( data ) {
		callback(true,data);
	}, "json").error(function(){
		callback(false,{});
	});
*/
	$.post( script, data, function( data ) {
		callback(true,data);
	}, "json").fail(function(){
		callback(false,{});
	});
};

////////////////////////////////////////////////////////
// Chart
////////////////////////////////////////////////////////
function waitMessage(message,title){	
	$("#msgModalGeneralConfirmBtn").hide();
	$("#msgModalGeneralCancelBtn").hide();
	$("#msgModalGeneralMessage").html(message);
	$("#msgModalGeneralTitle").html(title);
	$("#msgModalGeneral").modal('show');
}
function showMessage(message,title){	
	$( "#msgModalGeneralConfirmBtn").unbind( "click" );
	$("#msgModalGeneralConfirmBtn").click(function(){
		closeMessageWindow();
	});
	$("#msgModalGeneralConfirmBtn").html("OK");
	$("#msgModalGeneralConfirmBtn").show();
	$("#msgModalGeneralCancelBtn").hide();
	$("#msgModalGeneralMessage").html(message);
	$("#msgModalGeneralTitle").html(title);
	$("#msgModalGeneral").modal('show');
}
function showConfirmMessage(message,title,onConfirm){
	$("#msgModalGeneralConfirmBtn").html("SI");
	$("#msgModalGeneralConfirmBtn").show();
	$( "#msgModalGeneralConfirmBtn").unbind( "click" );
	$("#msgModalGeneralConfirmBtn").click(function(){
		onConfirm();
	});
	$("#msgModalGeneralCancelBtn").html("NO");
	$("#msgModalGeneralCancelBtn").show();
	$( "#msgModalGeneralCancelBtn").unbind( "click" );
	$("#msgModalGeneralCancelBtn").click(function(){
		closeMessageWindow();
	});	
	$("#msgModalGeneralMessage").html(message);
	$("#msgModalGeneralTitle").html(title);
	$("#msgModalGeneral").modal('show');
}
function closeMessageWindow(){
	$("#msgModalGeneral").modal('hide');
}