$(function(){
	$("#refreshimg").click(function(){
		$.post('newsession.php');
		$("#captchaimage").load('image_req.php');
		return false;
	});
	
	$("#commentForm").validate({
		rules: {
			captcha: {
				required: true,
				remote: "process.php"
			}
		},
		messages: {
			captcha: "Correct word is required. Click the picture to generate a new one"	
		},
		submitHandler: function() {
			this.form.submit();
		},
		success: function(label) {
			label.addClass("valid")
		},
		onkeyup: false
	});
	
});
