/*replicate the same captcha for all the forms on the same page*/
$(document).ready(function(){
	var captchas = $('input[rel="captcha"]');

	if(captchas.length)
	{
		var funcObj = function(){
			var items = captchas.get();
			var first = items.shift();
			//get the captcha for one form and replicate to the rest
			var markup = $('<img rel="captcha_image" src="/index.php?CAPTCHA=0"/>').bind('load',function(){
	    		var captcha = $('img[rel="captcha_image"]');
	    		// for each form with captcha, clone the same captcha before the input field
	    		jQuery.each(items,function(index, element){
	    		   $(element).before(captcha.clone(false));		
	    		});
	    	});	
	    	$(first).before(markup);	
		}
		setTimeout(funcObj, 1500);				
	}    		
});