$(document).ready(function(){
	
	/* Script Accueil Carte */
	PaysHover();
	
	/* Corner */
	$("#Data").corner('round 20px cc:#CCCCCC tl bl');
		
	/* Hauteur Contenu */
	if(($("#Data").height()+40) < 240){
            $("#Data").height("165px");
            $("#InterneTable").height("164px");
            }

});

function PaysHover() {
			
	/* Language */
	$("#Accroche div").hide(); 
	$("#accroche_EN").show();	
	
	$("#Lang div").hide();
	$("#lang_EN").show();	

	/* Hover */
	$("#Pays > a").hover(function(){
		$(this).addClass("hover");
		$("#Europe > img").attr("src", "/en/technical/img/carte/"+$(this).text()+".gif");
		$("#Europe > img").attr("alt", $(this).text());
	},function(){
		$(this).removeClass("hover");
		var CarteActive = $("#Pays > a.active").text();
		if(CarteActive == ""){CarteActive = $(this).text();}
		$("#Europe > img").attr("src", "/en/technical/img/carte/"+CarteActive+".gif");
		$("#Europe > img").attr("alt", CarteActive);
	});

	/* Click */
	$("#Pays > a").click(
		function() {
			var divActif = $(this).text();
			$(".JSDiv").removeClass('jsDiv');
			
			$("#Pays > a").removeClass('active');
			$(this).addClass('active');
			$("#Lang").addClass("block");
			
			$("#Lang div").hide();
			$("#Accroche div").hide(); 
						
			$("#Lang #"+$(this).text()).show();
			
			$("#lang_EN").show();	
			$("#accroche_EN").show();
			
			$("#"+divActif).addClass("jsDiv");
						
			for(i = 0; i < $("#Lang #"+divActif+" ul.left > li").size(); i++ ) {
				hauteur = $("#Lang #"+divActif+" ul.left > li:nth("+i+")").height();
				$("#Lang #"+divActif+" ul.right > li:nth("+i+")").height(hauteur+1);
			}
		});
	
	/*hover gauche*/
	$("#Lang ul.left > li").hover(function(){
		var langText = "";
		var hauteur = 0;
		var indice = 0;
		
		langText = $(this).attr("class");
						
		if(langText != ""){
			$("#Accroche div").hide(); 
			$("#Lang div.TextHomePage").hide();
			
			$("#accroche_"+langText).show();					
			$("#lang_"+langText).show();		
		}
		
		$(this).addClass("hover");
		hauteur = $(this).height();
		for(i = 0; i < $("#Lang div.jsDiv ul.left > li").size(); i++ ) {
			if($("#Lang div.jsDiv ul.left > li:nth("+i+")").is('.hover')) {
				$("#Lang div.jsDiv ul.right > li:nth("+i+")").addClass('hover');
				$("#Lang div.jsDiv ul.right > li:nth("+i+")").height(hauteur);
				indice = i;
				break;
			}
		}			
		
		},function(){
			$("#Lang div.jsDiv ul.right > li").removeClass('hover');
			$(this).removeClass("hover");
			hauteur = $(this).height();				
			$("#Lang div.jsDiv ul.right > li:nth("+indice+")").height(hauteur+1);
			indice = 0;
					
		});

	/*hover droite*/
	$("#Lang ul.right > li").hover(function(){
		var langText = "";
		var hauteur = 0;
		var indice = 0;
		
		langText = $(this).attr("class");
		
		if(langText != ""){
			$("#Accroche div").hide(); 					
			$("#Lang div.TextHomePage").hide();
			
			$("#accroche_"+langText).show();
			$("#lang_"+langText).show();		
		}
		
		$(this).addClass("hover");
		for(i = 0; i < $("#Lang div.jsDiv ul.right > li").size(); i++ ) {
			if($("#Lang div.jsDiv ul.right > li:nth("+i+")").is('.hover')) {
				$("#Lang div.jsDiv ul.left > li:nth("+i+")").addClass('hover');
				hauteur = $("#Lang div.jsDiv ul.left > li:nth("+i+")").height();
				indice = i;
				break;
			}
		}
		$(this).height(hauteur);
				
		},function(){
			$("#Lang div.jsDiv ul > li").removeClass('hover');
			$(this).removeClass("hover");
			hauteur = $("#Lang div.jsDiv ul.left > li:nth("+indice+")").height();				
			$(this).height(hauteur+1);
			indice = 0;
		});	
		
}

