$(document).ready(function(){
		$('li.headlink').hover(
			function() { $('ul', this).css('display', 'block'); },
			function() { $('ul', this).css('display', 'none'); });
		
		$("#satmos .m_elem").click( function(event){
  			$("#satmos .m_elem").removeClass("active"); 
  			$(this).toggleClass("active");
		});
		
		$("#satmos .langue").click( function(event){
  			$("#satmos .langue").removeClass("selected"); 
  			$(this).toggleClass("selected");
		});
	});


function adjustHeights(overide) {
	if (overide==true) {
		$('#content_actu').height(500);  
		$('#menu').height(475);
		$('#content_wrapper').height(590);
	}else{
		if ($('#content_middle').height() > 500) {
			middle=$('#content_middle').height();
			$('#content_actu').height(middle-80);  
			$('#menu').height(middle-100);
			left =$('#content_left').height();
			$('#content_wrapper').height(middle+20);
		}else{
			$('#content_actu').height(422);  
			$('#menu').height(400);	
			$('#content_wrapper').height(500);
		}
	}
	
}

function page_loading(url){
		$.post(url,function(data){
			$('#content_middle').text('');
			$('#content_middle').append(data);
			if (url=="pages/news/galerie.php") {
				adjustHeights(true);
			}else{
				adjustHeights(false);
			}
		});
}

function page_loading2(url,div){
	
		$("#"+div).text('');
		$.post(url,function(data){
			$("#"+div).append(data);
		});
}
