function fixeMenu()
{

// S'il s'agit de Netscape 5 et + tout OS

if ((browser == "Netscape Navigator")&&(version > 4))
	{
	document.getElementById('menuHaut').style.position="fixed"
	document.getElementById('menuHaut').style.zIndex="15"
	
	document.getElementById('calendrier').style.overflow="hidden"		
	document.getElementById('cache').style.position="fixed"
	document.getElementById('contenu').style.position="fixed"

	document.getElementById('menuCalendrier').style.position="fixed"	
	document.getElementById('menuLat').style.position="fixed"		
	document.getElementById('grille').style.width="732px"		

	document.getElementById('menuHaut').style.left="20%"
	//document.getElementById('contenu').style.left="15%"
	document.getElementById('menuCalendrier').style.left="20%"
	document.getElementById('menuLat').style.left="65%"


	}

// S'il s'agit de Internet Explorer 5 +

else if ((browser == "Internet Explorer")&&(version > 4))
	{


// S'il s'agit de Internet Explorer 5 ou 5.5 Windows

	if ((version == 5)&&(OS == "Windows"))
		{
		
	document.getElementById('menuHaut').style.zIndex="10"
//alert('3')
		}


	}
}

function retaille(laDiv)
{

if(browser == "Internet Explorer")
{

divLat=document.getElementById(laDiv)

total=document.body.offsetWidth-25

posL=divLat.style.pixelLeft
largReelle=divLat.clientWidth

larg=parseInt(divLat.style.width)
haut=divLat.offsetHeight
pixelDroite=posL+larg



laTaille=total-posL



if ((total-pixelDroite)<0)
{

divLat.style.clip="rect(0px "+laTaille+"px "+haut+"px 0px)"

}
else divLat.style.clip="rect(0px "+largReelle+"px "+haut+"px 0px)"
}
}
 



//////// NIV 1
//////// MENU


selected=""


function mois1(y)
{



nom="h"+y.id
if(selected!=y){

document.getElementById(nom).style.backgroundColor='#FEECDE'
//parent.frames['calendrier'].document.getElementById(nom).style.backgroundColor='#FEECDE'
y.childNodes[0].src='imgs/fleche-data.gif'

}
}

function mois2(y)
{

if(selected!=y){

nom="h"+y.id
document.getElementById(nom).style.backgroundColor=''
//parent.frames['calendrier'].document.getElementById(nom).style.backgroundColor=''
y.childNodes[0].src='imgs/fleche-calend.gif'

}}

function fixeMois(y)
{

selected=y
nom="h"+y.id
for (i=1;i<=12;i++){
n="h"+i
document.getElementById(n).style.backgroundColor=''
//parent.frames['calendrier'].document.getElementById(n).style.backgroundColor=''
document.getElementById(i).childNodes[0].src='imgs/fleche-calend.gif'
}
document.getElementById(nom).style.backgroundColor='#FEECDE'
y.childNodes[0].src='imgs/fleche-data.gif'
}


function initMenu(){

//parent.frames['calendrier'].document.getElementById('h1').style.backgroundColor='#FEECDE'
//document.getElementById('1').childNodes[0].src='ressources_museum/tous/calendrier/niv1/fleche-data.gif'
}





//////// TABLEAU

//////// detection Navigateur

var detect = navigator.userAgent.toLowerCase();
var browser


function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}




function init()
{



HauteurBody=document.getElementsByTagName('body')[0].offsetHeight
HauteurCalendrier=document.getElementById('conteneur').offsetHeight

HauteurGrille=document.getElementById('grille').offsetHeight


// Comparaison entre la hauteur du calendrier et la hauteur du "body"



if(HauteurBody > HauteurCalendrier) HauteurTotale = HauteurBody
else HauteurTotale = HauteurCalendrier


//alert(HauteurBody+" "+HauteurCalendrier+" "+HauteurTotale)


for (i=1;i<=12;i++)
{
nom="h"+i
//document.getElementById(nom).style.height=HauteurGrille+'px'
}

//document.getElementById('grilleSup').style.height=HauteurTotale+'px'

//////// special barre de scroll IE5 Mac

if (checkIt('msie') && checkIt('mac')) 
{

if(HauteurBody > HauteurCalendrier) document.getElementById('body').style.overflow = "hidden"
else document.getElementById('body').style.overflow = "auto"

}


}





function hlight(x){
x.parentNode.parentNode.parentNode.parentNode.parentNode.style.backgroundColor='#F6D5CC'
}

function de_hlight(x){
x.parentNode.parentNode.parentNode.parentNode.parentNode.style.backgroundColor=''
}



///////// NIV 2


function voirSemaine(n,max,ad)
{


for (i=1; i<=max; i++)
{

y="semaine"+i
if (document.getElementById(y))
{ 
document.getElementById(y).style.display='none'
}
}
x="semaine"+n
document.getElementById(x).style.display='block'



for (i=1; i<=max; i++)
{

o="lien_sem"+i
if (document.getElementById(o))
{ 
document.getElementById(o).style.color='#FF9934'
//document.getElementById(o).childNodes[0].src='imgs/fleche_semaine.gif'
document.getElementById(o).childNodes[0].src=ad+'/tous/calendrier/niv2/fleche_semaine.gif'
}
}
p="lien_sem"+n
if(document.getElementById(p)){
document.getElementById(p).style.color='white'}
//document.getElementById(p).childNodes[0].src='imgs/fleche_semaine_select.gif'
document.getElementById(p).childNodes[0].src=ad+'/tous/calendrier/niv2/fleche_semaine_select.gif'


}

