(function($){ // info//{{{
	$.fn.info = function(text){
		var msg = "<div class=\"ui-widget\">";
		msg += "<div class=\"ui-state-highlight ui-corner-all\" style=\"padding: 0pt 0.7em;\">";
		msg += "<p><span class=\"ui-icon ui-icon-info\" style=\"float: left; margin-right: 0.3em;\"></span>";
		msg += "<strong>Info  : </strong> "+text+"</p>";
		msg += "</div></div>";
		$(this).html(msg);
		return this;
	};
})(jQuery);//}}}
(function($){ // alert //{{{
	$.fn.alert = function(msg){
		$(this).html(msg);
		$(this).attr('title',"Attention !");
		$(this).dialog({
			resizable: false,
			modal: true,
			buttons: {
				"Fermer": function() {
					$( this ).dialog( "close" );
				}
			}
		});
	};
})(jQuery);//}}}
(function($){ // confirm //{{{
	$.fn.confirm = function(msg, callback){
		$(this).html(msg);
		$(this).attr('title',"Attention !");
		$(this).dialog({
			resizable: false,
			modal: true,
			buttons: {
				"Valider": function() {
					if ($.isFunction(callback)) {
						callback.apply();
					}
					$( this ).dialog( "close" );
				},
				"Annuler": function() {
					$( this ).dialog( "close" );
				}
			}
		});
	};
})(jQuery);//}}}
(function($){ // center//{{{
	$.fn.center = function(){
		this.css("position","absolute");
		this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
		this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
		return this;
	}
})(jQuery);//}}}

$.ajaxSetup({'type':'POST', 'dataType':'json'}); 

var acms = {
	modules:{}
}

$(document).ready(function(){

	$("#loading").hide();
	$("#loading").center();
	$("#loading").ajaxStart(function(){ $(this).show(); });
	$("#loading").ajaxStop(function(){ $(this).hide(); });

	$.validator.setDefaults({
		errorPlacement: function(error, element) { error.appendTo( element.parent().next() ); }, 
		success:"ui-icon ui-icon-circle-check"
	});

});

