<!--
// aide pour recuperer contenu elt
function fProp(obj, nom){ var txt='';
//for(var i in obj){txt += nom+"."+i+" = "+obj[i]+"<br>";}
for(var i in obj){txt += nom+'.'+i+' = '+obj[i]+' ';}
return txt;}
// ex d'appels:
// document.write ("<hr>Propriétés:<br>"+ fProp(val[0], "Inp")+"<hr>")
// document.write ("<hr>Propriétés:<br>"+ fProp(document.getElementById("tableSai"), "TblSai")+"<hr>")
// document.write ("<hr>Propriétés:<br>"+ fProp(document.getElementById("arr_courant"), "ArC")+"<hr>")
Number.prototype.format = function () {
var sepg = ' ';
var chap= 2;
var sepd = '.';
var chpg = 3;
var str = "";
var w = Math.pow(10, chap);
var s= ""+Math.round(this*w)/w;
if (chap > 0) {
var i = s.indexOf(".");
if (i==-1) s+=".";
var i = s.indexOf(".");
i = s.substring(i+1).length;
while (i < chap) { s += "0";  i++; }
}
i = s.indexOf(".");
if (i==-1) i = s.length;
var k = s.substring(0,i);
var k2 = s.substring(i+1);
var n = 0;
for (var i=k.length-1; i >= 0; i--) {
if (k.charAt(i)!='-') n++;
str = k.charAt(i) + str;
if (n >= chpg && i > 0) {str = sepg + str; n=0; }
}
if (chap > 0) {str += "." + k2;}
return str.split(".").join(sepd);
}
function popdiapo(type,page) {
hrefURL = 'diapoinfo.php?info='+type+'&p='+page;
winDiapo=window.open(hrefURL, 'Diaporama', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=980,height=758,top=0,left=0');
}
function popImg(img,lib) {
hrefURL = 'popimg.php?img='+img+'&lib='+lib;
winImg=window.open(hrefURL, 'Cartes', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=360,height=300,top=0,left=0');
}
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent.toLowerCase();
	this.name=navigator.appName.toLowerCase();
	this.dom=document.getElementById?1:0;
	this.op=(this.agent.indexOf("opera")>-1)?1:0;
	this.iep=(this.agent.indexOf("msie")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ie=this.ie4||this.iep;
	this.ns=(this.name.indexOf("netscape")>-1)?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.px = (this.ns4||window.opera)?"":"px";
	this.VIS = "visible";this.HID = "hidden"; this.stl=".style.";
	if (this.ie) {this.prescr="document.body";this.topscr=".scrollTop";this.lefscr=".scrollLeft";
								this.predis="window.document.body";this.HTdis=".clientHeight";this.WTdis=".offsetWidth";}
	else {this.prescr="window";this.topscr=".pageYOffset";this.lefscr=".pageXOffset";
								this.predis="window";this.HTdis=".innerHeight";this.WTdis=".innerWidth";}
	if (this.ns4){this.DO1 = "document.layers["; this.DO2="]"; this.stl=".";this.VIS = "show";this.HID = "hide";this.HT=".clip.height";this.WT=".clip.width";}
	else if (this.ie4){this.DO1 = "document.all["; this.DO2="]";this.HT="..clientHeight";this.WT="..clientWidth";}
	else if (this.dom){this.DO1 = "document.getElementById("; this.DO2=")";this.HT=".offsetHeight";this.WT=".offsetWidth";}
	this.bw=(this.iep || this.ie4 || this.ns4 || this.op || this.dom);
	return this;
}
var bw=new lib_bwcheck(); //Making browsercheck object

function fDiv(nme, prp, val, px){return eval(bw.DO1+"'"+nme+"'"+bw.DO2+bw.stl+prp+"='"+val+px+"'");}
function fRec(nom_menu, prp){return eval(bw.DO1+"'"+nom_menu+"'"+bw.DO2+prp);}

//
function Virpx(elt){
var ret='';
if (isNaN(elt)){
	var j = elt.indexOf("px");
	if (j>-1){ret=elt.substring(0,j);}
	else {ret=elt;}
	}
else {ret=elt;
}
return ret;
}
function fNum(dep){var arr=""; arr=dep;
if (isNaN(arr)){arr="";
	for(var i=0;i<dep.length;i++){
		if(dep.charAt(i)=='p') break; else arr+=dep.charAt(i);}}
return arr;}
//
function on(name,src){document.images[name].src = src;}
function Voire(cadr){fDiv(cadr, 'visibility', bw.VIS); return true;}
function Cacher(cadr){fDiv(cadr, 'visibility', bw.HID); return true;}
function VoirB(cadr){fDiv(cadr, 'display', 'block', ''); return true;}
function VoirI(cadr){fDiv(cadr, 'display', 'inline', ''); return true;}
function CacherB(cadr){fDiv(cadr, 'display', 'none', ''); return true;}
//

function Calend(typ){
var jjd='';
var mmd='';
var aad='';
var jjf='';
var mmf='';
var aaf='';
if (typ == 'B' || typ == 'S') {
var jjd=document.getElementById('debjj').value;
var mmd=document.getElementById('debmm').value;
var aad=document.getElementById('debaa').value;
var jjf=document.getElementById('finjj').value;
var mmf=document.getElementById('finmm').value;
var aaf=document.getElementById('finaa').value;
}
else
if (typ == 'A') {
var jjd=document.getElementById('voljj').value;
var mmd=document.getElementById('volmm').value;
var aad=document.getElementById('volaa').value;
}
else
if (typ == 'V') {
var jjd=document.getElementById('voljj1').value;
var mmd=document.getElementById('volmm1').value;
var aad=document.getElementById('volaa1').value;
}
else
if (typ == 'W') {
var jjd=document.getElementById('voljj2').value;
var mmd=document.getElementById('volmm2').value;
var aad=document.getElementById('volaa2').value;
}

hrefURL = 'calend.php?jjd='+jjd+'&mmd='+mmd+'&aad='+aad+'&jjf='+jjf+'&mmf='+mmf+'&aaf='+aaf+'&typ='+typ;
wincalend=window.open(hrefURL, "Calendrier", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=300,height=300,top=20,left=20");
}
function Calend2(typ){
var jjd=document.getElementById('debjj').value;
var mmd=document.getElementById('debmm').value;
var aad=document.getElementById('debaa').value;
var jjf='';
var mmf='';
var aaf='';
hrefURL = 'calend.php?jjd='+jjd+'&mmd='+mmd+'&aad='+aad+'&jjf='+jjf+'&mmf='+mmf+'&aaf='+aaf+'&typ='+typ;
wincalend=window.open(hrefURL, "Calendrier", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=250,height=230,top=20,left=20");
}

function prePrint(){
	if (window.print){window.print();
}else alert('Cette fonction n\'est pas disponible sur votre navigateur, utilisez le clic droit de votre souris ou les touches CTRL+P');
}

function opVideo(nomVideo) {
hrefURL = 'VideoClip.php?nomVideo='+nomVideo;
winrep=window.open(hrefURL, 'VideoClip', "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=450,height=450,top=0,left=0");
}
function envoi(form){
if(document.getElementById(form)&&document.getElementById('texteSuite')) {
	document.getElementById(form).style.display = 'none';
	document.getElementById('texteSuite').style.display = 'block';
}
}

function addBookmark(title,url) {
if (window.sidebar) {
window.sidebar.addPanel(title, url,"");
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}


var Niv1="";
var Niv2="";
var Niv3="";
function Voir(elt, niv){
clearTimeout(tim);
ModSelect('hidden');
var V="N";
if (niv=='3'){if (Niv3!=elt){Cache(Niv3, '3'); Niv3=elt; V="O";}}
if (niv=='2'){if (Niv2!=elt){Cache(Niv3, '3'); Niv3=""; Cache(Niv2, '2'); Niv2=elt; V="O";}}
if (niv=='1'){if (Niv1!=elt){Cache(Niv3, '3'); Niv3=""; Cache(Niv2, '2'); Niv2=""; Cache(Niv1, '1'); Niv1=elt; V="O";}}
if (V=="O"){Voire(elt, niv);}
}
function Cache(elt, niv){
if (document.getElementById(elt)){
document.getElementById(elt).style.display="none";
}
}
function Voire(elt, niv){
if (document.getElementById(elt)){
document.getElementById(elt).style.display="block";
}
}
function Cach(niv){
clearTimeout(tim);
tim = setTimeout("Cacher()",600);
}
function Cacher(){
clearTimeout(tim);
Cache(Niv3, '3'); Niv3=""; 
Cache(Niv2, '2'); Niv2=""; 
Cache(Niv1, '1'); Niv1="";
ModSelect('visible');
}
function ModSelect(disp){
// if (bw.ie){
// 	try{
// 		for (j=0;j<document.getElementsByTagName("select").length;j++){
// 			document.getElementsByTagName("select")[j].style.visibility=disp;
// 		}
// 	}
// 	catch (e) {};
// }
}
tim = setTimeout("Cacher()",100);

function VoirV(elt){
if (document.getElementById(elt)){
document.getElementById(elt).style.visibility='visible';
}
}function CachV(elt){
if (document.getElementById(elt)){
document.getElementById(elt).style.visibility='hidden';
}
}
function testMenu(men) {
alert (fProp(document.getElementById(men), men))

}
function checkMenu() {
CacheM('ssmenu01', 'menu01', '1');
CacheM('ssmenu02', 'menu02', '1');
CacheM('ssmenu03', 'menu03', '1');
}
function PosMenu() {
//var scrtop = (window.pageYOffset!=undefined)?window.pageYOffset:document.documentElement.scrollTop;
document.getElementById('menug').style.visibility='hidden';
document.getElementById('menug').style.top='225px';
//document.getElementById('ssmenu1').style.top='28px';
//document.getElementById('ssmenu1').style.marginTop='-28px';
document.getElementById('menug').style.visibility='visible';
}
//onload = testMenu;
//
// -->

