NS = (document.layers) ? true:false
IE = (document.all) ? true:false
FX=((!IE)&&(document.getElementById)) ? true:false


function OWin (theURL,POPTITLE,wid,hei) {
	winfeatures="height="+hei+",width="+wid+",top=0,left=0,Status=no";
	window.open(theURL,POPTITLE,winfeatures);
}
function aller(a) {
parent.document.location=a;
}
function OGlo(theID){
  var zouz=this.w;
  var zz=this.Lgetjs;
  zaizw=((zouz==12)?356:((zouz==16)?406:450));
  zaizh=((zouz==12)?240:((zouz==16)?290:330));
  /*if (this.FX){zaizw+=230;}*/
  winfeatures='top=196,left=48,width='+zaizw+',height='+zaizh+',ScrollBars=Yes, Status=no';
  window.open('popglossaire.php?ID='+theID+'&Lget='+zz,'GLOSSAIRE',winfeatures);
}
function reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);
self.onError=null;


var zot = false;
var outilaff = false;

function opop(a) {
window.setTimeout("opoutil("+a+");",5000);
}

function opoutil(a){
  var offsetX=20;
if (IE){
  var lx=Math.round(getElementPosition('imgoutil').left/10);
  var ly=Math.round(getElementPosition('imgoutil').top/10)-1;
  var lx2=Math.round(getElementPosition('imgtour').left/10);
}
if (FX){
  var lx=getElementPosition('imgoutil').left;
  var ly=getElementPosition('imgoutil').top;
  var lx2=getElementPosition('imgtour').left;
}
if (a==0){
  if (NS){ document.outils.visibility = "hide";document.outils.style.left=lx+offsetX-1;document.outils.style.top=ly;document.outils.style.width=lx2-lx-offsetX;document.outils.style.height=offsetX;}
  if ((IE)||(FX)){ outils.style.visibility = "hidden";outils.style.left=lx+offsetX-1;outils.style.top=ly;outils.style.width=lx2-lx-offsetX;outils.style.height=offsetX;}
}
else if (a==1){
  if (NS) {document.outils.visibility="show";document.outils.style.left=lx+offsetX-1;document.outils.style.top=ly;document.outils.style.width=lx2-lx-offsetX;document.outils.style.height=offsetX;}
  if ((IE)||(FX)) {outils.style.visibility="visible"; outils.style.left=lx+offsetX-1;outils.style.top=ly;outils.style.width=lx2-lx-offsetX;outils.style.height=offsetX;}
}
}

function initblock(){
if (NS){
  block = document.floater;
  blockout = document.scrout;
}
if ((IE)||(FX)){
  block = floater.style;
  blockout = scrout.style;
}
hideObject(block);
showObject(blockout);
}

function showObject(obj){
obj.zIndex=2
if (NS) obj.visibility = "show";
else if (IE)obj.visibility = "visible";
else if (FX){
   var agt=navigator.userAgent.toLowerCase();
     var SF  = (agt.indexOf("safari") != -1);
    if (SF) obj.left=30;
     obj.visibility = "visible";
}
}

function getElementPosition(elemID){
 var offsetTrail =document.getElementById(elemID);
 var offsetLeft =0;
 var offsetTop =0;
if (FX){var resX=0;var resY=0;}
 while (offsetTrail){
  offsetLeft +=offsetTrail.offsetLeft;
  offsetTop +=offsetTrail.offsetTop;
  if(FX){if (offsetLeft>resX)resX=offsetLeft;if (offsetTop>resY)resY=offsetTop;}
  offsetTrail =offsetTrail.offsetParent;
 }
  offsetLeft +=document.body.leftMargin;
  offsetTop +=document.body.topMargin;
  if (FX){offsetLeft=resX;offsetTop=resY;}
 return {left:offsetLeft,top:offsetTop};
}

function trim(sString)
{
while (sString.substring(0,1) == ' ')
{
sString = sString.substring(1, sString.length);
}
while (sString.substring(sString.length-1, sString.length) == ' ')
{
sString = sString.substring(0,sString.length-1);
}
return sString;
}

function hideObject(obj) {
obj.zIndex=-1
if (NS) obj.visibility = "hide";
else if (IE) obj.visibility = "hidden";
  else if (FX) {
    var agt=navigator.userAgent.toLowerCase();
    var SF  = (agt.indexOf("safari") != -1);
    if (SF) obj.left=-800;
     obj.visibility = "hidden";
  }
}
function swapvisibility () {
if (zot) {
	hideObject(block);
	showObject(blockout);
	zot = false
}
else {
	showObject(block);
	hideObject(blockout);
	zot=true
}
}
function swapvisibility2 (q) {
if (zot) {
  var t=q.split(",");
  if (IE){
  document.frames('boussoleIE').location="boussole.php?collid="+t[0]+"&scatgid="+t[1]+"&nid="+t[2]+"&cim="+t[3]+"&lev="+t[4]+"&Lget="+t[5]+"&init="+q;
  }
else if (FX){
  document.getElementById('boussoleIE').src="boussole.php?collid="+t[0]+"&scatgid="+t[1]+"&nid="+t[2]+"&cim="+t[3]+"&lev="+t[4]+"&Lget="+t[5]+"&init="+q;
}
	showObject(blockout);
	hideObject(block);
	zot = false
}
else {	
	showObject(block);
	hideObject(blockout);
	zot=true
}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function loadns(page) {
	if (NS) window.document.floater.layers['textLayer'].load(page,0)
	else if ((IE)||(FX)) boussoleIE.document.location = page ;
}
function wrtext(a) 
{
   var newtitle = a ;
   if (NS) {
    document.layers['textnoticens'].document.close()
	document.layers['textnoticens'].document.write(newtitle)
	document.layers['textnoticens'].document.close()
	 } else if ((IE)||(FX)) {
   	var layer1 = document.getElementById("textnotice");
    layer1.innerHTML = newtitle;
	 }
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

