Ext.onReady(function() {
				
	var comboRegions = Ext.create('Ext.form.field.ComboBox', {
		id: 'comboRegions',
		renderTo: "divRegion",
		typeAhead: true,
		triggerAction: 'all',		    
		width: 186,
		//ctCls: 'combo_recherche',
		displayField: 'nom',
		valueField: 'id',
		forceSelection: true,
		queryMode: 'local',//pas de rechargement si click sur le trigger
		autoLoad: false,
		store: Ext.create('Ext.data.Store', {
			proxy: {
				type: 'ajax',
				url: PARAM_URL + 'index.php?module=ajax&action=listerCategoriesFils&idParent=35&niveau=3&idUnivers='+idUnivers
		    },
		    fields: [
		        {name: 'id', mapping: 'id'},
		        {name: 'nom', mapping: 'nom'}                    
		    ]
	    }),
		listeners: {
			select: function(combo, record, index) {
				
				if (Ext.isEmpty(combo.getValue())) {
					comboDepartements.clearValue();
					comboDepartements.disable();
					comboVilles.clearValue();
		    		comboVilles.disable();
		    		return;
		    	}
				
				comboDepartements.getStore().proxy.extraParams = {idParent: combo.getValue()};				
				comboDepartements.getStore().load({
				    scope: this,
				    callback: function(records, operation, success) {				    					    	
				    	comboDepartements.getStore().insert(0, {id: "", nom: "- - - - - - - - - - - - - - - - - - - -", parent: ""});
				    	comboDepartements.getStore().insert(0, {id: "", nom: "Département", parent: ""});
				    	//fix du bug du masque de chargement qui ne disparait pas
				    	comboDepartements.getStore().fireEvent('load');
				    	comboDepartements.enable();
				    	comboDepartements.select(0);
				    }
				});
		    }		    
		}			
	});
	comboRegions.getStore().load({
	    callback: function(records, operation, success) {
	    	comboRegions.getStore().insert(0, {id: "", nom: "- - - - - - - - - - - - - - - - - - - -", parent: ""});
    		comboRegions.getStore().insert(0, {id: "", nom: "Région", parent: ""});
    		comboRegions.select(0);
	    }
	});
		
	var comboDepartements = Ext.create('Ext.form.field.ComboBox', {
		id: 'comboDepartements',
		renderTo: "divDepartement",
		typeAhead: true,
		triggerAction: 'all',		    
		width: 186,		
		anchor: '100%',
		//ctCls: 'combo_recherche',
		displayField: 'nom',
		valueField: 'id',
		forceSelection: true,
		disabled: true,
		allowBlank: true,
		queryMode: 'local',//pas de rechargement si click sur le trigger
		store: Ext.create('Ext.data.Store', {
			proxy: {
				type: 'ajax',
				url: PARAM_URL + 'index.php?module=ajax&action=listerCategoriesFils&niveau=4&idUnivers='+idUnivers
			},
			fields: [
			    {name: 'id', mapping: 'id'},
		        {name: 'nom', mapping: 'nom'}                    
		    ]
	    }),
	    listeners: {
	    	select: function(combo, record, index) {
	    		
	    		if (Ext.isEmpty(combo.getValue())) {
		    		comboVilles.clearValue();
		    		comboVilles.disable();
		    		return;
		    	}
	    		
	    		comboVilles.getStore().proxy.extraParams = {idCategorie: combo.getValue()};				
	    		comboVilles.getStore().load({
				    scope: this,
				    callback: function(records, operation, success) {
				    	comboVilles.getStore().insert(0, {ville: "- - - - - - - - - - - - - - - - - - - -"});
				    	comboVilles.getStore().insert(0, {ville: "Ville"});
				    	//fix du bug du masque de chargement qui ne disparait pas
				    	comboVilles.getStore().fireEvent('load');
				    	comboVilles.enable();
				    	comboVilles.select(0);
				    }
				});
		    }
		}
	});
	
	var comboVilles = Ext.create('Ext.form.field.ComboBox', {
		id: 'comboVilles',
		renderTo: "divVille",
		typeAhead: true,
		triggerAction: 'all',		    
		width: 186,		
		//ctCls: 'combo_recherche',
		displayField: 'ville',
		valueField: 'ville',
		forceSelection: true,
		disabled: true,
		allowBlank: true,
		queryMode: 'local',//pas de rechargement si click sur le trigger
		store: Ext.create('Ext.data.Store', {				
			proxy: {
				type: 'ajax',
				url: PARAM_URL + 'index.php?module=ajax&action=listerVilles&typeAffichage=nu&idUnivers='+idUnivers
			},
			fields: [
			    {name: 'ville', mapping: 'ville'},
		        {name: 'nb', mapping: 'nb'}                    
		    ]
	    }),
	    listeners: {
	    	select: function(combo, record, index) {
	    		//choixAjaxRegion();
		    }
		}
	});
	
	var dateDepartPicker = Ext.create('Ext.form.field.Date', {
		id: "pickerDateDepart",
		renderTo: 'dateDepart',
        anchor: '100%',
        name: 'dateDepart',
        width: 84,
        minValue: new Date()
    });
	
	var comboDureeLocation = Ext.create('Ext.form.field.ComboBox', {
		id: "comboDureeLocation",
		typeAhead: true,
	    transform: 'duree',
	    width: 96,
	    forceSelection: true
	});
	
	var comboCapacite = Ext.create('Ext.form.field.ComboBox', {
		id: "comboCapacite",
		typeAhead: true,
	    transform: 'capacite',
	    width: 186,
	    forceSelection: true
	});
	
	var comboTypeLocation = Ext.create('Ext.form.field.ComboBox', {
		id: "comboTypeLocation",
		typeAhead: true,
	    transform: 'typeLocation',
	    width: 186,
	    forceSelection: true
	});
	
	var slider = Ext.create('Ext.slider.Single', {
		id: "slider",
        renderTo: 'custom-slider',
        hideLabel: true,
        width: 180,
        increment: 20,
        minValue: 0,
        maxValue: 2000,
        tipText: function(thumb){
            var str = thumb.value + " €";
        	return str;
        },
        listeners: {
        	changecomplete: function(slider, newValue, thumb) {
        		//to do : afficher valeur courante
        	}
        }
    });
});
