if(navigator.userAgent.indexOf('Safari')>=0){
document.write('<style type="text/css">.chp h2 a { margin-top: 10px }.notes div address a { display: block; width: 150px  }</style>')
}

if(navigator.userAgent.indexOf('MSIE')>=0&&navigator.userAgent.indexOf('Win')>=0){
	hackstyle = '.para { position: static  } .notes { left: 10px; top: 25px; } #somm div.invit#grp1 { cursor: hand; } #somm div.invit#grp2 { cursor: hand; } #somm div.invit#grp3 { cursor: hand; }';
	document.write('<style type="text/css">'+hackstyle+'</style>')
}

if(navigator.userAgent.indexOf('MSIE')>=0&&navigator.userAgent.indexOf('Mac')>=0){
	hackstyle = '.para { position: static  } .notes { left: 10px; top: 25px; }#toutesNotes .notes { width: 545px; } #colTn1, #colTn2, #colTn3 { padding: 0} #toutesNotes div div div {  margin-right: 2px;}.notes div { position: absolute; }#toutesNotes .notes div { position: static; } .x { padding-top: 20px;} .chp h2 a {  float: none; width: 435px; text-align: right; position: relative; top: -1px; background: #fff; height: 6px; left: -1px  } .chp h2 { height: 12px }.complet #aff-somm {  display: none;  } .complet #aff-notes {top: 283px !important;  }.complet #pdf {  top: 300px !important;  }';
	document.write('<style type="text/css">'+hackstyle+'</style>')
}



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

document.onmousemove = getMouseXY;

}


var tempX = 0
var tempY = 0

function getMouseXY(){

tempX = event.clientX + document.body.scrollLeft
tempY = event.clientY + document.body.scrollTop

if(tempY > 70 || tempY < 20 ) mn_dos2()
if(tempX > 680 ) mn_dos2()
}


noteSel = 0;
currDoss = 0;
currDossd = 0;


		function doss(t,d){
		
		t.className = "selec";
		
		inv = t.parentNode.parentNode.parentNode
		// mise en mode View
		
		t.parentNode.parentNode.parentNode.parentNode.className = "";
		
		// deselection de toutes les notes
		
		document.getElementById('toutesNotes').style.display = "none";
		
		// deselection si besoin
		
		deslDoss();
	
		// affichage du chapitre
		
		dn = "chp"+d;
		document.getElementById(dn).style.display = "block";
		
		// jeu de marge basse
		
		document.getElementById('mrgB').style.height = (document.getElementById(dn).offsetHeight + 140) + "px";
		
		// mise en variable de la fiche courante
		
		currDoss = t;
		currDossd = dn;
		
		if(navigator.userAgent.indexOf('safari'))document.getElementById('cache-safari').style.display = ""
		}
		
		
		function deslDoss(){
		
		if(noteSel != 0) noteSel.style.display = "";
		if(currDoss != 0){ currDoss.className = "";
		
		// deselection de toutes les notes
		
		document.getElementById('toutesNotes').style.display = "none";		
		if(document.getElementById('calendrier'))curr.parentNode.getElementsByTagName('div').item(0).style.display = "none";
				}
				
		if(currDossd != 0)document.getElementById(currDossd).style.display = "none"
		}


function note(t,n){

if(t.blur())t.blur();

nt = "note"+n;
nt = document.getElementById(nt);

if(noteSel != 0 && noteSel != nt) noteSel.style.display = "";


st = nt.style.display;

nt.style.display = (st == "block") ? "" : "block" ;

noteSel = nt;

}


function frmDoss(t){

if(t.parentNode.parentNode.className=="notes")
{
t.parentNode.parentNode.style.display='none';
document.getElementsByTagName('a').item(0).focus();
document.getElementsByTagName('a').item(0).blur();
}
else {
t.parentNode.style.display='none';
}


}

inv = 0
nav = 0

function invit(t){

if(t != inv && inv != "tous")t.className = "invit"


}

function desinvit(t){
if(t != inv && inv != "tous")t.className = ""
}


function view(t){
if(inv != 'tous'){
document.getElementById('grp1').className = "";
document.getElementById('grp2').className = "";
document.getElementById('grp3').className = "";
t.className = 'visib';
inv = t;}
}

function toutesNotes(){
deslDoss();


if(document.getElementById('somm').className=="complet"){

inv = document.getElementById('grp1');
document.getElementById('grp1').className = "visib";
document.getElementById('grp2').className = "";
document.getElementById('grp3').className = "";
document.getElementById('somm').className = "";
}
// premiere colonne

tn = document.getElementById('colTn1');

tln = "";

for(i=1;i<=5;i++){
ln = document.getElementById('note'+i).innerHTML;
tln += ln
}
tn.innerHTML = tln;

// deuxieme colonne

tn = document.getElementById('colTn2');

tln = "";

for(i=6;i<=13;i++){
ln = document.getElementById('note'+i).innerHTML;
tln += ln
}
tn.innerHTML = tln;

document.getElementById('toutesNotes').style.display = "block";

// troisieme colonne

tn = document.getElementById('colTn3');

tln = "";

for(i=14;i<=15;i++){
ln = document.getElementById('note'+i).innerHTML;
tln += ln
}
tn.innerHTML = tln;

document.getElementById('toutesNotes').style.display = "block";


}


function tousTitres(){
deslDoss();
document.getElementById('somm').className = "complet";
inv = "tous";
document.getElementById('grp1').className = "visib";
document.getElementById('grp2').className = "visib";
document.getElementById('grp3').className = "visib";

MM_changeProp('grp1','','style.zIndex','3','DIV');MM_changeProp('grp2','','style.zIndex','2','DIV');MM_changeProp('grp3','','style.zIndex','1','DIV');

document.getElementById('toutesNotes').style.display = "none";

document.getElementById('cache-safari').style.display = "block"
}


window.onload = init;

function init(){

tousTitres()

document.getElementById('aff-notes').style.width = "248px"
	//alert(document.getElementById('aff-notes').type)
/**/
}



