


	var picture = {	height: 159, html: '<img src="login/security.png" />' }

	var form = new Ext.FormPanel({
		labelWidth: 80,
		frame: true,
		defaultType: 'textfield',
		items:[{
				fieldLabel: 'Contrase&ntilde;a',
				inputType: 'password',
				name: 'password',
				allowBlank: false
			}],
		buttons:[{
				text: 'Acceder',
				formBind: true,
				handler: function(){
					form.getForm().submit({
						url: 'login/process.php',
						method: 'POST',
						waitTitle: 'Validando',
						waitMsg: 'Validando contrase&ntilde;a...',
						success: function(){
							Ext.Msg.alert('&Eacute;xito','Contrase&ntilde;a validada correctamente, pulse OK para redirigir', function(btn,evt){
								if (btn == 'ok'){
									var redirect = 'login/success.php';
									window.location = redirect;
								}
							});
						},
						failure: function(){
							Ext.Msg.alert('Error','La validaci&oacute;n de datos ha fallado, vuelva a intentarlo');
							form.getForm().reset();
						}

					});
				}
			}]
	});

	var win = new Ext.Window({
		title: 'Manantiales 2.0 - Login',
		width: 300,
		height: 260,
		closable: true,
		resizable: false,
		plain: true,
		border: false,
		items: [picture,form]
	});

	function click(){
		win.show();
	}



