var captcha_form = null;
var captcha_submit = null;

function captcha_ajax(){
	var ajax
	try{ ajax = new XMLHttpRequest(); }
	catch(e){
		try{ ajax= new ActiveXObject("Msxm12.XMLHTTP"); }
		catch(e){
			try{ ajax = new ActiveXObject("Microsoft.XMLHTTP"); }
			catch(e) { ajax = "" }
		}
	}
	return ajax
}

function captcha_check(form){
	if (captcha_submit){return true;}
	captcha_form = form;
	var ajax = captcha_ajax()
		ajax.open('POST', '/asb/_include/captcha_check.asp', 'true');
		ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajax.setRequestHeader("Connection", "close");
		ajax.send("captcha=" + document.getElementById('captcha').value);
		ajax.onreadystatechange=function(){
			if(ajax.readyState == 4){
				if (ajax.responseText.length > 0) {
					document.getElementById('captcha_error').style.display = "block";
				}else{
					captcha_submit = true;
					captcha_form.submit()
				}
			}
		}
	return false;
}