// Popup
function popup(page,largeur,hauteur,options) {
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

// Visibilité
function visibilite(thingId) {
	var targetElement;
	targetElement = document.getElementById(thingId);
	
	if (targetElement.style.display == "none") {
		targetElement.style.display = "";
	} else {
		targetElement.style.display = "none" ;
	}
}

function show_flash_terre(){
	var code = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="175" data="./swf/terre/slide.swf">';
	code += '<param name="allowScriptAccess" value="sameDomain" />';
	code += '<param name="allowFullScreen" value="false" />';
	code += '<param name="movie" value="./swf/terre/slide.swf" />';
	code += '<param name="quality" value="high" />';
	code += '<param name="bgcolor" value="#000000" />';
	code += '<embed src="./swf/terre/slide.swf" quality="high" bgcolor="#000000" width="550" height="175" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	code += '</object>';
	document.getElementById('flash_terre').innerHTML = code;
}
/*function verifRe(){
	if( screen.width == 1280 && screen.height == 1024 ){
		document.getElementById('presse_window').style.top = "399px";
		document.getElementById('presse_window').style.left = "510px";
		
	}
	
	if( screen.width == 1280 && screen.height == 960 ){
		document.getElementById('presse_window').style.top = "399px";
		document.getElementById('presse_window').style.left = "490px";
	}
	
	if( screen.width == 800 && screen.height == 600 ){
		document.getElementById('presse_window').style.top = "399px";
		document.getElementById('presse_window').style.left = "390px";
	}
	if( screen.width == 1680 && screen.height == 1050 ){
		document.getElementById('presse_window').style.top = "399px";
		document.getElementById('presse_window').style.left = "690px";
		
	}
}*/
function ShowWindow(id){
	element = document.getElementById('r15_c6');
	element2 = document.getElementById('link_r15_c6');
	element.src = './images/index/r15_c6_2.png';
	$('#'+id).fadeIn("slow");
	/*document.getElementById('link_r15_c6').onclick = "HideWindow('presse_window')";*/
	element2.onclick = function(){
		HideWindow('presse_window');
	}
}
function change_img(){
	element.src = './images/index/r15_c6.png';
}
function HideWindow(id){
	element = document.getElementById('r15_c6');
	element2 = document.getElementById('link_r15_c6');
	$('#'+id).fadeOut("slow");
	
	element2.onclick = function(){
		ShowWindow('presse_window');
	}
	setTimeout('change_img()', 400);
}

function change_dprm_flash(filename){
	var code = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="478" height="380" align="middle" data="'+filename+'">';
	code += '<param name="allowScriptAccess" value="sameDomain" />';
	code += '<param name="allowFullScreen" value="false" />';
	code += '<param name="movie" value="'+filename+'" />';
	code += '<param name="quality" value="high" />';
	code += '<param name="wmode" value="transparent" />';
	code += '<embed src="'+filename+'" quality="high" width="478" height="380" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	code += '</object>';
	document.getElementById('dprm').innerHTML = code;
}

function change_dprm(id){
	var first_link = document.getElementById('link_dprm_1');
	var second_link = document.getElementById('link_dprm_2');
	var dprm_flash = document.getElementById('dprm');
	var param1 = document.getElementById('param1');
	var embed = document.getElementById('embed');
	var text_f = 'Diaporama n&deg;';
	var filename = './swf/performances/diaporama';
	if( id == 1 ){
		first_link.innerHTML = text_f + '1';
		second_link.innerHTML = '<a href="#" onclick="change_dprm(2);">' + text_f + '2</a>';
		change_dprm_flash(filename+'1.swf');
	} else if( id == 2 ){
		second_link.innerHTML = text_f + '2';
		first_link.innerHTML = '<a href="#" onclick="change_dprm(1);">' + text_f + '1</a>';
		change_dprm_flash(filename+'2.swf');
	}
}