sugerencies = function(){
	
	Ext.QuickTips.init();

	var descripcioPanel = {
		items:[{
			xtype: 'panel',
			title: 'Descripción',		
			name: 'desc',
			allowBlank:true,
			//width:390,
			anchor: '100%',
        	items : [{  
        		xtype: 'htmleditor',
        		name: 'desc',  
        		id: 'desc',
        		anchor: '100%',  
        		allowBlank : true  
        	}]			
		}]
	};
	
	var titolPanel = {
		items:[{
			xtype : 'panel',  
        	title : 'Titol',  
        	defaultType : 'textfield',  
        	autoHeight : true,  
        	autoWidth : true,
        	anchor: '100%',   
        	items : [{  
        		name: 'titol',  
        		id: 'titol',
        		anchor: '100%',
        		width:420,  
        		allowBlank : true  
        	}]
        }]		
	};
	
	var EnviaBoto = {  
        		xtype : 'fieldset',  
        		autoHeight : true,  
        		autoWidth : true,       
				buttons: [{
	                text: 'Enviar',			// literal
	                formBind: true,
	                handler: function()
	                {
	                    Formulari.getForm().submit({
	                        method: 'POST',
	                        waitTitle: JLI_Login_verificando,
	                        waitMsg: JLI_Login_verificando,
	
	                        success: function()
	                        {
                            Ext.Msg.alert('Enviado con éxito. Grácias.', 'Tu mensaje ha sido enviado al webmaster');
	                        sugerWin.close();
	                        },
	                        failure: function(form, action)
	                        // Pero si falla...
	                        {
	                            if (action.failureType == 'server')
	                            {
	                                //obj = Ext.util.JSON.decode(action.response.responseText);
	                                Ext.Msg.alert('Error comunicaciones', 'El servidor no responde. Intentalo de nuevo');
	                            }
	                            else
	                            {
	                                Ext.Msg.alert('Ouch!', 'el servidor no contesta : Prueba más tarde ' + action.response.responseText);
	                                // O bien si hubo algún error en el sistema
	                                sugerWin.close();
	                            }
	                        }
	                    });
	                }
	            	}]        		
        	};
	
  
	var Formulari = new Ext.FormPanel({
	    url: "sugerencies/sugerencies.php",  
        method : 'post', 
        items:[titolPanel,descripcioPanel,EnviaBoto]
	});
	
	var open = Ext.get('finestraSugerencies');  
	if (open == null){ 
		var sugerWin = new Ext.Window({
        	width: 500,  
            height: 490,  
            items: [Formulari],  
            resizable:false,
            title: 'Errores/Sugerencias/Preguntas',   // Literal
            iconCls : 'icon-unlock',
            id:'finestraSugerencies'
		});	     
		sugerWin.show()
	}else{
		Ext.Msg.alert(JLI_ERROR_Oops, JLI_ERROR_Finestra_oberta);
	}
     
};
