(function($)
{
	$(function() {
		
		$('#recaptcha_inputs a').click(function(e)
		{
			e.preventDefault();
			$p = $(this).parent();
			var $id = $p.attr('id');
			
			switch( $id )
			{
				case 'reload':
					Recaptcha.reload();
				break;
				
				case 'audio':
					Recaptcha.switch_type('audio');
					$p.attr('id', 'image');
				break;
				
				case 'image':
					Recaptcha.switch_type('image');
					$p.attr('id', 'audio');
				break;
			}
		});
		
		$('form#login_frm').submit(function(e) {
			$('input[name="recaptcha_challenge_field"]').val(Recaptcha.get_challenge());
		});
		
		$('#user').focus();
	});
	
})(jQuery);