var heightInter = 0;
function openNews(id){
	$("#fondNews").css("display","block");
	
	/*$("#fondNews").css("visibility","visible");
	$("#newsContainer").css("visibility","visible");*/
	$("#fondNews").fadeTo(1,.5);
	$("#news").fadeTo(1,0);
	$("#fondNews").height(0);
	$("#fondNews").animate({height:heightInter+"px"}, 200, "linear", function(data){
		$("#newsContainer").css("display","block");
		var launch = swfobject.getObjectById("flashparser");
		if(launch){
			if('function' == typeof(launch.getContentNews)) launch.getContentNews(id);
		}
		resizeNews();
		$("#news").fadeTo(200,1);
	});
}

function loadContent(id){
	var launch = swfobject.getObjectById("flashparser");
	if(launch){
		if('function' == typeof(launch.getContentNews)) launch.getContentNews(id);
	}
}

function closeNews(){
	$("#news").fadeTo(200,0, function(){
		$("#newsContainer").css("display","none");
		$("#news").html("");
		$("#fondNews").animate({height:"0px"}, 200, "linear", function(data){
			$("#fondNews").css("display","none");
			var launch = swfobject.getObjectById("flash");
			if(launch){
				if('function' == typeof(launch.closeNewsFlash)) launch.closeNewsFlash();
			}
		});
	});
	/*$("#fondNews").css("visibility","hidden");
	$("#newsContainer").css("visibility","hidden");*/
}

function loadNews(titre, date, description, next, prev){
	$.post("loadvars/news.php",{titre:titre, description:description, date:date, next:next, previous:prev},function(data){
		$("#news").html(data);
		CSBfleXcroll('mycustomscroll');
	});
}

//Au resize on resize les div de zoom des screenshots
$(window).resize(resizeNews);
$(document).ready(function(){
	heightInter = $(document).height();
});
function resizeNews(){
	heightInter = $(document).height();
	$("#fondNews").height($(document).height());
	if($.browser.msie && $.browser.version == "6.0") {
		$("#fondNews").width($(window).innerWidth());
		$("#newsContainer").height($(window).innerHeight());
		$("#newsContainer").width($(window).innerWidth());
	}else{
		$("#fondNews").width($(window).width());
		$("#newsContainer").height($(window).height());
		$("#newsContainer").width($(window).width());
	}
}

function openPage(page){
	$("#fondNews").css("display","block");
	$("#fondNews").fadeTo(1,.5);
	$("#news").fadeTo(1,0);
	$("#fondNews").height(0);
	$("#fondNews").animate({height:heightInter+"px"}, 200, "linear", function(data){
		$("#newsContainer").css("display","block");
		resizeNews();
		$.post(page,{},function(data){
			$("#news").html(data);
		});
		$("#news").fadeTo(200,1);
	});
}

function closePage(){
	$("#news").fadeTo(200,0, function(){
		$("#newsContainer").css("display","none");
		$("#news").html("");
		$("#fondNews").animate({height:"0px"}, 200, "linear", function(data){
			$("#fondNews").css("display","none");
		});
	});
}