;var recaptcha = function(zone) {

	$('#'+zone).each(function() {

		$('.captcha_reload', $(this)).click(function() {
			Recaptcha.reload();
		});

		$('.captcha_type', $(this)).click(function() {
			if($(this).hasClass('image')) {
				Recaptcha.switch_type('audio');
				$(this).text('Voir les mots');
			} else if($(this).hasClass('audio')) {
				Recaptcha.switch_type('image');
				$(this).text('Ecouter les mots');
			}
			$(this).toggleClass('image');
			$(this).toggleClass('audio');
		});

		$('.captcha_help', $(this)).click(function() {
			Recaptcha.showhelp();
		});

		$('.jsDisplayed', $(this)).show();
		$('.jsDeleted', $(this)).remove();
	});

	return {
		theme: 'custom',
		custom_theme_widget: zone,
		lang: 'fr'
	};

}

var handleInputFileExistant = function() {
	$('form .champ .saisie input[type=file]').change(function() {
		$('.inputFileExistant_conserver', $(this).parent()).attr('checked', false);
	});
}

var handleInputTextDefault = function(champ, defaut) {
	$(champ).focus(function() {
		var cssObj = {
			'font-style' : 'normal',
			'color' : '#000'
		}
		if($(this).val() == defaut) {
			$(this).css(cssObj);
			$(this).val('');
		}
	});

	$(champ).blur(function() {
		if($(this).val() == '') {	
			$(this).css('color','#666')		
					.val(defaut);
		}
	});
	$(champ).blur();
}

$(document).ready(function () {
	handleInputFileExistant();
});


