function Tab(B,D){var H=-1;var J=B;var G=document.getElementById(J+"_content");var z=0;var I=this;var C=new Array();var O=0;var w=document.createElement("div");var v=document.createElement("div");var E="";if(!document.getElementById(J).getElementsByTagName("ul").length){E=document.createElement("ul");E.id=J+"_ul"}else{E=document.getElementById(J+"_ul")}w.id=J+"_crop";v.id=J+"_slide";this.tabWidth=146;this.sideOffset=20;this.maxVisibleTags=5;this.onchangetab=function(){};this.allTabsDeleted=function(){};if(!ie4){w.setAttribute("class","tab_ul_crop");v.setAttribute("class","tab_ul_slide")}else{w.setAttribute("className","tab_ul_crop");v.setAttribute("className","tab_ul_slide")}w.appendChild(v);v.appendChild(E);document.getElementById(B+"_tabs").appendChild(w);if(D){var L=document.createElement("div");var y=document.createElement("div");if(!ie4){L.setAttribute("class","dashboard_move_tab_sx");y.setAttribute("class","dashboard_move_tab_dx")}else{L.setAttribute("className","dashboard_move_tab_sx");y.setAttribute("className","dashboard_move_tab_dx")}L.setAttribute("title","Visualiser l'onglet pr\351c\351dent");y.setAttribute("title","Visualiser l'onglet suivant");document.getElementById(J+"_tabs").style.backgroundPosition=this.sideOffset+"px 0px";L.onclick=N;y.onclick=K;w.parentNode.insertBefore(L,w);document.getElementById(B+"_tabs").appendChild(y)}var F=E.getElementsByTagName("li");this.getNumTabs=function(){return C.length};this.getAvailableId=function(){return H};this.getSelectedTabId=function(){for(var b=0;b<F.length;b++){if(F[b].className=="selected"){var d=new RegExp("[0-9]+$");var c=d.exec(C[b]);var a="";for(b=0;b<c.length;b++){a=a-c[b]}return a}}return""};this.getTabsId=function(){var b=new Array();for(var a=0;a<F.length;a++){var d=new RegExp("[0-9]+$");var c=d.exec(C[a]);var e="";for(j=0;j<c.length;j++){e=e+c[j]}b[a]=e}return b};function A(b){for(var a=0;a<F.length;a++){F[a].className="";if(C[a]){document.getElementById(C[a]).style.display="none"}}b.parentNode.parentNode.className="selected";document.getElementById(b.getAttribute("rel")).style.display="block";z=b.parentNode.id}function x(a){C[C.length]=a}function M(b){var a=E.removeChild(document.getElementById(b));E.appendChild(a)}this.Init=function(){var b=0;if(arguments.length==1){b=parseInt(arguments[0])}C.length=0;for(var a=0;a<F.length;a++){var c=F[a].getElementsByTagName("a")[0];if(c.getAttribute("rel")){x(c.getAttribute("rel"));c.onclick=function(){A(this);I.onchangetab();return false}}}if(F.length>0){A(F[F.length-1].getElementsByTagName("a")[0]);O=((F.length-this.maxVisibleTags)>0)?(F.length-this.maxVisibleTags):0;this.shift(O,Tab.LEFT)}};this.addTab=function(b,c,k,a){var g=document.createElement("div");var f=document.createElement("li");var d=document.createElement("a");var h=document.createElement("div");var i=document.createElement("div");var e=H++;d.href="#";d.title=b;d.rel=J+"_content_"+e;f.id=J+"_tab_"+e;if(ie4){f.onClick=k}else{f.onclick=k}if(a){if(!ie4){h.setAttribute("class","close_tab");d.setAttribute("style","vertical-align:middle; cursor:pointer; float:left;")}else{h.setAttribute("className","close_tab");d.setAttribute("cssText","vertical-align:middle; cursor:pointer; float:left;")}h.setAttribute("title","Fermer l'onglet "+b);h.onclick=a;d.innerHTML=((b.length>15)?(b.substr(0,12)+"..."):b)+"&nbsp;&nbsp;";i.appendChild(d);i.appendChild(h)}else{d.innerHTML=((b.length>21)?(b.substr(0,19)+"..."):b)+"&nbsp;&nbsp;";i.appendChild(d)}f.appendChild(i);E.appendChild(f);g.id=d.rel;g.setAttribute("class","tabcontent");g.innerHTML=c;G.appendChild(g);this.Init()};this.includeTab=function(b,c,k,a){var g=document.createElement("div");var f=document.createElement("li");var d=document.createElement("a");var h=document.createElement("div");var i=document.createElement("div");var e=H++;d.href="#";d.title=b;d.rel=c;f.id=J+"_tab_"+e;if(ie4){f.onClick=k}else{f.onclick=k}if(a){if(!ie4){h.setAttribute("class","close_tab");d.setAttribute("style","vertical-align:middle; cursor:pointer; float:left;")}else{h.setAttribute("className","close_tab");d.setAttribute("cssText","vertical-align:middle; cursor:pointer; float:left;")}h.setAttribute("title","Chiudi "+b);h.onclick=a;d.innerHTML=((b.length>15)?(b.substr(0,12)+"..."):b)+"&nbsp;&nbsp;";i.appendChild(d);i.appendChild(h)}else{d.innerHTML=((b.length>21)?(b.substr(0,19)+"..."):b)+"&nbsp;&nbsp;";i.appendChild(d)}f.appendChild(i);E.appendChild(f);this.Init()};this.removeTab=function(a){if(a=="all"){while(E.childNodes.length>=1){E.removeChild(E.firstChild)}while(G.childNodes.length>=1){G.removeChild(G.firstChild)}}else{E.removeChild(document.getElementById(J+"_tab_"+a));G.removeChild(document.getElementById(J+"_content_"+a));C[a]=null;F=E.getElementsByTagName("li")}this.Init()};this.shift=function(b,a){if(a==Tab.LEFT){v.style.marginLeft="-"+(b*this.tabWidth)+"px"}else{if(a==Tab.RIGHT){v.style.marginLeft=(b*this.tabWidth)+"px"}}};function N(){I.shift(((F.length>5)?++O:0),Tab.LEFT)}function K(){I.shift(((F.length>5)?--O:0),Tab.LEFT)}this.getTabContents=function(){return C};this.getTabTitles=function(){var d=new Array();var e=w.getElementsByTagName("div");var c=e.length;for(var a=0;a<c;a++){var b=e[a];add=false;if(!ie4){if(b.getAttribute("class")=="close_tab"){add=true}}else{if(b.getAttribute("className")=="close_tab"){add=true}}if(add){d.push(b.getAttribute("title").replace("Fermer l'onglet ",""))}}return d}}Tab.LEFT=-1;Tab.RIGHT=1;