// JavaScript Document
function checkCaptcha(text, form, length, url) {  
    if (text.length < length ) return;  
	if(!this.http){  
		this.http = get_http();  
		this.working = false;  
	}  
	 if (this.http) {  // !this.working && 
		 var http = this.http;  
		 url = url + "?text="+encodeURIComponent(text) + "&form="+encodeURIComponent(form) + "&check=1";  
		 this.http.open("GET", url, true);  
		 this.http.onreadystatechange = function() {  
			 if (http.readyState == 4 ) {  
			 	if (http.responseText=='1') {
					document.getElementById('captcha').className='captcha_ok';
				 } else {
					document.getElementById('captcha').className='captcha_wrong';
				 }
					 
				 this.working = false;  
			   }else{  
			   }  
		 }  
		 this.working = true;  
		 this.http.send(null);  
	 }  
}  



 function get_http(){  
     var xmlhttp;  
     /*@cc_on 
     @if (@_jscript_version >= 5) 
         try { 
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
         } catch (e) { 
             try { 
                 xmlhttp = new  
                 ActiveXObject("Microsoft.XMLHTTP"); 
             } catch (E) { 
                 xmlhttp = false; 
             } 
         } 
     @else 
         xmlhttp = false; 
     @end @*/  
     if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {  
         try {  
            xmlhttp = new XMLHttpRequest();  
         } catch (e) {  
             xmlhttp = false;  
         }  
     }  
     return xmlhttp;  
 }  