  $(document).ready(function(){
  	
	loadCaptcha();
							 
  });
  
  function loadCaptcha() {
  $("#captcha_plus").css("display","none");
  $("#captcha_here").html('Loading code...<br />Please wait...');
	$.get("captcha_files/captcha_table.php", {  },
	  function(data){
		
		$("#captcha_here").html(data);
		$("#captcha_plus").html('<a href="javascript:loadCaptcha()"><img src="captcha_files/refresh.gif" border="0" alt="(New)" /></a>');
		//<br /><a href="captcha_sound.php"><img src="captcha_files/audio_icon.gif" border="0" alt="(Audio)" /></a>');
		$("#captcha_plus").css("display","block");
	});
   }
   
function testCaptcha(){
	var html = $.ajax({
	url: "captcha_files/testcaptcha.php",
	data: ({thecode : $("#spamcode").attr('value') }),//mycode}),
	async: false
	}).responseText;
	if(html == "success") return true;
	return false;
}


/*
function testCaptcha(mycode){
	test = false;
	$.get("captcha_files/testcaptcha.php",
		{ thecode : mycode } ,
		function(data){
			if(data=="success") {alert(data); test=true; }			
		}
	);
	return test;
}
*/
