var chemin = "images/";
var ext = ".jpg";
var liste_images = new Array('fond_bio','fond_eau','fond_fossile','fond_geo','fond_humain', 'fond_nucleaire', 'fond_solaire', 'fond_vent');
document.image_chargee = new Array();

function prechargement() {
	for ( i = 0; i < liste_images.length; i++ ) {
		document.image_chargee[i] = new Image;
		//alert(chemin + liste_images[i] + '_' + langue + ext);
		document.image_chargee[i].src = chemin + liste_images[i] + '_' + langue + ext;
	}
}

function getFlashMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}

function updateAtmosphere(id_atmosphere) {
	//alert(id_atmosphere);
	getFlashMovie('energymix_total/soundModule').updateAtmosphere(id_atmosphere);
	switch(id_atmosphere) {
		case 1: 
			document.getElementById("main").style.backgroundImage = 'url(images/fond_fossile_' + langue + '.jpg)';
			break;
		case 2: 
			document.getElementById("main").style.backgroundImage = 'url(images/fond_geo_' + langue + '.jpg)';
			break;
		case 3: 
			document.getElementById("main").style.backgroundImage = 'url(images/fond_bio_' + langue + '.jpg)';
			break;
		case 4: 
			document.getElementById("main").style.backgroundImage = 'url(images/fond_humain_' + langue + '.jpg)';
			break;
		case 5: 
			document.getElementById("main").style.backgroundImage = 'url(images/fond_eau_' + langue + '.jpg';
			break;
		case 6: 
			document.getElementById("main").style.backgroundImage = 'url(images/fond_vent_' + langue + '.jpg)';
			break;
		case 7: 
			document.getElementById("main").style.backgroundImage = 'url(images/fond_solaire_' + langue + '.jpg)';
			break;
		case 8: 
			document.getElementById("main").style.backgroundImage = 'url(images/fond_nucleaire_' + langue + '.jpg)';
			break;
	}
}

function changeStatusMix(status) {
	//alert(status);
	getFlashMovie("coverFlow/coverFlow").changeStatusMix(status);
}

function init() {
	document.getElementById("main").style.backgroundImage = 'url(images/fond_neutre_' + langue + '.jpg)';
	prechargement();
}

function skip_intro(txt) {
	document.getElementById('intro').style.display = 'none';
	document.getElementById('global').style.display = 'block';
}
function openPopUp(url, title, width, height) {
	var top = (screen.height - height) / 2;
	var left = (screen.width - width) / 2;
	window.open(url, title, 'width=' + width + ',height=' + height + ',top=' + top + ',left=' + left + ',scrollbars=no');
}
