/*******************Gestion de transparance********************/
// JavaScript Document
// PNG fix

$(document).ready(function() {

	if( $.browser.msie && ($.browser.version == "6.0") ) {
		DD_belatedPNG.fix('#header h1, .bloc-reperes, .list-onglets-pictos li a img, #sidebar-left-in h2, .bloc-v-avez-projet li a img, form .recherche-aide img, .list-aide-result-left img');
	}

	/*if( $(".reduire a").length && $(".agrandir a").length) {
		// Cookie
		var reload = $.cookie("reload");
		// Calling cookie
		if(reload) {
			document.getElementById("content-page").style.fontSize = reload;
		}
		var Ech = new Array("0%", "10%", "25%", "40%", "55%", "70%", "85%", "100%", "115%", "130%", "145%", "160%", "175%", "190%", "220%");
		if(reload)
			Cpt = $.inArray(reload, Ech);
		else
			Cpt = 4;
		$(".reduire a").click(function(){
			if(Cpt > 0) {
				Cpt--;
					document.getElementById("content-page").style.fontSize = Ech[Cpt];
			}
			$.cookie("reload",Ech[Cpt]);

			return(false);
		});
		$(".agrandir a").click(function(){
			if(Cpt < (Ech.length-1)) {
				Cpt++;
					document.getElementById("content-page").style.fontSize = Ech[Cpt];
			}
			$.cookie("reload",Ech[Cpt]);
			return(false);
		});
	}*/

	// ligthbox pour les images
	$('.lienLigthBox').lightBox({ txtImage:				'Image',
								txtOf:					'de',
								imageLoading:			'/extension/europe_en_france/design/europe_en_france/images/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
								imageBtnPrev:			'/extension/europe_en_france/design/europe_en_france/images/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image
								imageBtnNext:			'/extension/europe_en_france/design/europe_en_france/images/lightbox-btn-next.gif',			// (string) Path and the name of the next button image
								imageBtnClose:			'/extension/europe_en_france/design/europe_en_france/images/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
								imageBlank:				'/extension/europe_en_france/design/europe_en_france/images/lightbox-blank.gif'	});
});
/**********************System onglets************************/
$(function(){
    $(".switch_onglets .content_onglet").hide();
    $(".switch_onglets .content_onglet:eq(0)").show();

	// Idem pour les projets dans le 2�me onglet
	$(".switch_onglets #content_onglet_projets .content_onglet_projet").hide();
	$(".switch_onglets #content_onglet_projets .content_onglet_projet:eq(0)").show();
});

$(function(){
    $(".switch_onglets ul.list-onglets a").click(function(){
		$(".switch_onglets ul.list-onglets li a").removeClass('activated');
		$(this).addClass('activated');
        $(".switch_onglets .content_onglet").hide();
        $("."+this.rel).show();
		this.blur();
        return false;
    });

	// Projets dans le 2�me onglet
	$(".switch_onglets #content_onglet_projets #content_onglet_projet_links a").click(function(){
		$(".switch_onglets #content_onglet_projets #content_onglet_projet_links li").removeClass('link-on');
		$(this).parent().addClass('link-on');
        $(".switch_onglets #content_onglet_projets .content_onglet_projet").hide();
        $("."+this.rel).show();
		this.blur();
        return false;
    });

	/*****POPIN*****/
	$(".link-popin").popin ({
		width:621,
		height:450,
		opacity:.6,
		className:'searchPopin',
		onComplete: function(){
			$.extend($.fn.jScrollPane.defaults, {showArrows:true});
			$(".popin-content-bloc").css('height', "414px");
			$(".popin-content-bloc").jScrollPane();
		}
	});

	/***********menu_gauche************/

//	$("ul.menu-left ul:not('.menu-open-at-load')").hide();
//	/*$("li.toggle-sub-menu span").each( function () {
//		var TexteSpan = $(this).text();
//		$(this).replaceWith('<a href="" title="Afficher le sous-menu" class="link-menu-contact">' + TexteSpan + '</a>') ;
//	} ) ;*/
//	$('.menu-open-at-load').prev("a").attr("title", "Masquer le sous-menu");
//	$("li.toggle-sub-menu > a").click( function () {
//		if ($(this).next("ul.menu-left ul:visible").length != 0) {
//			$(this).next("ul.menu-left ul").slideUp("slow", function() {
//				$(this).parent().removeClass("menu-open");
//				//$(this).prev("a").attr("title", "Afficher le sous-menu");
//			});
//			$(".menu-open a").attr("title", "Masquer le sous-menu");
//		}
//		else {
//			$("ul.menu-left ul").slideUp("slow", function () {
//			$(this).parent().removeClass("menu-open") } );
//			$(this).next("ul.menu-left ul").slideDown("slow", function () {
//				$(this).parent().addClass("menu-open");
//				$(this).prev("a").attr("title", "Masquer le sous-menu");
//			});
//			//$(".menu-open a").attr("title", "Afficher le sous-menu");
//		}
//		return false;
//	});
	/***********************************************************************/
	$("div.list-axes ul li div.content-s-list:not('.menu-open-at-load')").hide();
	/*$("li.toggle-sub-menu span").each( function () {
		var TexteSpan = $(this).text();
		$(this).replaceWith('<a href="" title="Afficher le sous-menu" class="link-menu-contact">' + TexteSpan + '</a>') ;
	} ) ;*/
	$('.menu-open-at-load').prev("div.header-axes").children("a").attr("title", "Masquer le sous-menu");
	$("li.toggle-sub-menu > div.header-axes > a").click( function () {
		if ($(this).parent('div.header-axes').next("div.list-axes ul div.content-s-list:visible").length != 0) {
			$(this).parent('div.header-axes').next("div.list-axes ul div.content-s-list").slideUp("slow", function() {
				$(this).parent().removeClass("menu-open");
				//$(this).prev("a").attr("title", "Afficher le sous-menu");
			});
			$(".menu-open a").attr("title", "Masquer le sous-menu");
		}
		else {
			$("div.list-axes ul div.content-s-list").slideUp("slow", function () {
			$(this).parent().removeClass("menu-open") } );
			$(this).parent('div.header-axes').next("div.list-axes ul div.content-s-list").slideDown("slow", function () {
				$(this).parent().addClass("menu-open");
				$(this).prev("div.header-axes").children("a").attr("title", "Masquer le sous-menu");
			});
			//$(".menu-open a").attr("title", "Afficher le sous-menu");
		}
		return false;
	});
});



