var currentCountry=""; function dp(obj){ var str=""; for(var i in obj){ str+=i+": "+obj[i]+" " } return(str) } /** * Attention : redéfinition de méthode **/ function initGauche(){ affichepay(''); } /** * Affichage des calques associés à chaque pays * @param lePays l'identifiant du pays … afficher **/ function affichepay(lePays){ // hide the current country if (currentCountry != "") { obj=MM_findObj(currentCountry); if (obj != null) { if (obj.style) { obj.style.display = "none"; } } } // show tne selected country if(lePays != ""){ obj=MM_findObj(lePays); if (obj != null) { if (obj.style) { obj.style.display = "block"; currentCountry = lePays; } } } } function lib_bwcheck(){ //Browsercheck (needed) this.ver=navigator.appVersion this.agent=navigator.userAgent this.dom=document.getElementById?1:0 this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0 this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0; this.ie4=(document.all && !this.dom && !this.opera5)?1:0; this.ie=this.ie4||this.ie5||this.ie6 this.mac=this.agent.indexOf("Mac")>-1 this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; this.ns4=(document.layers && !this.dom)?1:0; this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5) return this } var bw=lib_bwcheck() /** * @param obj un identifiant tel que "divScroll1" * @param nest * @return un objet avec les propriétés @el, @css, @height, @width **/ function makeScrollObj(obj,nest){ nest=(!nest) ? "":'document.'+nest+'.' this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; this.height=bw.ns4?this.css.document.height:this.el.offsetHeight this.width=bw.ns4?this.css.document.width:this.el.offsetWidth return this } var myLength=0 var myPos=0 var sBlockSize = 2 //*size of scrollbar block. //----------------------------- var containerHeightTab = [0,0,0,0,0]; var barHeightTab = [0,0,0,0,0]; var pasTab = [1,1,1,1,1]; var sScrollbarTab = [null,null,null,null,null]; var isFirstTab = [true,true,true,true,true]; var divobjTab = [null,null,null,null,null]; var divobj2Tab = [null,null,null,null,null]; var myLengthTab = [0,0,0,0,0]; var iScaleTab = [0,0,0,0,0]; /** * Initialisaton des objets ScrollObj * @param _y le numéro du calque à déplacer (d'id "divContent"+y et "divScroll"+y) **/ function initBars(_y) { var sBar = new makeScrollObj('divScroll'+_y) var containerBar = new makeScrollObj('worldbuttons'+_y); containerHeightTab[_y] = eval(containerBar.height); barHeightTab[_y] = eval(sBar.height); isFirstTab[_y] = false; // @divobj est le calque contenant les liens des pays divobjTab[_y] = MM_findObj("divContent" + _y); // @divobj2 est la partie en dessous du knob divobj2Tab[_y] = MM_findObj("divScroll" + _y); if (document.getElementById || document.all) { myLengthTab[_y] = divobjTab[_y].offsetHeight } else { myLengthTab[_y] = divobjTab[_y].document.height } //**works out the scale fron the size of the scrollbar in relation to the length of the content area. iScaleTab[_y] = -(barHeightTab[_y]-sBlockSize)/(myLengthTab[_y]-containerHeightTab[_y]); } /** * Déclenché lors du survol d'un des boutons de la scrollbar * @param sDirection <0 | 1> 0 si clic en haut, 1 si clic en bas * @param y le numéro du calque à déplacer (d'id "divContent"+y et "divScroll"+y) **/ /** idem worldmap **/ function fnMoveScrollbar(sDirection,y) { if (isFirstTab[y]) initBars(y); //**if content is longer than the visible area sroll the text. if (myLengthTab[y] > containerHeightTab[y]) { // The increment is browser specific var incr = 1; if (bw.ns6) incr = 3; var myPos; //**Checks the direction the scrollbar is going in. if(sDirection == 1){ pasTab[y] += -iScaleTab[y]*incr; //z++ }else{ pasTab[y] -= -iScaleTab[y]*incr; //z-- } //**stops the scrollbar from going above or below its scrollable area. // si pasTab[y] < 0 on est arrive en bas, si pasTab[y] > (barHeightTab[y]-sBlockSize), on est arrive en haut if (pasTab[y] >= 0 && pasTab[y] <= (barHeightTab[y]-sBlockSize)) { //** amount to move content layer by. myPos = pasTab[y]/iScaleTab[y]; //**moves content layer and scrollbar. if (document.getElementById) { //**IE5 & N6 divobj2Tab[y].style["top"] = pasTab[y]+"px"; divobjTab[y].style["top"] = myPos+"px"; }else{ if(document.all) { divobj2Tab[y].style.top=pasTab[y]; divobjTab[y].style.top=myPos; }else{ //**N4 divobj2Tab[y].top=pasTab[y]; divobjTab[y].top=myPos; } } sScrollbarTab[y]=setTimeout("fnMoveScrollbar(" + sDirection +",'"+y+"')",10); } else { clearTimeout(sScrollbarTab[y]); } } }