dlib = new Object;
dlib.controls = new Object;
dlib_tmp_eCV = new Object;
dlib.tmp = [];
dlib.version = [];
dlib.tor = [];
dlibObjSRefsPrivLibTab = [];
dlib.DomE_Tagtable = ["a", "IMG", "FORM", "DIV", "SPaN", "table"];
dlib.DomE_TagtableCorresp = ["anchor", "image", "form", "layer", "layer", "layer"];
dlib_debugWindowOpen = 0;
dlib.version.main = "2.30-1/10/02 - version Lite";
dlib.version.IsUndefined = "1.0-12/3/02";
dlib.version.IsObject = "1.0-12/3/02";
dlib.version.plateforme = "1.0-12/3/02";
dlib.version.navigator = "1.1-27/5/02";
dlib.version.getNS4Object = "1.35-16/4/02";
dlib.version.getdomElements = "1.0-2/6/02";
dlib.version.getElement = "1.0-2/6/02";
dlib.version.ObjMaker = "1.55-4/6/02";
dlib.version.layers = "1.0-2/6/02";
dlib.version.forms = "1.0-2/6/02";
dlib.version.images = "1.0-2/6/02";
dlib.version.anchors = "1.2-1/10/02";

function IsUndefined(Var)
{
   Undef = false;
   if(Var != 0 && !Var) Undef = true;
   return Undef;
}

function IsObject(Object)
{
   isObj = false;
   if(( typeof Object == "object")) isObj = true;
   return isObj;
}

function add(value)
{
   d_add_retValue =(arguments.length && !isNaN(parseInt(value))) ? value + "add" : value;
   if(arguments.length && !isNaN(parseInt(value))) dlib.debugLog('value', 'add function', value + "add");
   else dlib.debugLog('Error', 'add_function', " bad value :" + value);
   return d_add_retValue;
}

function keep()
{
   return "1k";
}
dlib.plateforme = function(plateforme)
{
   dlib.tmp.chkNav =(navigator.appVersion.indexOf('Windows') > - 1) ? 'WIN' :(navigator.appVersion.indexOf('Mac') > - 1) ? 'MaC' : 'OTHER';
   if(arguments.length && plateforme.toUpperCase() != dlib.tmp.chkNav) dlib.tmp.chkNav = 0;
   return dlib.tmp.chkNav;
}
dlib.navigator = function(nav)
{
   dlib.tmp.ver =(navigator.appVersion.indexOf("MSIE 4") > - 1) ? 'IE4' :(navigator.appVersion.indexOf("MSIE 5") > - 1) ? 'IE5' :(navigator.appVersion.indexOf("MSIE 6") > - 1) ? 'IE6' :(document.layers) ? 'NS4' :(document.getElementById) ? 'NS6' : 'OTHER';
   if(arguments.length)
   {
      if(nav.toUpperCase() == 'IE' && document.all) dlib.tmp.ver = 'IE';
      else if(nav.toUpperCase() == 'NS' && !document.all) dlib.tmp.ver = 'NS';
      else if(nav.toUpperCase() != dlib.tmp.ver) dlib.tmp.ver = 0;
   }
   return dlib.tmp.ver;
}
dlib.debugLog = function(title, ObjName, value, silent)
{
}
dlib.getNS4Object = function(ObjNme, type, PrimObj)
{
   if(!dlib.tor[ObjNme])
   {
      if(arguments.length < 3) obj = eval("document." + type + "s");
      else obj = PrimObj.eval("document." + type + "s");
      dlib.tor[ObjNme] = 0;
      if(PrimObj)
      {
         parentName = PrimObj.name;
      }
      PrimObj =(!PrimObj) ? document.layers : PrimObj.document.layers;
      for(var i in obj)
      {
         if(obj[i] == obj[ObjNme] || obj[i].name == ObjNme) dlib.tor[ObjNme] = obj[i];
      }
      if(!dlib.tor[ObjNme])
      {
         for(var i in PrimObj)
         {
            testObj = 0;
            if(PrimObj[i] == "[object Layer]") testObj = dlib.getNS4Object(ObjNme, type, PrimObj[i]);
            if(testObj)
            {
               dlib.tor[ObjNme] = testObj;
               testObj.parentName = parentName;
               break;
            }
         }
      }
   }
   return dlib.tor[ObjNme];
}
dlib.getdomElements = function(ElementName)
{
   dDomEObj = document.getElementById(ElementName);
   if(!dDomEObj)
   {
      for(var d_DomE_Tagtable_i in dlib.DomE_Tagtable)
      {
         dDomEObj = document.getElementsByTagName(dlib.DomE_Tagtable[d_DomE_Tagtable_i])[ElementName];
         if(dDomEObj)
         break;
      }
   }
   return dDomEObj;
}
dlib.getElement = function(ElementName, type)
{
   if(dlib.navigator('IE')) type =(type == "layer" || type == "anchor") ? "all" : type + "s";
   ge_ReturnObj = dlib.navigator('IE') ? document[type][ElementName] : dlib.navigator('NS4') ? dlib.getNS4Object(ElementName, type) : dlib.getdomElements(ElementName);
   dlib.debugLog((ge_ReturnObj ? "object" : "Error"), ElementName,(ge_ReturnObj ? "found  [" + type + "] " : ElementName + " is NOT an OBJECT. [" + type + "]"));
   return ge_ReturnObj;
}
dlib.ObjMaker = function(ObjName, type)
{
   d_ObjTmpRef = IsObject(ObjName) ? ObjName : dlib.getElement(ObjName, type);
   this.object =(d_ObjTmpRef) ? d_ObjTmpRef :[];
   this.type = type;
   this.exist =(d_ObjTmpRef) ? 1 : 0;
   this.name = IsObject(ObjName) ?(type == "layer" && !dlib.navigator("NS4")) ? ObjName.id : ObjName.name : ObjName;
   this.style =(d_ObjTmpRef) ?(document.layers) ? this.object : this.object.style :[];
   this.document =(document.layers) ? this.object.document : this.style;
   return true;
}
dlib.layers = function(LayerId)
{
   if(!dlibObjSRefsPrivLibTab[LayerId] || !dlibObjSRefsPrivLibTab[LayerId].exist) dlibObjSRefsPrivLibTab[LayerId] = new dlib.ObjMaker(LayerId, "layer");
   return dlibObjSRefsPrivLibTab[LayerId];
}
dlib.forms = function(formName)
{
   if(!dlibObjSRefsPrivLibTab[formName] || !dlibObjSRefsPrivLibTab[formName].exist) dlibObjSRefsPrivLibTab[formName] = dlib.getElement(formName, "form");
   return dlibObjSRefsPrivLibTab[formName];
}
dlib.images = function(imageName)
{
   if(!dlibObjSRefsPrivLibTab[imageName] || !dlibObjSRefsPrivLibTab[imageName].exist) dlibObjSRefsPrivLibTab[imageName] = dlib.getElement(imageName, "image");
   return dlibObjSRefsPrivLibTab[imageName];
}
dlib.anchors = function(anchorName)
{
   anchorObject = IsObject(anchorName) ? anchorName : 0;
   if(IsObject(anchorName)) anchorName = anchorName.name;
   if(!dlibObjSRefsPrivLibTab[anchorName] || !dlibObjSRefsPrivLibTab[anchorName].exist)
   {
      dlibObjSRefsPrivLibTab[anchorName] =(anchorObject) ? new dlib.ObjMaker(anchorObject, "anchor") : new dlib.ObjMaker(anchorName, "anchor");
      dlibObjSRefsPrivLibTab[anchorName].inneranchorObj = [];
      dlibObjSRefsPrivLibTab[anchorName].inneranchorObj.object = [];
      if(dlibObjSRefsPrivLibTab[anchorName].exist &&(dlib.navigator('IE') || dlib.navigator('NS6')))
      {
         dlibObjSRefsPrivLibTab[anchorName].object.innerHTML = '<div id="dlibInanchorPos' + anchorName + '" style="position:absolute;"></div>' + dlibObjSRefsPrivLibTab[anchorName].object.innerHTML;
         dlibObjSRefsPrivLibTab[anchorName].inneranchorObj = new dlib.ObjMaker("dlibInanchorPos" + anchorName, "layer");
      }
   }
   return dlibObjSRefsPrivLibTab[anchorName];
}
dlib.ObjMaker.prototype.visible = function(value)
{
   if(arguments.length) this.style.visibility =(value) ? 'visible' : 'hidden';
   dlib.tmp.vis =(!this.style.visibility || this.style.visibility == 'inherit' || this.style.visibility == 'show') ? 'visible' : this.style.visibility.toLowerCase();
   d_retValue = dlib.tmp.vis.indexOf('visible') > - 1 ? true : false;
   dlib.debugLog('visible', this.name, d_retValue);
   return d_retValue;
}
dlib.ObjMaker.prototype.top = function(value)
{
   if(arguments.length && !this.inneranchorObj && !isNaN(parseInt(value))) this.style.top =(value.toString().indexOf('add') > - 1) ? this.top() + parseInt(value) : parseInt(value);
   else if(arguments.length && !this.inneranchorObj) dlib.debugLog("Error", this.name, " top : bad argument : " + value);
   d_retValue =(dlib.navigator('IE') || dlib.navigator('NS6')) ?(this.inneranchorObj) ? this.inneranchorObj.object.offsetTop : this.object.offsetTop :(this.inneranchorObj) ? this.object.y : this.style.top;
   dlib.debugLog("top", this.name, d_retValue);
   return d_retValue;
}
dlib.ObjMaker.prototype.left = function(value)
{
   if(arguments.length && !this.inneranchorObj && !isNaN(parseInt(value))) this.style.left =(value.toString().indexOf('add') > - 1) ? this.left() + parseInt(value) : parseInt(value);
   else if(arguments.length && !this.inneranchorObj) dlib.debugLog("Error", this.name, " left : bad argument : " + value);
   d_retValue =(dlib.navigator('IE') || dlib.navigator('NS6')) ?(this.inneranchorObj) ? this.inneranchorObj.object.offsetLeft : this.object.offsetLeft :(this.inneranchorObj) ? this.object.x : this.style.left;
   dlib.debugLog("left", this.name, d_retValue);
   return d_retValue;
}
dlib.ObjMaker.prototype.height = function(value)
{
   if(arguments.length && !isNaN(parseInt(value))) this.style.height =(value.toString().indexOf('add') != - 1) ? this.height() + parseInt(value) : parseInt(value);
   else if(arguments.length && isNaN(parseInt(value))) dlib.debugLog("Error", this.name, " height : bad argument : " + value);
   d_retValue =(dlib.navigator('IE') || dlib.navigator('NS6')) ? this.object.offsetHeight : this.style.document.height;
   dlib.debugLog("height", this.name, d_retValue);
   return d_retValue;
}
dlib.ObjMaker.prototype.width = function(value)
{
   if(arguments.length && !isNaN(parseInt(value))) this.style.width =(value.toString().indexOf('add') != - 1) ? this.width() + parseInt(value) : parseInt(value);
   else if(arguments.length && isNaN(parseInt(value))) dlib.debugLog("Error", this.name, " width : bad argument : " + value);
   d_retValue =(dlib.navigator('IE') || dlib.navigator('NS6')) ? this.object.offsetWidth : this.style.document.width;
   dlib.debugLog("width", this.name, d_retValue);
   return d_retValue;
}
//MINIBIBLIO
var ns4 =(document.layers);
var ie4 =(document.all && !document.getElementById);
var ie5 =(document.all && document.getElementById);
var ns6 =(!document.all && document.getElementById);

function layer(lyr)
{
   if(ns4)
   {
      obj = document.layers[lyr]
   }
   else if(ie4)
   {
      obj = document.all[lyr].style
   }
   else if(ie5 || ns6)
   {
      obj = document.getElementById(lyr).style
   }
   return obj;
}

function left(lyr)
{
   if(!ns4) obj = parseInt(layer(lyr).left.substring(0, layer(lyr).left.indexOf("px")));
   else 
   {
      obj = layer(lyr).left
   }
   return obj
}

function top(lyr)
{
   if(!ns4) obj = parseInt(layer(lyr).top.substring(0, layer(lyr).top.indexOf("px")));
   else 
   {
      obj = layer(lyr).top
   }
   return obj
}

function showHide(lyr, what)
{
   layer(lyr).visibility = what;
}

function posLeft(lyr, x)
{
   layer(lyr).left = x;
}

function posTop(lyr, y)
{
   layer(lyr).top = y;
}
// MyClip = [top,right,bottom,left]

function SetClip(DivId, MyClip)
{
   if(!ns4)
   {
      layer(DivId).clip = "rect(" + MyClip[0] + "px " + MyClip[1] + "px " + MyClip[2] + "px " + MyClip[3] + "px)";
   }
   else 
   {
      document.layers[DivId].clip.top = MyClip[0];
      document.layers[DivId].clip.right = MyClip[1];
      document.layers[DivId].clip.bottom = MyClip[2];
      document.layers[DivId].clip.left = MyClip[3];
   }
}

function getHeight(DivId)
{
   if(ie5 || ns6)
   return(document.getElementById(DivId).offsetHeight);
   if(ie4)
   return(document.all[DivId].clientHeight);
   if(ns4)
   return(document.layers[DivId].clip.height);
}

function getWidth(DivId)
{
   if(ie5 || ns6)
   return(document.getElementById(DivId).offsetWidth);
   if(ie4)
   return(document.all[DivId].clientWidth);
   if(ns4)
   return(document.layers[DivId].clip.width);
}

function setZ(lyr, z)
{
   layer(lyr).zIndex = z;
}
// FIN MINIBIBLIO
//JS POUR LES TITRES DES METIER

function MM_preloadImages()
{
   //v3.0
   var d = document;
   if(d.images)
   {
      if(!d.MM_p) d.MM_p = new Array();
      var i, j = d.MM_p.length, a = MM_preloadImages.arguments;
      for(i = 0; i < a.length; i++)
      if(a[i].indexOf("#") != 0)
      {
         d.MM_p[j] = new Image;
         d.MM_p[j++].src = a[i];
      }
   }
}

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];
   }
}
//-->
