
// var global qui stock le core JS
dfw = null;

// init du core
var initDfwCore = function() {
	
	dwf = new $.dfw();
	
	
	
	
};
//init
$(document).ready(function() {
	initDfwCore();
});

// base du core JS
$.dfw = function() {
	
	this.lastAjaxCall = null;
	this.lastAjaxReturn = null;
	
	
};


// les options...
$.dfw.options = {
	loadingDivName: '#loading',
	loadingDivHtml: '<div id="loading" style="position:absolute;"><img src="/images/loading.gif" alt="Chargement..." /></div>',
	
	infoDivName: '#infobox',
	infoDivDefaultText: 'Chargement en cours...'
	
		
};



// fonction d'affichage
$.dfw.draw = function() {	
};

// fonction de masquage
$.dfw.hide = function() {	
};

// afficahge de l'icone de loading sur cible
$.dfw.draw.loading = function(cible) {
	cible.prepend($.dfw.options.loadingDivHtml);
};
// masquer l'icone de loading
$.dfw.hide.loading = function() {
	$($.dfw.options.loadingDivName).remove();
};


$.dfw.draw.info = function(message) {
	if (message != '') {
		$($.dfw.options.infoDivName).children('div').html(message);
	}
	$($.dfw.options.infoDivName).animate({ 
		bottom: "0px"	
	},300,'swing');
};

$.dfw.hide.info = function(message) {
	$($.dfw.options.infoDivName).animate({ 
		bottom: "-38px"	
	},300,'swing',function() { 
		$(this).children('div').html($.dfw.options.infoDivDefaultText);
	});
};


$.dfw.ajaxAction = function(action,data,callback,type) {	
	$.post(action, data, callback, type);
};






