$(function() {
	
	$("#selectTheme").change( function() {
		$("#selectPays").hide();
		$("#selectAnnee").hide();
		$("#selectRealisateur").hide();
		switch(this.value) {
			case 'pays':
				$("#selectPays").show();
				this.form.elements['annee'].selectedIndex = 0;
				this.form.elements['realisateur'].selectedIndex = 0;
				break;
			case 'annee':
				$("#selectAnnee").show();
				this.form.elements['pays'].selectedIndex = 0;
				this.form.elements['realisateur'].selectedIndex = 0;
				break;
			case 'realisateur':
				$("#selectRealisateur").show();
				this.form.elements['pays'].selectedIndex = 0;
				this.form.elements['annee'].selectedIndex = 0;
				break;
		}
	} );
	
	$("#selectPays").change( function() { this.form.submit(); } );
	$("#selectAnnee").change( function() { this.form.submit(); } );
	$("#selectRealisateur").change( function() { this.form.submit(); } ); 

	var txtInvite = '-- Saisissez --';
	if (document.forms['rechercheLibre'].elements['texte'].value == '') document.forms['rechercheLibre'].elements['texte'].value = txtInvite;
	$("#Libre").click( function() {
		if (this.value == txtInvite) this.value = '';
	} );
	$("#Libre").blur( function() {
		if (this.value == '') this.value = txtInvite;
	} );
	$("#rechercheLibre").submit( function() {
		return (this.elements['texte'].value != txtInvite);
	} ); 
	
	
});
