/* SlideShow */
$(document).ready(function(){
	$('#bandeausecondaire').jqFancyTransitions({ width: 980, height: 180 });
	$('#bandeausecondaire2').jqFancyTransitions({ width: 980, height: 180 });
	$('#bandeausecondaire61').jqFancyTransitions({ width: 980, height: 180 });
	$('#bandeausecondaire68').jqFancyTransitions({ width: 980, height: 180 });
	$('#bandeausecondaire117').jqFancyTransitions({ width: 980, height: 180 });
	$('#bandeausecondaire119').jqFancyTransitions({ width: 980, height: 180 });
	$('#bandeausecondaire121').jqFancyTransitions({ width: 980, height: 180 });
	$('#bandeausecondaire122').jqFancyTransitions({ width: 980, height: 180 });
	$('#bandeausecondaire128').jqFancyTransitions({ width: 980, height: 180 });
	$('#bandeausecondaire137').jqFancyTransitions({ width: 980, height: 180 });
	$('#bandeausecondaire144').jqFancyTransitions({ width: 980, height: 180 });
	$('#bandeausecondaire15552').jqFancyTransitions({ width: 980, height: 180 });
});

/* CodaSlider */
$().ready(function() {
	$('#coda-slider').codaSlider({
		dynamicTabs: false
	});
});
/* Toggle Unités de recherche */
$(document).ready(function(){

	//Hide (Collapse) the toggle containers on load
	$(".toggle_container").hide(); 

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$("h2.trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
		return false; //Prevent the browser jump to the link anchor
	});

});
/* Antispam Jquery */
$(document).ready(function(){
	$('a.mailto').each(function(){
		var email = $(this).attr('href');
		email = email.replace("_DOT_",".");
		email = email.replace("_AT_","@");
		email = email.replace("_DOT_",".");
		$(this).attr('href',""+email+"");
	});
});

/*
 * Ouverture d'un lien à partir d'un menu de selection
 */
function selectUrl ( select, target ) {

	if ( select.value != '') {
		if ( target != '' ) {
			window.open(select.value, target);
		}
		else {
			window.location.href=select.value;
		}
	}
}

/*
 * Efface le contenu d'un champs
 */
function clear_field(el, cnt){
	if(el.value==cnt){
		el.value='';
	}
}
function js_search(el,param){
	document.location = el.href+'/('+param+')/'+escape(document.getElementById('Search').value);
	return false;
}

function get2viewparam(form,el_id){
    var el = document.getElementById(el_id);
    form.action = form.action+'/('+el_id+')/'+escape(el.value)+'/';
}

