/**
 * Elements de base de l'application
 * creation de plugin JQUERY
 * Plugin inclus  : 
 *  -> Traduction (fonction translate et langue)
 */

/**
 * Plugin TRADUCTION 
 * utilisation : 
 * -------------
 *   $.translate("index.tableau.de.langue");
 *   Ou
 *   $.langue("index.tableau.de.langue");
 * @param {string} index
 */
(function($){
	$.langue = function(index)
	{
		if (langue[index])
			return langue[index];
		else{
			return index;
		}
	};
	$.translate = function(index)
	{
		if (langue[index])
			return langue[index];
		else{
			return index;
		}
	}
})(jQuery);

/**
 * Plugin du core jquery
 * Rajoute des méthodes de test :
 * 	$.isArray();
 *  $.isObejct();
 *  $.isNumber();
 *  $.isString(); 
 *  $.isNull();
 *  $.isUndefined();
 *  isBoolean();
 */
(function($){
	$.isObject = function(o)
	{
		return (o && (typeof o === 'object' || $.isFunction(o))) || false;
	};
	$.isArray = function(o){
		 if (o) {
           return $.isNumber(o.length) && $.isFunction(o.splice);
        }
        return false;
	};
	$.isNumber= function(o) {
        return typeof o === 'number' && isFinite(o);
    };
	$.isString= function(o) {
        return typeof o === 'string';
    };
	$.isBoolean = function(o) {
        return typeof o === 'boolean';
    };
	$.isNull = function(o){
		return o === null;
	};
	$.isUndefined= function(o) {
        return typeof o === 'undefined';
    };
})(jQuery);

(function($){
	$.config = function(o)
	{
		var config = {
			image_loading: '<img src="/images/loading.gif" />',
			img_close_panel_16 : '<img src="/images/icone_close_16.gif" />'
		};
		
		return config[o];
	};
	
})(jQuery);
var global = {
	changePagerNbPage:function(){
		window.location.href= "/"+informations.module+"/"+informations.controller+"/"+informations.action+"/itemsparpages/"+this.value;
	}
	
};
