/*
06/07/2009 20.22
$js = "window.addEvent('domready', function(){checkCaptcha('".$par1."'); })";
  function checkCaptcha(form) {
*/
//window.addEvent("domready",function(){
function checkCaptcha(form) {
	$('manda').setProperty('disabled', 'true');
	var box = $('console-container-plugin-capctha');
	var fx = box.effects({duration: 1000, transition: Fx.Transitions.Quart.easeOut});
            /*var fx=new Fx.Style($("console-container-plugin-capctha"), "background-color", {duration:2000});*/
            $("password3").addEvent("change",function(){
            	$('manda').setProperty('disabled', 'true');
            if ( $('password3').value.length > 0 ){
              
              /*$("console-container-plugin-capctha").empty().addClass("ajax-loading");*/
                /*var url="index.php?option=com_auser&amp;task=chkCaptcha&amp;format=raw&amp;password3="+this.getValue();*/
                var url="index.php?option=com_"+form+"&amp;task=chkCaptcha&amp;format=raw&amp;password3="+this.getValue();
                box.style.display="block";     
            		box.setHTML('Check in progress...');	 
                var a=new Ajax(url,{
                    method:"get",
                    onComplete: function(response){
                        var resp=Json.evaluate(response);
                       /* $("console-container-plugin-capctha").removeClass("ajax-loading").setHTML(resp.html);*/
                        if (resp.msg==='false'){
                         $("password3").value='';
                         $("password3").focus();
                           $('manda').setProperty('disabled', 'true');
                        }else{
                        	$('manda').removeProperty('disabled'); 
                        }
                        /*$("console-container-plugin-capctha").setHTML(resp.html);*/
                        fx.start({	
		                    	}).chain(function() {
		                    		box.setHTML(resp.html);
		                    		this.start.delay(1500, this, {'opacity': 0});
		                    	}).chain(function() {
		                    		box.style.display="none";
		                    		this.start.delay(1501, this, {'opacity': 1});
		                    	});	
              
                    }
                }).request();
              } //la if  
            });
        }
        
//  );
