var speed = 2;
var HVisible= 70;
 

if(navigator.appName =="Microsoft Internet Explorer") {
	if(navigator.userAgent.indexOf("Mac") == -1 && navigator.appVersion.indexOf("MSIE 5.0")<0) window.onresize = function(){window.document.location.reload();}
	else if(navigator.appVersion.indexOf("MSIE 5.0")>0) window.onresize = preload;
}

function preload() {
	window.document.location.reload();
}

if ((navigator.appName=="Netscape")) reloadPage(true);
function reloadPage(init) {
  if (init==true) {
    pageW=innerWidth;
	pageH=innerHeight;
	onresize=reloadPage;
  }
  else if (innerWidth!=pageW || innerHeight!=pageH) location.reload();
}


function scrollH(sens,targe){
	ts = new getObj(targe).obj;
	HDiv = ts.offsetHeight;
	if (parseInt(ts.style.top) > (HVisible-HDiv) && (sens == -1) ||  parseInt(ts.style.top) < 0 && (sens ==1))
		ts.style.top=parseInt(ts.style.top)+ sens;
}

function initScroll(){
	for(i=1;i<4;i++){
		new getObj("fixe"+i).style.top = getAbsoluteTop("p"+i)+26;
		new getObj("fixe"+i).style.left = getAbsoluteLeft("p"+i)+20;
		new getObj("fixe"+i).style.visibility = "visible";
		if(new getObj("sc"+i).obj.offsetHeight>HVisible) new getObj("bscroll"+i).style.visibility = "visible";
	}
}
function initoneScroll(){
	new getObj("fixe1").style.top = getAbsoluteTop("p1")+26;
	new getObj("fixe1").style.left = getAbsoluteLeft("p1")+20;
	//alert( document.getElementById("p1").offsetParent.offsetTop );
	//alert( document.getElementById("p1").offsetHeight );
	//alert(getAbsoluteTop("p1"));
	//alert(getAbsoluteTop("pX"));
	//alert(getAbsoluteTop("pT"));
	new getObj("fixe1").style.visibility = "visible";
	if(new getObj("sc1").obj.offsetHeight>HVisible) new getObj("bscroll1").style.visibility = "visible";
}


function swapImg(obj){
	var ch=""+obj.src;
	var finfin=ch.substring(ch.length-3,ch.length);
	var fin=ch.substring(ch.length-5,ch.length-4);
	ch=ch.substring(0,ch.length-5);
	if(fin == "0")
	   obj.src=ch+"1."+finfin;
	else
	   obj.src=ch+"0."+finfin;
}
function selImg(obj,sel){
	var ch=""+obj.src;
	var fin=ch.substring(ch.length-5,ch.length);
	ch=ch.substring(0,ch.length-5);
	if(sel==1)
	   obj.src=ch+"1.gif";
	else
	   obj.src=ch+"0.gif";
}

function getObj(name){
	//alert(name);
  if (document.getElementById){
  //alert(name+' 1');
   this.obj = document.getElementById(name);
   //alert('obj : '+this.obj);
  this.style = document.getElementById(name).style;
	//alert('style = '+this.style);
  }
  else if (document.all){
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
}

function getAbsoluteTop(objectId){
	var x = (new getObj(objectId)).obj;	
	xTop = x.offsetTop;
	while(x.offsetParent!=null) {
		xParent = x.offsetParent;
		xTop += xParent.offsetTop;
		x = xParent;
	}
	return xTop;
}
function getAbsoluteLeft(objectId){
	var x = (new getObj(objectId)).obj;
	xLeft = x.offsetLeft;
	while(x.offsetParent!=null){
		xParent = x.offsetParent;
		xLeft += xParent.offsetLeft;
		x = xParent;
	}
	return xLeft;
}
function getAbsoluteWidth(objectId){
	var x = (new getObj(objectId)).obj;	
	xW = x.offsetWidth;
	/*while(x.offsetParent!=null) {
		xParent = x.offsetParent;
		xW += xParent.offsetWidth;
		x = xParent;
	}*/
	return xW;
}
function getAbsoluteHeight(objectId){
	var x = (new getObj(objectId)).obj;	
	xW = x.offsetHeight;
	/*while(x.offsetParent!=null) {
		xParent = x.offsetParent;
		xW += xParent.offsetWidth;
		x = xParent;
	}*/
	return xW;
}
function openPop(f,l,h,op)
{
	longueur=l;
	hauteur=h;
	haut = screen.height/2 - hauteur/2;
	dim = screen.width/2 - longueur/2;
	window.open(f,'','width='+longueur+',height='+hauteur+',left='+dim+',top='+haut+',resizable=no,'+op+'');
}
maxSnav1 = 3;
maxSnav5 = 2;
function navOn(id,sid,lang){
	var prefix="..";
	document.images["n"+id].src = prefix+"/images/nav/n"+id+""+lang+"_on.gif";
	if(id>1) document.images["sp"+(id-1)].src =  prefix+"/images/shim.gif";
	if(id<7) document.images["sp"+id].src =  prefix+"/images/shim.gif";
	if(sid){
		 document.images["sn"+sid].src =  prefix+"/images/nav/n"+id+"_"+sid+""+lang+"_on.gif";
		 if(id==1) maxSnav = maxSnav1;
		 if(id==5) maxSnav = maxSnav5;
		 if(sid>1) document.images["ssp"+(sid-1)].src =  prefix+"/images/shim.gif";
	     if(sid<maxSnav) document.images["ssp"+sid].src =  prefix+"/images/shim.gif"; 
	}
}
tbMoisFR = ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"];
tbMoisEN = ["January","February","March","April","May","June","July","August","September","October","November","December"];
function writeDate(lang){
	aujourdhui = new Date();
	jour = aujourdhui.getDate();
	mois = aujourdhui.getMonth();
	an = aujourdhui.getFullYear();
	if(lang=="FR")
		document.write("&nbsp;&nbsp;Le "+jour+" "+tbMoisFR[mois]+" "+an);
	else
		document.write("&nbsp;&nbsp;"+tbMoisEN[mois]+" "+jour+", "+an);
}
