var IE=true;
var start_son=true;
if (navigator.appName == 'Microsoft Internet Explorer') {IE=true;} else {IE=false;}
window.onload = function(){
	var rapport = screen.width/screen.height;
	var div_corps = document.getElementById("corps");
	if (navigator.platform == "iPad"){
			div_corps.style.width = 1024+'px';
			div_corps.style.height = 695+'px';
	}else{
		if (rapport>=1.7){
			//marges de 22%
			div_corps.style.width = 78+'%';
			div_corps.style.left = 11+'%';
		}else{
			if(rapport>=1.6){
				//marges de 16%
				div_corps.style.width = 84+'%';
				div_corps.style.left = 8+'%';			
			}else{
				if(rapport>=1.5){
					//marges de 8%
					div_corps.style.width = 92+'%';
					div_corps.style.left = 4+'%';				
				}else{
					//defaut, pas de marges
				}
			}	
		}
	}
}
function anime(montre,cache,id,bruit){
	document.getElementById(montre).style.display="block";
	if(IE){
		if(montre!=""){document.getElementById(montre).filters.alpha.opacity=100;}
		if(cache!=""){document.getElementById(cache).filters.alpha.opacity=0;}
	}else{
		if(montre!=""){document.getElementById(montre).style.opacity=1;}
		if(cache!=""){document.getElementById(cache).style.opacity=0;}
	}
	if(start_son){
		document.getElementById(id).innerHTML = '<object type="application/x-shockwave-flash" data="./son/dewplayer-mini.swf?mp3='+bruit+'&autoplay=1" width="0" height="0"><param name="movie" value="./son/dewplayer-mini.swf?mp3='+bruit+'&autoplay=1" /></object>';
		start_son=false;
	}
}
function desanime(e,cache,montre,div,id,bruit){
var noeud;
	if (IE) {noeud=event.toElement;}
	else{noeud=e.relatedTarget;}
	if(noeud!=null){
		while (noeud.nodeName !="BODY" && noeud.nodeName !="body"){
			if (IE) {if (noeud.attributes.id.value==div) {return;}}
			else{if (noeud.id==div) return;}
			noeud=noeud.parentNode;
		}
	}	
	if(IE){
		if(montre!=""){document.getElementById(montre).filters.alpha.opacity=100;}
		if(cache!=""){document.getElementById(cache).filters.alpha.opacity=0;}
	}else{
		if(montre!=""){document.getElementById(montre).style.opacity=1;}
		if(cache!=""){document.getElementById(cache).style.opacity=0;}
	}
	document.getElementById(cache).style.display="none";
	document.getElementById(id).innerHTML = '<object type="application/x-shockwave-flash" data="./son/dewplayer-mini.swf?mp3='+bruit+'" width="0" height="0"><param name="movie" value="./son/dewplayer-mini.swf?mp3='+bruit+'" /></object>';
	start_son=true;
}
