$(function() {
	$("#menu ul").lavaLamp({
		fx: "backout",
		speed: 700
    });
});

function allocateSidebarHeight() {
	var contentDom = document.getElementById("content");
	var sidebarDom = document.getElementById("sidebar");
	var sidebar2Dom = document.getElementById("sidebar2");
	if (null != sidebarDom)
	// Page d'accueil : on a content + sidebar + sidebar2
	{
		if((contentDom.offsetHeight) > sidebarDom.offsetHeight) 
		{
			sidebarDom.style.height = (contentDom.offsetHeight)+"px";
			if((contentDom.offsetHeight) > sidebar2Dom.offsetHeight) 
			{
				sidebar2Dom.style.height = (contentDom.offsetHeight)+"px";
			}
			else 
			{
				contentDom.style.height = (sidebar2Dom.offsetHeight - 32)+"px";
				sidebarDom.style.height = (sidebar2Dom.offsetHeight)+"px";
			}
		}
		else 
		{
			contentDom.style.height = (sidebarDom.offsetHeight - 32)+"px";
			if((sidebarDom.offsetHeight) > sidebar2Dom.offsetHeight) 
			{
				sidebar2Dom.style.height = (sidebarDom.offsetHeight)+"px";
			}
			else 
			{
				contentDom.style.height = (sidebarDom.offsetHeight - 32)+"px";
				sidebar2Dom.style.height = (sidebarDom.offsetHeight)+"px";
			}
		}
	}
	else 
	// Article : on a post_data + content + sidebar2
	{
		var post_data = document.getElementById("post_data");
		if((contentDom.offsetHeight) > post_data.offsetHeight) 
		{
			post_data.style.height = (contentDom.offsetHeight)+"px";
			if((contentDom.offsetHeight) > sidebar2Dom.offsetHeight) 
			{
				sidebar2Dom.style.height = (contentDom.offsetHeight)+"px";
			}
			else 
			{
				contentDom.style.height = (sidebar2Dom.offsetHeight - 32)+"px";
				post_data.style.height = (sidebar2Dom.offsetHeight)+"px";
			}
		}
		else 
		{
			contentDom.style.height = (post_data.offsetHeight - 32)+"px";
			if((post_data.offsetHeight) > sidebar2Dom.offsetHeight) 
			{
				sidebar2Dom.style.height = (post_data.offsetHeight)+"px";
			}
			else 
			{
				contentDom.style.height = (sidebarDom.offsetHeight - 32)+"px";
				sidebar2Dom.style.height = (sidebarDom.offsetHeight)+"px";
			}
		}
	}
	
}


$(document).ready(function () {
	$('div.slidepress-gallery').each(function() {
		//var social = $('div.text').detach('div.social').eq(0);
		var social = $('div.text div.social').detach();
		social.insertAfter('div.slidepress-gallery');
	});
});






