//au chargement de la page, on appelle la fonction montre()
window.onload = montre;
 
//affichage du menu déroulant et placement de ce dernier
function montre(id,affiche) {

	var d = document.getElementById(id);
	//si on quitte un élément du menu
	if (d && !affiche) 
	{
		d.style.display='none'; //on l'efface
		var c=d.parentNode; //son parent
	}
	//sinon si on se met sur un élément du menu
	else if (d && affiche)
	{ 
		d.style.display='block'; //on l'affiche
		var c=d.parentNode; //son parent
	}
}

// Affichage du menu en haut des pages

function affMenuHaut1(enfant)	{
	document.getElementById('ssmenu').innerHTML = '<h3>... &gt; <a href="Accueil_M&G.php"><b>Les "Monmonts"</b></a> &gt; <font size="+1"><b>'+enfant+'</b></font></h3>';
	}
	
function affMenuHaut2(enfant,lien,p_enfant)	{
	if (lien==0) {lien=enfant}
	document.getElementById('ssmenu').innerHTML = '<h3>... &gt; <a href="Accueil_M&G.php"><b>Les "Monmonts"</b></a> &gt; <a href="'+lien+'.php"><b>'+enfant+'</b></a> &gt; <font size="+1"><b>'+p_enfant+'</b></font></h3>';
	}

function affMenuHaut3(enfant,lien,p_enfant,p_lien,a_enfant)	{
	if (lien==0) {lien=enfant}
	if (p_lien==0) {p_lien=p_enfant}
	document.getElementById('ssmenu').innerHTML = '<h3>... &gt; <a href="Accueil_M&G.php"><b>Les "Monmonts"</b></a> &gt; <a href="'+lien+'.php"><b>'+enfant+'</b></a> &gt; <a href="'+p_lien+'.php"><b>'+p_enfant+'</b></a> &gt; <font size="+1"><b>'+a_enfant+'</b></font></h3>';
	}
	
// Menu de sélection rapide
function MM_jumpMenu(targ,selObj,restore) { //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
	}

// Ajustement des frames
function autofitIframe(id) {
  if (navigator.appName=="Microsoft Internet Explorer") {
	if (document.all) document.all[id].style.height = document.frames(id).document.body.scrollHeight;
	else document.getElementById(id).style.height = document.getElementById(id).contentDocument.body.scrollHeight;
  }
  else {
	document.getElementById(id).style.height = document.getElementById(id).contentDocument.body.offsetHeight+"px";
  }
}

// Affichage du lien "Haut de page"
/***********************************************
* Script adapted from :
* Jump To Top Link Script- © Dynamic Drive (www.dynamicdrive.com)
* Last updated Nov 13th, 03'.
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var displayed="<img src='../images/Top_page.png' width='12' height='13' border='0'>"
var link='javascript:window.scrollTo(0,0)'
var ie4=document.all
var ns6=document.getElementById&&!document.all

function ietruebody() {
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}

function afficheTop() {
	document.write('<span id="gotop" style="position:absolute;visibility:hidden;top:-300px;z-index:100">'+displayed+'</span>')
	}

function staticit() {
	var w2=ns6? pageXOffset+w : ietruebody().scrollLeft+w
	var h2=ns6? pageYOffset+h : ietruebody().scrollTop+h
	crossgotop.style.left=w2+"px"
	crossgotop.style.top=h2+"px"
	}

function inserttext() {
	crossgotop=document.getElementById("gotop")
	crossgotop.innerHTML='<a href="'+link+'">'+displayed+'</a>'
	var	position = 355 - crossgotop.offsetWidth/2
	w=ns6 || window.opera? window.innerWidth/2 + position - 8 : ietruebody().clientWidth/2 + position
	h=ns6 || window.opera? window.innerHeight-crossgotop.offsetHeight-15 : ietruebody().clientHeight-crossgotop.offsetHeight-16
	s=ns6 || window.opera? window.innerHeight-5 : ietruebody().clientHeight
	crossgotop.style.left=w+"px"
	crossgotop.style.top=h+"px"
	if (document.body.scrollHeight>s+40) crossgotop.style.visibility="visible" // Displays icone only if page bigger than window
	else return
	if (ie4)
	window.onscroll=staticit
	else if (ns6)
	startstatic=setInterval("staticit()",100)
	}

if (window.addEventListener) // Firefox,Opera & Safari
window.addEventListener("load", inserttext, false)
else if (window.attachEvent) // ?
window.attachEvent("onload", inserttext)
else // IE
window.onload=inserttext
