$(document).ready(function(){
	$(".jstoggle h2").click(function(){
		$(this).next(".jsclose").slideToggle();
	});
	$(".taperici").taperici();
});

$(document).ready(function(){
	$(".slideshow").newsticker();
});

/* Remplacement des polices flash */

var flashfont = {
	src: fontpath
	,ratios: [8,1.3,11,1.22,12,1.2,18,1.19,23,1.15,25,1.14,28,1.13,39,1.12,61,1.11,94,1.1,95,1.09,103,1.1,107,1.09,110,1.1,119,1.09,120,1.1,1.09]
};

sIFR.delayCSS  = true;
sIFR.activate(flashfont);

sIFR.replace(flashfont, {
	selector: '.content-full-accueil_principal .alaune h2'
	,css: [
		'.sIFR-root { color:#08273F; font-size:21px; font-weight:bold; }'
	]
	,wmode: 'transparent'
});

sIFR.replace(flashfont, {
	selector: '.content-nav-formations h2'
	,css: [
		'.sIFR-root { color:#FFFFFF; font-size:15px; font-weight:bold; text-transform:uppercase;}'
	]
	,wmode: 'transparent'
});

/*
// non fonctionnel sous IE lorsqu'on déplie les éléments
sIFR.replace(flashfont, {
	selector: '.blue_column h2'
	,css: [
		'.sIFR-root { color:#08273F; text-transform:uppercase; font-size:10px; font-weight:bold; }'
	]
	,wmode: 'transparent'
});
*/

sIFR.replace(flashfont, {
	selector: '.accroche_link h2'
	,css: [
		'.sIFR-root { color:#08273F; font-size:20px; font-weight:bold; text-align:right;}'
	]
	,wmode: 'transparent'
});

sIFR.replace(flashfont, {
	selector: '.sites-thematiques h2'
	,css: [
		'.sIFR-root { color:#08273F; font-size:18px; font-weight:bold;}'
	]
	,wmode: 'transparent'
});

sIFR.replace(flashfont, {
	selector: '.anciens .anciens_title h2'
	,css: [
		'.sIFR-root { color:#FFFFFF; font-size:24px; font-weight:bold;}'
	]
	,wmode: 'transparent'
});

sIFR.replace(flashfont, {
	selector: '.international .international_title h2'
	,css: [
		'.sIFR-root { color:#FFFFFF; font-size:24px; font-weight:bold;}'
	]
	,wmode: 'transparent'
});

sIFR.replace(flashfont, {
	selector: '.recherche .recherche_title h2'
	,css: [
		'.sIFR-root { color:#FFFFFF; font-size:24px; font-weight:bold;}'
	]
	,wmode: 'transparent'
});
  
sIFR.replace(flashfont, {
	selector: '.pageint .page_title h2'
	,css: [
		'.sIFR-root { color:#08273F; font-size:26px; font-weight:bold;}'
	]
	,wmode: 'transparent'
});

// hide and seek pour le custom tag "encadre dépliable"
$(document).ready(function(){
	var hasHide = function(){
		$("> h4, > div.hideAndSeekDetails", this).removeClass("more").addClass("less");
	};
	var hasShow = function(){
		$("> h4, > div.hideAndSeekDetails", this).removeClass("less").addClass("more");
	};
	var hasClick = function(event){
	    var $tgt = $(event.target);
	    var $this = $(this);
	    if ($tgt.is("span")) {
	    	if ($tgt.is(".less")){
    			$this.trigger("hide");
	    	} else if ($tgt.is(".more")){
    			$this.trigger("show");
	    	}
	    }
	};
	$("div.hideAndSeek")
		.find("> h4")
			.wrapInner("<div />")
			.addClass("less")
		.end()
		.find("> div.hideAndSeekDetails")
			.addClass("less")
		.end()
		.filter(function(){
			return $("> div.hideAndSeekDetails", this).length > 0;
		})
			.find("> h4")
				.find("> div")
					.append("<span class='less'>-</span>")
					.append("<span class='more'>+</span>")
				.end()
			.end()
		.end()
		.bind("show", hasShow)
		.bind("hide", hasHide)
		.bind("click" ,hasClick)
		.filter(".active")
			.trigger("show")
		.end();
});