function newSCode(){
	document.getElementById('SCode').src="../extended/captcha/CaptchaSecurityImages.php?width=105&height=30&characters=6&from=DI&time="+((new Date()).valueOf());
}

var ajaxSecurityCode = new ajaxObject("../extended/captcha/CSControl.php","POST"); 

function inviaCommento(){
	ajaxSecurityCode.ajaxRequest('security_code='+encodeURIComponent(encodeURI(document.forms.commentform.security_code.value)),0,1);	
	inviaCommento2();
}
function inviaCommento2(){
	if(ajaxSecurityCode.AJAX.readyState < 4){var timer=setTimeout("inviaCommento2()",1)}else{
		response =ajaxSecurityCode.output;
		if(response=="ko"){
			openAlert("Il codice di sicurezza non &egrave; corretto");
		}else{
			document.forms.commentform.action=response;
			document.forms.commentform.submit();
		}
	}	
}
