function footerPosition()
{	
	if ($("#headline").size() == 1)
	{
		headlineSpacingHeight = $(window).height() - $("body").height() - $("#footer").height();
		if (headlineSpacingHeight > 0)
		{
			$("#footer-content").css("padding-bottom", headlineSpacingHeight);
		}
	}
}
	
	
$(document).ready(function(){
	
	
	
	// fixer la sidemenu
	if ($(document).width() < 1030)
	{
		$("#sidebar").addClass("sidebar-absolute");
	}
	
	footerPosition();
	
	$(window).resize(function(){
		
		
		
		if ($(document).width() < 1030)
		{
			$("#sidebar").addClass("sidebar-absolute");
		}
		else
		{
			$("#sidebar").removeClass("sidebar-absolute");
		}
		
		footerPosition();
		
	});
	
	// SIFR implementation
	if (!$.browser.safari)
	{
		if(typeof sIFR == "function"){
			
			if ($("#content h1").size() )
			{
				sIFR.replaceElement("h1", templateUrl + "/flash/qq2.swf", "#ffffff", null, null, "#3b4752", 0, 0, 0, 0, null);
				$(".sIFR-alternate").hide();
			}
			
			if ($("#content-page h2").size() )
			{
				sIFR.replaceElement("h2", templateUrl + "/flash/qq2.swf", "#cdcdc0", null, null, "#fff", 0, 0, 0, 0, null);
				
				if ($.browser.mozilla)
				{
					$("#content-page h2").css({marginLeft:"-12px"})
				}
				
				$(".sIFR-alternate").hide();
			}
			
		};
		
	}

	
	
	// suppression de la bordure du dernier element du sidemenu
	if ($("#sidemenu li").size())
	{
		$("#sidemenu li:last").css({background:"none"});
	}
	
	
	
	// Expand Collapse Examples of our work
	if ($("h3").size() >= 5)
	{
		
		$("table").hide();
		
		$("h3").toggle(function(){
			$(this).addClass("current");
			$(this).next("table").slideDown("slow");
			return false;
			
		}, function(){
			$(this).removeClass("current");
			$(this).next("table").slideUp("slow");
			return false;
		
		});
		
	}
	
	
	$(".carousel li p").hide();
	$(".carousel li object").hide();
	
	if(typeof sIFR != "function")
	{
		$(".carousel li object").prepend("<p class='small'>Preview not available:<br />please install the latest version of <a href='http://www.adobe.com/go/getflashplayer' class='external'>Adobe Flash Player</a>.</p>");
	}
	
	$(".carousel li ul").hide();
	

	
	$(".carousel a").not(".external").toggle(function(){
		
		$(this).parents("li").addClass("current");
		$(this).siblings().slideDown();
		return false;
		
	}, function(){
		$(this).parents("li").removeClass("current");
		$(this).siblings().slideUp();
		return false;
		
	});
	

	$("#internationalisation li:last").children("span").hide();
	
});


