// JavaScript Document

jQuery(function(){
	jQuery("#refreshCaptcha").click(function(){
		jQuery("#captcha").attr("src", "captcha/captcha.php?"+Math.random());
	});	
});

function compruebaCaptcha (form)
{
	jQuery.ajax({
		type: "POST",
		url: "captcha/captcha_comprueba.php",
		data: "codigo="+jQuery("#captchaCodigo").val(),
		success: function(datos){
			if(datos=="1")
			{
				jQuery(form).submit();
				return true;
			} else
			{
				alert("Los códigos no coinciden");
				jQuery("#captchaCodigo").css("background", "#eeeeee");
				return false;
			}
		}
	});
}

