function verContactar(){
Ext.onReady(function(){
	Ext.QuickTips.init();
	Ext.form.Field.prototype.msgTarget = 'side';



	var contactar = new Ext.FormPanel({
		labelWidth:60,
		labelAlign: 'right',
		url:'enviarContacto.php',
		frame:true,
		width:600,
		height:500,
		// Specific attributes for the text fields for username / password.
		// The "name" attribute defines the name of variables sent to the server.
		items: [{
			layout:'column',
			items:[{
				columnWidth:.5,
				layout: 'form',
				items: [{
					xtype:'textfield',
					fieldLabel: 'Nombre',
					name: 'contactoNombre',
					allowBlank: false,
					anchor:'94%',
					style:'margin-bottom: 3px'
				}, {
					xtype:'textfield',
					fieldLabel: 'Apellido',
					name: 'contactoApellido',
					allowBlank: false,
					anchor:'94%',
					style:'margin-bottom: 3px'
				}, {
					xtype:'textfield',
					fieldLabel: 'Empresa',
					name: 'contactoEmpresa',
					anchor:'94%',
					style:'margin-bottom: 3px'
				}]
			},{
				columnWidth:.5,
				layout: 'form',
				items: [{
					xtype:'textfield',
					fieldLabel: 'Teléfono',
					name: 'contactoTelefono',
					anchor:'94%',
					style:'margin-bottom: 3px'
				}, {
					xtype:'textfield',
					fieldLabel: 'Celular',
					name: 'contactoCelular',
					anchor:'94%',
					style:'margin-bottom: 3px'
				}, {
					xtype:'textfield',
					fieldLabel: 'E-mail',
					vtype:'email',
					name: 'contactoEmail',
					anchor:'94%',
					allowBlank: false,
					style:'margin-bottom: 3px'
				}]
			}]
		},{
			xtype:'textarea',
			name: 'contactoMensaje',
			fieldLabel:'Mensaje',
			height:120,
			allowBlank: false,
			anchor:'97%'
		}]
	});

	// This just creates a window to wrap the login form.
	// The login object is passed to the items collection.
	var win = new Ext.Window({
		layout:'fit',
		modal:true,
		title:'RMMB S.A. - Formulario de Contacto',
		width:600,
		height:300,
		closable: true,
		resizable: true,
		plain: true,
		items: [contactar],
		// All the magic happens after the user clicks the button
		buttons:[{
			text:'Enviar',
			formBind: true,
			// Function that fires when user clicks the button
			handler:function(){
				if ( contactar.form.isValid() ) {
					contactar.getForm().submit({
						method:'POST',
						waitTitle:'Contacatese',
						waitMsg:'Enviando Mensaje...',

						success:function(){
							Ext.Msg.alert('Estado', 'Mensaje enviado con exito!', function(btn, text){
								if (btn == 'ok'){
									win.hide();
								}
							});
						},

						failure:function(form, action){
							if(action.failureType == 'server'){
								obj = Ext.util.JSON.decode(action.response.responseText);
								Ext.Msg.alert('Login Failed!', obj.errors.reason);
							}else{
								Ext.Msg.alert('Warning!', 'Authentication server is unreachable : ' + action.response.responseText);
							}
							contactar.getForm().reset();

						}
					});
				}else{
					contactar.form.markInvalid();
					Ext.Msg.show({
						title:'RMMB S.A. - Contacto',
						msg: 'Por favor complete todos lo campos obligatorios.',
						buttons: Ext.Msg.OK,                   
						animEl: document.body
					});
				}
			}
		},{
				text:'Cancelar',
				handler:function(){
					win.hide();
				}
			}]
	});

	win.show();


});
}
