  $(document).ready(function(){
  	
	$('#spamsource').html( '<div class="ctextarea" style="background:none; height:auto;">'+
		'<div id="captcha_here" style="float:left; width:140px; height:45px; font-size:10px !important;"></div>'+	
		'<div style="float:left;" id="captcha_plus"><a href="javascript:loadCaptcha()"><img src="captcha_files/refresh.gif" border="0" alt="(New)" /></a></div>'+
	'</div>');
	loadCaptcha();
							 
  });
  
  function loadCaptcha() {
  arrSTR = ($('#spamsource').attr('rel')).split('@');
  $("#captcha_plus").css("display","none");
  $("#captcha_here").html('Loading code...<br />Please wait...');
	$.get("captcha_files/captcha_table.php", { 'arrSTR[]' : arrSTR },
	  function(data){	
		$("#captcha_here").html(data);
		$("#captcha_plus").html('<a href="javascript:loadCaptcha()"><img src="captcha_files/refresh.gif" border="0" alt="(New)" /></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;
}