$(function(){
	$("#refreshimg").click(function(){
		$.post('http://' + window.location.host + '/app/js/captcha/newsession.php');
		$("#captchaimage").load('http://' + window.location.host + '/app/js/captcha/image_req.php');
		return false;
	});
	
	$("#commentForm").validate({
		rules: {
			captcha: {
				required: true,
				remote: "http://" + window.location.host + "/app/js/captcha/process.php"
			}
		},
		messages: {
			captcha: "Merci d'indiquer un code correct. Cliquez sur le code pour en obtenir un nouveau."	
		}
	});
});