(function($){ 
     $.fn.extend({  
         recaptcha_form: function() {       
            return this.each(function() {
            
				if($(this).data('recaptcha_form_applied'))
					return false;
                    
                $(this).data('recaptcha_form_applied', true);                
				
				$(this).find("input[type='submit']").before('<div class="recaptcha_field"></div>');
				
				$(this).submit(function(e) {		
					
					if($(this).data('recaptcha_field_applied'))
						return true;
						
					$("form.recaptcha_form").data('recaptcha_field_applied', false);
					$(this).data('recaptcha_field_applied', true);
					
					Recaptcha.destroy();
					Recaptcha.create("6LerjwEAAAAAAEh0RlJeAZNn-5atPIicli0yahXr", $(this).find('.recaptcha_field').get(0), {
						theme: "clean",
						callback: Recaptcha.focus_response_field
					});
				
					e.preventDefault();
					return false;
				});
				
				
            });
        } 
    });
})(jQuery);

$().ready(function () {
	$("form.recaptcha_form").recaptcha_form();
});

