

function borderit(which,colorborder, colorfond) { 
if (document.all||document.getElementById){
which.style.borderColor=colorborder
which.style.background=colorfond
}
}

function Browser() {
 d=document;
 this.agt=navigator.userAgent.toLowerCase();
 this.major = parseInt(navigator.appVersion);
 this.dom=(d.getElementById)?1:0; // true for ie6, ns6
 this.ns=(d.layers);
 this.ns4up=(this.ns && this.major >=4);
 this.ns6=(this.dom&&navigator.appName=="Netscape");
 this.op=this.agt.indexOf('opera')!=-1;
 this.ie=(d.all);
 this.ie4=(d.all&&!this.dom)?1:0;
 this.ie4up=(this.ie && this.major >= 4);
 this.ie5=(d.all&&this.dom);
 this.win=((this.agt.indexOf("win")!=-1) || (this.agt.indexOf("16bit")!=-1));
 this.mac=(this.agt.indexOf("mac")!=-1);
}

var oBw = new Browser();

// like to optimize this further
function getObj(id,d) {
  var i,x;  if(!d) d=document; 
  if(!(x=d[id])&&d.all) x=d.all[id]; 
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][id];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=getObj(id,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(id); 
  return x;
}

function getH(o) { var h=0; if (oBw.ns) { h=(o.height)? o.height:o.clip.height; return h; } h=(oBw.op)? o.style.pixelHeight:o.offsetHeight; return h; }
function setH(o,h) { if(oBw.ns) {if(o.clip) o.clip.bottom=h;}else if(oBw.op)o.style.pixelHeight=h;else o.style.height=h; }

function getW(o) { var w=0; if(oBw.ns) { w=(o.width)? o.width:o.clip.width; return w; } w=(oBw.op)? o.style.pixelWidth:o.offsetWidth; return w; }
function setW(o,w) { if(oBw.ns) {if(o.clip) o.clip.right=w;}else if(oBw.op)o.style.pixelWidth=w;else o.style.width=w; }

function getX(o) { var x=(oBw.ns)? o.left:(oBw.op)? o.style.pixelLeft:o.offsetLeft; return x;}
function setX(o,x) { (oBw.ns)? o.left=x:(oBw.op)? o.style.pixelLeft=x:o.style.left=x; }

function getY(o) {  var y=(oBw.ns)? o.top:(oBw.op)? o.style.pixelTop:o.offsetTop; return y;}
function setY(o,y) { (oBw.ie||oBw.dom)? o.style.top=y:(oBw.ns)? o.top=y:o.style.pixelTop=y; }

function setClip(o) { }

function getPageX(o) { if(oBw.ns) { var x=(o.pageX)? o.pageX:o.x; return x; } else if (oBw.op) {  var x=0; while(eval(o)) { x+=o.stylo.pixelLeft; e=o.offsetParent; } return x; } else { var x=0; while(eval(o)) { x+=o.offsetLeft; o=o.offsetParent; } return x; } }

function getPageY(o) { if(oBw.ns) { var y=(o.pageY)? o.pageY:o.y; return y; } else if (oBw.op) {  var y=0; while(eval(o)) { y+=o.stylo.pixelTop; o=o.offsetParent; } return y; }  else { var y=0; while(eval(o)) { y+=o.offsetTop; o=o.offsetParent; } return y; } }

function moveTo(o,x,y) { setX(o,x);setY(o,y); }
function moveBy(o,x,y) { setX(o,getPageX(o)+x);setY(o,getPageY(o)+y); }



function MoveSlow(o,msg,x,y) {
Yinitial = -1024;
 moveTo(o, x,Yinitial);
 ecrire(o,msg);
 show(o);
	for (var PositionY=Yinitial;PositionY<=y;) {
		moveTo(o, x,PositionY);
		PositionY+=1;
	}
}




function setZ(o,z) { if(oBw.ns)o.zIndex=z;else o.style.zIndex=z; }

function show(o,disp) { 
 (oBw.ns)? '':(!disp)? o.style.display="inline":o.style.display=disp;
 (oBw.ns)? o.visibility='show':o.style.visibility='visible';  
}
function hide(o,disp) { 
 (oBw.ns)? '':(arguments.length!=2)? o.style.display="none":'';
 (oBw.ns)? o.visibility='hide':o.style.visibility='hidden';  
}

function writeHTML(o,h) { 
 if(oBw.ns){var doc=o.document;doc.write(h);doc.close();return false;}
 if(o.innerHTML)o.innerHTML=h; 
}

function ecrire(o,msg){

var content ="<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#000000 class=''><TR><TD ><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=1>";
pass = 0
while (pass < msg.length)
	{
	content += "<TR><TD HEIGHT=20 class='sousmenu' >"+msg[pass]+"</TD></TR>";
	pass++;
	}
content += "</TABLE></TD></TR></TABLE>";
if(oBw.ns)
  {
    o.document.write(content);
	  o.document.close();
	  return false;
  }
    else if(o.innerHTML)
  {
	  o.innerHTML = content;
  }

}

function SetOpacity(id,Opacity){
id.filters.alpha.opacity=Opacity;
}


function affichemenu2(msg,id)
{
 var oMenu = getObj(id);
 var oTb = getObj(id+'td');
 var x = getPageX(oTb);
 var y = getPageY(oTb);
 var h = getH(oTb);
 moveTo(oMenu,x,y+h+2);
 ecrire(oMenu,msg);
 show(oMenu);
}

function kill() {  
var oMenu = getObj('pres');hide(oMenu);
var oMenu = getObj('decouvrez');hide(oMenu);
var oMenu = getObj('temoignages');hide(oMenu);
var oMenu = getObj('contact');hide(oMenu);
var oMenu = getObj('langues');hide(oMenu);
}

//document.onmouseover = kill;
document.ondblclick = kill;