// JavaScript Document
	$(document).ready(function() 
	{

			/* Javascript para validar Formularios */

			$("#form_recuperar").bind("submit", function(e)
			{
				/******************
				 *Config***********
				 ******************/
				
				
				var bgcolor = $(this).find('input[id=_bgcolor]').attr('value');
				if (bgcolor == null)
				{
					bgcolor = "#FAA109";
				}
				
				var fontcolor = $(this).find('input[id=_fontcolor]').attr('value');
				if (fontcolor == null)
				{
					fontcolor = "#FFFFFF";
				}

				/******************
				 *Filtros**********
				 ******************/
				var filtros = 
				{
					obligatorio:function(el) 
							   	{
									return ($(el).val() != '' && $(el).val() != -1);
							   	},
					numerico: function(el)
								{
									if (/^[0-9]*$/.test($(el).val()) && $(el).val() != "")
									{
										return true;
									}
									else
									{
										return false;
									}
								}
				}
				
				/******************
				 *CORE*************
				 ******************/
				 
				var aux = true;
				
				var password = $('#new_password').val();
				var confirma_password = $('#confirma_new_password').val();
				
				if (password.length < 6)
				{
					mensajeAlert ('La contrase&ntilde;a debe tener como m&iacute;nimo 6 caracteres');
					aux = false;
					$('#new_password, #confirma_new_password').css({"background":bgcolor, "color":fontcolor});
					$('#new_password, #confirma_new_password').focus(function()
					{
							$(this).val('');
							$(this).removeAttr("style");
							$(this).unbind('focus');
					});
				}
				else if (password != confirma_password)
				{
					mensajeAlert ('Error al confirmar la contrase&ntilde;a<br> Por favor verifique que sean iguales');
					aux = false;
					$('#new_password, #confirma_new_password').css({"background":bgcolor, "color":fontcolor});
					$('#new_password, #confirma_new_password').focus(function()
					{
							$(this).val('');
							$(this).removeAttr("style");
							$(this).unbind('focus');
					});
					
				}
				
				/*Si aux es false quiere decir que un filtro dio false*/
				if (!aux)
				{
					/*Paro el evento submit*/
					e.preventDefault();
					e.stopPropagation();
					return false;
				}
			});
		/*-------------------*/
		
		
	});
