/* _____________________________________________ fonctions générales à tout le site ___________________________________________________*/

function set_langue( langue, redirection, local)
{
	var expcookies =new Date();
	expcookies.setDate(expcookies.getDate()+730);

	if(local) EcrireCookie( local, langue, expcookies, '/');
	else EcrireCookie( 'c_id_trad', langue, expcookies, '/');
	self.top.location.href = redirection;

}

$(document).ready(function () {
	/*
	$('.wrapper_right .bloc_coremenulist .bloc_coremenu ul').hide();
	$('.wrapper_right .bloc_coremenulist .bloc_coremenu h2').data('over', false);
	$('.wrapper_right .bloc_coremenulist .bloc_coremenu h2').hover(
		function(){
			$(this).parent().find('ul').show();
			$(this).addClass('act');
			$(this).parent().css('z-index', 15);
		},
		function(){				
		}
	);
	$('.wrapper_right .bloc_coremenulist .bloc_coremenu ul').hover(
		function(){				
		},
		function(){
			if($(this).parent().parent().parent().find('h2').attr('class') == 'act')
			{
				$(this).hide();
				$(this).parent().parent().parent().find('h2').removeClass('act');
				$(this).parent().parent().parent().css('z-index', 10);		
			}
		}
	);
	*/
	
	//__ on force le reload du captcha
	$('.captcha img').each(
		function(i)
		{
			$(this).attr("src",config_absolute_path+"core/marker/captcha.php?tps="+(new Date()).getTime());
		}
	);

	//___ on cache les déroulants JQUERY
	$('.selectbox ul').hide();
	
	$('.bloc_select ul li').hover(
		function()
		{	
			$(this).find('.selectbox').show();
			$(this).find('.selectbox ul').show();
			$(this).parent().parent().css('z-index', 150);
		},
		function()
		{
			$(this).find('.selectbox').hide();
			$(this).find('.selectbox ul').show();
			$(this).parent().parent().css('z-index', 100);
		}
	);
	
	
	$('.selectbox_bt').hover(
		function()
		{	
			$(this).find('.selectbox ul').show();
			$(this).find('.selectbox ul').css('z-index', 150);
			$(this).css('z-index', 150);
		},
		function()
		{
			$(this).find('.selectbox ul').hide();
			$(this).find('.selectbox ul').css('z-index', 100);
			$(this).css('z-index', 100);
		}
	);
	//___ on cache les déroulants VIDE
	$(".selectbox_bt .selectbox:empty").each(function(i){
		$(this).hide();
		$(this).parent().parent().hide();
	});
	
	$(".gr_sst").hover(
		function(){
			$(this).css('cursor', 'pointer');
			var layer = $(this).parent().find(".sst_layer");
			if(!layer.attr('class')) layer = $("#sst_layer"+$(this).attr('id').substr($(this).attr('id').lastIndexOf('_')));
			layer.css('left', $(this).position().left + 7);
			layer.css('top', $(this).position().top - layer.outerHeight());
			layer.show();
		},
		function(){
			var layer = $(this).parent().find(".sst_layer");
			if(!layer.attr('class')) layer = $("#sst_layer"+$(this).attr('id').substr($(this).attr('id').lastIndexOf('_')));
				layer.hide();
		}
	);
	/*
	$(".organigramme .portrait:not(:empty)").each(function(i){
		$(this).hide();
		//$(this).parent().find('.detail_perso').append('<a class="icoportrait"><span>afficher la photo</span><span class="layer_portrait"></span></a>')
	});
	$(".organigramme .portrait:empty").each(function(i){
		$(this).parent().find('.icoportrait').hide();
	});
	
	$(".organigramme .detail_perso .icoportrait").hover(
		function()
		{	
			$(this).find(".layer_portrait").html($(this).parent().parent().find('.portrait').html());
			$(this).find(".layer_portrait").show();
			//$(this).parent().parent().find('.portrait').show();		
		},
		function()
		{
			$(this).find(".layer_portrait").html('');
			//$(this).parent().parent().find('.portrait').hide();		
		}
	);
	*/
	//déroulants météo
	$('.listPays .contentPays').hover(
		function()
		{
			$(this).css('cursor', 'pointer');
			$('.listPays .contentPays ul').show();
			/*$('.listPays .contentPays ul').css('z-index', 100);*/
			
		},
		function()
		{
			$('.listPays .contentPays ul').hide();
			
		}
	);
	
	$('.selectmap').hover(
		function()
		{
			$(this).css('cursor', 'pointer');
			$(this).find('.contentPays ul').show();
			/*$(this).find('.contentPays ul').css('z-index', 100);*/
			
		},
		function()
		{
			$(this).find('.contentPays ul').hide();
			
		}
	);
	
	$('.contentListPlages').hover(
		function()
		{
			$(this).css('cursor', 'pointer');
			$('.contentListPlages ul.paysPlage').show();
			/*$('.contentListPlages ul.paysPlage').css('z-index', 100);*/
			
		},
		function()
		{
			$('.contentListPlages ul.paysPlage').hide();
			
		}
	);
	
	$('.contentHomePlages').hover(
		function()
		{
			$(this).css('cursor', 'pointer');
			$('.contentHomePlages ul.paysPlage').show();
			/*$('.contentHomePlages ul.paysPlage').css('z-index', 100);*/
			
		},
		function()
		{
			$('.contentHomePlages ul.paysPlage').hide();
			
		}
	);
	
	$('.listactus').hover(
		function()
		{
			$(this).css('cursor', 'pointer');
			$(this).find('ul').show();
			/*$(this).find('ul').css('z-index', 100);*/
			/*$(this).css('z-index', 100);*/
		},
		function()
		{
			$(this).find('ul').hide();
			/*$(this).find('ul').css('z-index', 0);*/
			/*$(this).css('z-index', 0);*/
		}
	);

	$('.listcartesprecipit24h').hover(
		function()
		{
			$(this).css('cursor', 'pointer');
			$(this).find('ul').show();
			/*$(this).find('ul').css('z-index', 100);*/
			/*$(this).css('z-index', 100);*/
			
		},
		function()
		{
			$(this).find('ul').hide();
			/*$(this).find('ul').css('z-index', 0);*/
			/*$(this).css('z-index', 0);*/
			
		}
	);
	$('.listcartesextrem3j').hover(
		function()
		{
			$(this).css('cursor', 'pointer');
			$(this).find('ul').show();
			/*$(this).find('ul').css('z-index', 100);*/
			/*$(this).css('z-index', 100);*/
			
		},
		function()
		{
			$(this).find('ul').hide();
			/*$(this).find('ul').css('z-index', 0);*/
			/*$(this).css('z-index', 0);*/
			
		}
	);
	$('.listcartesextrem6j').hover(
		function()
		{
			$(this).css('cursor', 'pointer');
			$(this).find('ul').show();
			/*$(this).find('ul').css('z-index', 100);*/
			/*$(this).css('z-index', 100);*/
			
		},
		function()
		{
			$(this).find('ul').hide();
			/*$(this).find('ul').css('z-index', 0);*/
			/*$(this).css('z-index', 0);*/
			
		}
	);
	$('.listVille').hover(
		function()
		{
			$(this).css('cursor', 'pointer');
			$(this).find('.contentVilles').show();
			/*$(this).find('.contentVilles').css('z-index', 100);*/
			
		},
		function()
		{
			$(this).find('.contentVilles').hide();
			
		}
	);
	$('.selectAutresCartes').hover(
		function()
		{
			$(this).css('cursor', 'pointer');
			$(this).find('.contentAutresCartes').show();
			/*$(this).find('.contentAutresCartes').css('z-index', 100);*/
			
		},
		function()
		{
			$(this).find('.contentAutresCartes').hide();
			
		}
	);
	
	$('.selecthomecontinent').hover(
		function()
		{
			$(this).css('cursor', 'pointer');
			$('.contentContinent').show();
			/*$('.contentContinent').css('z-index', 100);*/
			
		},
		function()
		{
			$('.contentContinent').hide();
			
		}
	);
});

