	/**
	* Clase Javascript para la sección
	**/
	
	var TLogin = new Class({
		initialize: function()
		{
			
			this.bound = {};
			this.IniciarEventos();	
		},			
		IniciarEventos: function()
		{				
			var oBotonSubmit = $('SubmitForm');
			         
	    	if (oBotonSubmit != null)
	    	{
	        	this.bound.SubmitForm = this.SubmitForm.bindWithEvent(this);
				oBotonSubmit.addEvent('click', this.bound.SubmitForm);
			}		
			
			var oUsuario = $('usuario');
			var oClave = $('clave');				
			
			if (oUsuario != null && oClave != null)
			{
			 
    			oUsuario.focus();
				this.bound.OnKeyPress = this.OnKeyPress.bindWithEvent(this);				
				oClave.addEvent('keypress', this.bound.OnKeyPress);
				oUsuario.addEvent('keypress', this.bound.OnKeyPress);
			}
		},
		
		/**
		* Evento click del botón enviar
		**/
		SubmitForm: function(event)
		{
			var oFormulario = $('FrmLogin');
			if (oFormulario != null)
			{
				oFormulario.bSubmit.value = 1;
				oFormulario.submit();
			}
		},
		
		OnKeyPress: function(event)
		{
		  	if (event.key == "enter") this.SubmitForm(event);
		}				
	});
	
	
	/** 
	* Evento lanzado al finalizar la carga
	***/
	
	window.addEvent('domready', function() 
		{		
			var oSeccion = new TLogin();
		}
	);
