
$(document).ready(function(){
	centerPrecNext();
});

$(window).load(function(){
	centerImg();
	handleThemeLst();
	$('.galerie a').lightBox();
	if($.browser.msie==true&&$.browser.version<7){
		$('.galerie div.rounded').css({zoom:1});
	}
	$('.rounded, .roundedRight').css({position:'relative'});
});

function centerImg(){
	$('.galerie a img').each(function(){
		var w=Math.floor((128-$(this).width())/2)>=0?Math.floor((128-$(this).width())/2):0;
		var h=Math.floor((84-$(this).height())/2)>=0?Math.floor((84-$(this).height())/2):0;
		$(this).parent('a').css({'padding-left':w+'px','padding-top':h+'px'});
	});
}

function centerPrecNext(){
	var w=$('#precNext').width();
	var dispo=$('#precNext').parent('div').width();
	$('#precNext').css({'margin-left':((dispo-w)/2)+'px'});
}

function handleThemeLst(){
	$('#listeThemes').change(function(){
		location.href=pageCourante+'?theme='+$(this).val();
	});
}