var $j = jQuery.noConflict();

function refreshimg(){
		$j.post('inc/newsess.php');
		$j("#captchaimage").load('inc/img_req.php');
		return false;
}


$j(function(){
	$j("#refreshimg").click(function(){
		$j.post('inc/newsess.php');
		$j("#captchaimage").load('inc/img_req.php');
		return false;
	});
	
	$j("#captchaform").validate({
		rules: {
			captcha: {
				required: true,
				remote: "process.php"
			}
		},
		messages: {
			captcha: "Correct captcha is required. Click the captcha to generate a new one"	
		},
		submitHandler: function() {
			alert("Correct captcha!");
		},
		success: function(label) {
			label.addClass("valid").text("Valid captcha!")
		},
		onkeyup: false
	});
	
});

