
//
// ------------------------------------------
// EXECUTION AU CHARGEMENT
// ------------------------------------------
//

var listImagesToCharge = [
	"img/Background_middle.gif",
	"img/cave.jpg",
	"img/coupe_champagne.jpg",
	"img/Plan-Acces-Les-Riceys.gif",
	"img/pupitre.jpg",
	"img/adrmail.gif",
	"img/coupe_champagne.jpg",
	"img/gamme_tabourin.jpg",
	"img/photos_1_min.jpg",
	"img/photos_2_min.jpg",
	"img/photos_3_min.jpg",
	"img/photos_4_min.jpg",
	"img/photos_5_min.jpg"
];

// Premier chargement

 //Lorsque que le document est chargé
$(document).ready(function() {
	document.body.style.backgroundImage = "none";
	$("div#divtable").css({display : "none"});
	$("div#chargementglobal").css({display : "block"});
	
	$("p#chargementInfotextStatus").text('0 %');
	
	var iImg = 0;
	var listImgInDoc = new Array();

	// Liste des images du document
	$("img").each( function (i) {
		if ($(this).attr("src") != '') {
			listImgInDoc[iImg] = $(this).attr("src");
			iImg = iImg + 1;
		}
	});	
	
	// On rassemble les deux listes d'images
	listImagesToCharge = $.merge(listImgInDoc, listImagesToCharge);
	//alert(listImagesToCharge.length);
	
	// On appelle la fonction du framework qui charge les images en affichant la progression dans le statusPourcent
	chargementImg(listImagesToCharge, -1, null, 1, "p#chargementInfotextStatus", function() {

		$("div#chargementglobal").fadeOut("fast", function () {
			document.body.style.backgroundImage = "url(img/Background_middle.gif)";
			$("div#divtable").fadeIn("slow", function() {
				afficherInfoBulle("infobulle");
			
			});
		});

	}); 
	
 });

// Lecteur MP3

var attributes = {};
var flashvars = {};

var params = {
  quality: "high",
  wmode: "transparent",
  allowScriptAccess: "sameDomain",
  bgcolor: "E5E2C7"
};

swfobject.embedSWF("dewplayer.swf?mp3=music/fond.mp3&autostart=1&autoreplay=1&volume=50", "lecteurmp3", "200", "20", "9.0.0","expressInstall.swf", flashvars, params, attributes);
