$(document).ready(function($){
	 
	$('#configurateur').cycle({
		fx:    'fade',
		timeout:500,
    	speed:  300 
	});
	$("div.switchcontent a").addClass("popup");
	
	$(".popup").click(function(){ 
    window.open($(this).attr("href")); 
    return false; 
	});
	
	//switchcontent
	$("#listSwitchContent .switchcontent").hide();
	$("#listSwitchContent .switchimage").hide();

	//toggle message_body
	$(".headers").click(function(){
	  $(this).next(".switchcontent").slideToggle(500);
	  $(".switchimage").css("z-index", "0");
	  $(this).siblings(".switchimage").fadeIn("slow").css("z-index", "100");
	  return false;
	});
	
	//collapse all messages
	$(".allExpand").click(function(){
	  $(".switchcontent").slideDown(500)
	  return false;
	});
	
	$(".allContract").click(function(){
	  $(".switchcontent").slideUp(500)
	  return false;
	});

	//Boutons du haut
	$("a.bt_1").hover(function() {
	  $("#bulle_1").animate({opacity: "show", top: "0"}, "slow");
	}, function() {
	  $("#bulle_1").animate({opacity: "hide", top: "-5"}, "fast");
	});
	$("a.bt_2").hover(function() {
	  $("#bulle_2").animate({opacity: "show", top: "0"}, "slow");
	}, function() {
	  $("#bulle_2").animate({opacity: "hide", top: "-5"}, "fast");
	});
	$(".bt_3").hover(function() {
	  $("#bulle_3").animate({opacity: "show", top: "0"}, "slow");
	}, function() {
	  $("#bulle_3").animate({opacity: "hide", top: "-5"}, "fast");
	});
	
	$("#pageflip").hover(function() { //On hover...
	$("#pageflip img , .msg_block").stop()
		.animate({ //Animate and expand the image and the msg_block (Width + height)
			width: '34px',
			height: '33px'
		}, 500);
	} , function() {
	$("#pageflip img").stop() //On hover out, go back to original size 50x52
		.animate({
			width: '10px',
			height: '12px'
		}, 220);
	$(".msg_block").stop() //On hover out, go back to original size 50x50
		.animate({
			width: '10px',
			height: '10px'
		}, 200); //Note this one retracts a bit faster (to prevent glitching in IE)
});
	
	$('a.lightbox').lightBox();

});
