

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

	css = "#text-content h2.chap {  }";
	
	document.write('<style type="text/css">'+css+'</style>')

}


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

	css = "#article #titrePage { height: 58px; } ";
	
	document.write('<style type="text/css">'+css+'</style>')

}



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

	css = "#entetes h1{ text-align: left } #menu_gen { position: relative } ";
	
	document.write('<style type="text/css">'+css+'</style>')

}

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

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

}

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

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

}

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

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

}

window.onload = init;


function init(){


if(navigator.userAgent.indexOf('MSIE 6')>=0||navigator.userAgent.indexOf('MSIE 7')>=0){

	checkSizeIE()

}

if(window.location.href.indexOf('#')>0){

	anc = window.location.href;
	anc = anc.substring(anc.indexOf('#')+1,anc.length);
	
	chps = $('text-content').getElementsByTagName('h2');
	var chp;
	
	for(i=0;i<chps.length;i++){
	
		if(chps[i].getElementsByTagName('a')[0].innerHTML.indexOf(anc)>=0){
		
			opChap(chps[i].getElementsByTagName('a')[0]);
			chp = chps[i].parentNode;
		
		}
		
	}


	var winW = 0, winH = 0;
	
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = window.innerWidth;
	  winH = window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = document.body.offsetWidth;
	  winH = document.body.offsetHeight;
	 }
	}

	if(winH<($(chp).offsetTop+200)){
	
		window.scrollBy(0,(($(chp).offsetTop+200)-winH))
	
	}

}


/*
	if(document.getElementById('home')){

		vign = $('vignettes').getElementsByTagName('li');
		
		for(i=0;i<vign.length;i++){
		
			nA = document.createElement('a');
			href = vign[i].getElementsByTagName('a')[0].getAttribute('href');
			
			
			
			nA.setAttribute('href',href);
			nA.className = 'vignette';
			
			Im = vign[i].getElementsByTagName('img')[0]
			nA.appendChild(Im);
			
			vign[i].appendChild(nA);
			
		}

	}
	
*/	
	
	
	/*
	if(document.getElementById('article')){

		tit = $('chap1').getElementsByTagName('h2')[0];
		$('titrePage').appendChild(tit);
		
	}
*/

}



function opChap(t){


if(t.parentNode.className.indexOf('chap1')<0 || t.parentNode.className.length>10){

	c = t.parentNode.parentNode.getElementsByTagName('div')[0];
	s = c.style.display;
	c.style.display = ( s == "" ) ? "block" : "" ;
	t.parentNode.parentNode.className = ( s == "" ) ? "open" : "" ;

	
if(navigator.userAgent.indexOf('Safari')>=0 && s != ""){

	t.parentNode.parentNode.getElementsByTagName('h2')[0].style.paddingBottom = "10px"
	}
		
	}


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

	checkSizeIE()

}
	
	
}


function fermer(t){

	t.parentNode.parentNode.style.display = "";
	t.parentNode.parentNode.parentNode.className = "";
	
	
if(navigator.userAgent.indexOf('Safari')>=0){

	t.parentNode.parentNode.parentNode.getElementsByTagName('h2')[0].style.paddingBottom = "10px"
	}

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

	checkSizeIE()

}

}

function fermer2(t){

	chp = $('text-content').getElementsByTagName('div');
	
	for(i=0;i<chp.length;i++){
	
		if(Element.hasClassName(chp[i],'open')){ 
		
			
			chp[i].getElementsByTagName('div')[0].style.display = "";
			Element.removeClassName(chp[i], 'open');

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

	chp[i].getElementsByTagName('h2')[0].style.paddingBottom = "10px"
	}
		
		}
	
	}
	
	h = $('chap1').offsetHeight+105;
	
	window.scrollTo(0,69);

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

	checkSizeIE()

}

}



function checkSizeIE(){

//alert($('content').offsetHeight)
if(($('content').offsetHeight > $('menu_gen').offsetHeight)){ 
$('footer').style.marginTop = ($('content').offsetHeight - $('menu_gen').offsetHeight) + 30 + "px";
}
else{ 
$('footer').style.marginTop = "";
}
}








