

if(navigator.userAgent.indexOf('Win')>=0){

	css = ".en-tetes div {  } .nav { margin-top: 1.7em;  }  #documentation .col, #sites .col { } #documentation .col3, #sites .col3  { display: none;  } .en-tetes { margin-bottom: 3em;  } ";

	document.write('<style type="text/css">'+css+'</style>')

}

if(navigator.userAgent.indexOf('MSIE 6')>=0){
	
	css = ".en-tetes { margin-top: -10px; width: 52em;  } .en-tetes div sub { font-size: 11px } #sommaire ul { margin-left: 3.9em;  } #sommaire ul li h2 span{ white-space: nowrap !important; cursor: hand;   } #menuDoc { position: static  } #sommaire .menuPages { position: absolute; left: -6.2em; top: 1.1em  } #sommaire .menuPages li a { width: 3em;  } .nav { margin-right: 0.8em; } #navBas { margin-top: 0;  } .col { margin-left: 1em; ; } .col2, .col3 { margin-left: 2.6em; ; } .nav {  width: 3.6em;  } #annexesOpen {  z-index: 1000;  } #dossier #annexes .singleAnnexe div.blocAnnexe.larg { width: 72.5em } #p3 h3, #p9 h3 { margin-top: 0 } #annexesOpen a {position: absolute; height: 2em; overflow: hidden } #dossier #annexes { top: 2.5em;  } #calendrier #calOpen { position: relative; z-index: 50;  } #calendrier #calOpen .numero { margin-left: -0.6em; height: 1.3em; overflow: hidden  } .colonnes #navBas { margin-top: -3em ;  }#pages, #couv, .autresPages { width: 57.3em;   }  #util, #retourIndex { margin-left: 1.4em; white-space: nowrap !important; cursor: hand;  }";

	document.write('<style type="text/css">'+css+'</style>')

	

}


if(navigator.userAgent.indexOf('MSIE 7')>=0){
	
	css = "#sommaire h2 { float: none; border-top: 1px solid #fff } #sommaire ul li h2 span{ white-space: nowrap !important; cursor: hand;   } #util { top: 60.4em } #p3 h3, #p9 h3 { margin-top: 0 } #annexesOpen {  z-index: 1000;  }   #annexesOpen a {position: absolute; height: 2em;  } #dossier #annexes { top: 2.5em;  } #calendrier #calOpen { position: relative; z-index: 50;  } #calendrier #calOpen .numero {  height: 1.3em;  } .colonnes #navBas { margin-top: -3em ;  }#pages, #couv, .autresPages { width: 57.3em; } #menu { left: 58em;   }  #retourIndex { white-space: nowrap !important; cursor: hand;  }";

	document.write('<style type="text/css">'+css+'</style>')

	

}


if(navigator.userAgent.indexOf('Safari')>=0){

	css = "#annexesOpen a { margin-left: -0.6em;  } sup { vertical-align: baseline; position: relative; top: -0.6em }";

	document.write('<style type="text/css">'+css+'</style>')

}


window.onload = init;

nPara = 0;

var x1,x2,y1,y2;

function init(){

	nPara = document.getElementsByClassName("texte").length;

	if(!document.getElementById('accueil')){
	
		checkNav();
		
		x1 = $('menuDoc').offsetLeft
		x2 = $('menuDoc').offsetLeft + $('menuDoc').offsetWidth 
		y1 = $('menuDoc').offsetTop
		//y2 = $('menuDoc').offsetTop + $('menuDoc').offsetHeight
		y2 = $('menuDoc').offsetTop + 190
	
		$('menuDoc').getElementsByTagName('a').item(0).className = "open"
		mnOn = $('menuDoc').getElementsByTagName('a').item(0);
	
	}

	if(document.getElementById('dossier') || document.getElementById('calendrier') || document.getElementById('adresses')){
	
		cP = window.location.search.indexOf('&r')

		if(cP >= 0){
	
		page2($('menuDoc').getElementsByTagName('a').length,$('menuDoc').getElementsByTagName('a')[$('menuDoc').getElementsByTagName('a').length-1])

		}		
		
		
	
	}
	

	if(document.getElementById('calendrier')){
	
		calNumeros()
	
	}

	if(document.getElementById('accueil')){
	
	cP = window.location.search.indexOf('c=')

		if(cP < 0){
		window.setTimeout('chgCoul1()',1000)
		}
		
		//window.setTimeout('goCoul()',2000)
	
		playAccueil = window.setInterval('chgCoul()',3500)
	
	}


	couleur()

	if(document.getElementById('dossier')){
	
if(navigator.userAgent.indexOf('Win')>=0){

	$('p1').getElementsByTagName('p')[0].appendChild($('correc1'))
$('p4').getElementsByTagName('p')[2].appendChild($('correc2'))
$('p6').getElementsByTagName('p')[1].appendChild($('correc3'))
$('p9').getElementsByTagName('p')[1].appendChild($('correc4'))

}
	
	}
}



coul = new Array('#C50070','#D9811C','#9FC652','#52ADDD','#ECEB28','#C60022','#39A55A','#6E1B71')


currCoul = 0;

function chgCoul1(){


	currCoul1 = currCoul;
	
	if(currCoul<7){currCoul++}
	else{currCoul=0}

	new Effect.Highlight($('couv'), {startcolor:coul[currCoul1], endcolor:coul[currCoul],restorecolor:coul[currCoul],duration:0.7})

}



function chgCoul(){


	currCoul1 = currCoul;
	
	if(currCoul<7){currCoul++}
	else{currCoul=0}

	new Effect.Highlight($('couv'), {startcolor:coul[currCoul1], endcolor:coul[currCoul],restorecolor:coul[currCoul],duration:2})

}


function vwMenu(){

	etat = document.getElementById('menu').style.visibility

	document.getElementById('menu').style.visibility = (etat == "") ? "visible" : "";

	if(etat == ""){ 
		
		window.clearInterval(playAccueil) 
		
		}
		
		else {
		
			window.setTimeout('chgCoul1()',1000)
			playAccueil = window.setInterval('chgCoul()',3500)
		
		}
		

}


function loc(t){


	window.location.href = t.href + "?c=" + currCoul

}


function couleur(){

	cP = window.location.search.indexOf('c=')

	if(cP >= 0){
	
		cl = window.location.search.substring(cP+2,cP+3)

		$('couv').style.backgroundColor = coul[cl]
		
		currCoul = cl

	}
	
	}


function vwCouv(){

	window.location.href = "index.html" + "?c=" + currCoul
	
}

var pCurr = 1


function page(s,t){

	if(pCurr+s<1){
	
		if(locPrec == "dossier.html"){ 
		
		window.location.href = locPrec + "?c=" + currCoul + "&r"
		
		}

		else if(locPrec == "calendrier.html"){ 
		
		window.location.href = locPrec + "?c=" + currCoul + "&r"
		
		}


		else if(locPrec == "adresses.html"){ 
		
		window.location.href = locPrec + "?c=" + currCoul + "&r"
		
		}
		
		else {
		
		window.location.href = locPrec + "?c=" + currCoul
	
		}
	}
	
	else if(pCurr+s>nPara){
	
		window.location.href = locSuiv + "?c=" + currCoul
	
	}
	
	else{
	page2(pCurr+s,$('menuDoc').getElementsByTagName('a').item(pCurr+s-1))
	}
}

var mnOn = 0;

function page2(n,t){

//	t.blur()
	
	if(mnOn != 0 && n != pCurr){
	
		mnOn.className = "";
	
	}

	if(n != pCurr){

		t.className = "open"
		mnOn = t;
		affPage(n-pCurr);
		window.scrollTo(0,0)
	}

	else {

		

		}



}

function affPage(n){

	pO = 'p'+pCurr;
	pN = 'p'+(pCurr+n);


	$(pN).style.top = $(pO).offsetTop + "px";

	
	w = $(pO).offsetWidth
	h = $(pO).offsetHeight
	
	$(pN).style.height = h - 2 + "px"
	
	$(pN).style.clip = "rect(0,"+(w-20)+"px,"+h+"px,0)";



	pCurr += n; 



	
	$(pN).addClassName('aff');
	$(pO).removeClassName('aff')



	
	checkNav()

	if(navigator.userAgent.indexOf('MSIE')>=0){ bugIE1($(pN))	}

}


function checkNav(){

	if(pCurr == 1){
	
		
		
	}
	
	else {
	
		
	
	}


	if(pCurr == nPara){
	
		
	
	}
	
	else {
	
		
	
	}


	$('curr').innerHTML = "<span>"+(pCurr+numDep)+"<\/span>"
	$('curr2').innerHTML = "<span>"+(pCurr+numDep)+"<\/span>"


}
	
	
function deplMn(){

	//$('menuDoc').className = "op";
	//mn = 1;

}
	
var mn=0

var IE = document.all?true:false

//if (!IE) document.captureEvents(Event.MOUSEMOVE)

//document.onmousemove = getMouseXY;

var tempX = 0
var tempY = 0


function getMouseXY(e) {
  if (IE) { 
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  
    tempX = e.pageX
    tempY = e.pageY
  }  

  return true
  
}


function annexe(t){

if(t.parentNode.id != "annexesOpen"){


	
	if(document.getElementById('annexesOpen')){closeAnnexe()}
	


	ann = $(t.href.substring(t.href.indexOf('#')+1,t.href.length))
	t.parentNode.id = "annexesOpen"
	t.parentNode.appendChild($('annexes'))
	ann.parentNode.id = "currAnn"
	
	Event.observe(ann, 'click', function(e){ closeAnnexe() });
	
	chCl = 2;
	
	
	}
	
	else {
	
		closeAnnexe()
		chCl = 0;
	
	}



	
}


function closeAnnexe(){
	
	if(document.getElementById('annexesOpen')){$('annexesOpen').id = ""}
	$('dossier').appendChild($('annexes'))
	if(document.getElementById('currAnn')){$('currAnn').id = ""}

}


function footNote(t){


}


function calNumeros(){
	
	nums = document.getElementsByClassName('numero')
	
	for(i=0;i<nums.length;i++){
	
		nums[i].innerHTML = i+1;
	
	}

}

var chCl = 0;

document.onclick = checkClose;

function checkClose(){

	if(chCl==1){
	
		if(document.getElementById('dossier')){
		closeAnnexe()
		}
		if(document.getElementById('calendrier')){
		currCal.parentNode.parentNode.id = "";
		clCalEvent();
		}
	
	}
	
	else if(chCl==2){
	
		chCl=1
	
	}

	else if(chCl==3){
	
		chCl=1
	
	}

}

var bugIE = 0

function bugIE1(p){

//.aff {  position: absolute; top: 6em;  } #navBas {  position: absolute; right: 0; top: 73em }

		p.style.position = "absolute";
		p.style.top = "6em"
		$('navBas').style.position = "absolute";
		$('navBas').style.top = "73em"

		if(document.getElementById('calendrier')){
		
			les_cols = document.getElementsByClassName('col')

				for(i=0;i<les_cols.length;i++){
		
					les_cols[i].style.position = "relative"

				}

		}
	
		bugIE = p
		window.setTimeout("bugIE2()",100)
}

function bugIE2(){
	
		
		bugIE.style.position = "";
		bugIE.style.top = ""
		$('navBas').style.position = "";
		$('navBas').style.top = ""

		if(document.getElementById('calendrier')){
		
			les_cols = document.getElementsByClassName('col')

				for(i=0;i<les_cols.length;i++){
		
					les_cols[i].style.position = ""

				}

		}
}







