var stepHide = 10;var stepShow = 5;var delay = 2;var current = 0;function hidePage(id) {  var reg = new RegExp("(px)", "g");  myDiv = 'content' + id;  if (document.getElementById(myDiv)) {    myHeightStr = document.getElementById(myDiv).style.height;    myHeight = parseInt(myHeightStr.replace(reg,""));    myHeight-=stepHide;    if (myHeight < 0) myHeight = 0;    myHeightStr = myHeight + 'px';    document.getElementById(myDiv).style.height = myHeightStr;    if (myHeight > 0)      setTimeout('hidePage('+id+')',delay);    else {      myBottom = 'menubottom' + id;      document.getElementById(myBottom).style.borderTop = '0px solid';    }  }}function showPage(id,rgb) {  myBottom = 'menubottom' + id;  if (document.getElementById(myBottom)) {    document.getElementById(myBottom).style.borderTop = '2px solid ' + rgb;    var reg = new RegExp("(px)", "g");    myContent = 'contentmain' + id;    myMaxStr = document.getElementById(myContent).style.height;    myMax = parseInt(myMaxStr.replace(reg,""));    myDiv = 'content' + id;    myHeightStr = document.getElementById(myDiv).style.height;    myHeight = parseInt(myHeightStr.replace(reg,""));    myHeight+=stepShow;    if (myHeight > myMax) myHeight = myMax;    myHeightStr = myHeight + 'px';    document.getElementById(myDiv).style.height = myHeightStr;    if (myHeight < myMax) {      if (current == id)        setTimeout('showPage('+id+',\''+rgb+'\')',delay);      else        hidePage(id);    }  }}function processPage(id,rgb) {  hidediv('message');  if (current != id) {    for (i=2; i<arguments.length-1; i++){      hidePage(arguments[i]);    }    current = id;    showPage(id,rgb);    if(pageTracker && arguments[arguments.length-1]!="") pageTracker._trackPageview(arguments[arguments.length-1]);  }  else {    current = 0;    hidePage(id);  }}function processTimeout(id,rgb,pdelay) {  setTimeout('processPage('+id+',"'+rgb+'","")',pdelay);}function hidediv(myId) {    if (document.getElementById) { // DOM3 = IE5, NS6      if (document.getElementById(myId)) document.getElementById(myId).style.visibility = 'hidden';    }    else {        if (document.layers) { // Netscape 4          if (document.layer[myId]) document.layer[myId].visibility = 'hidden';        }        else { // IE 4          if (document.all[myId]) document.all[myId].style.visibility = 'hidden';        }    }}function showdiv(myId) {    if (document.getElementById) { // DOM3 = IE5, NS6        if (document.getElementById(myId)) document.getElementById(myId).style.visibility = 'visible';    }    else {        if (document.layers) { // Netscape 4          if (document.layer[myId]) document.layers[myId].visibility = 'visible';        }        else { // IE 4          if (document.all[myId]) document.all[myId].style.visibility = 'visible';        }    }}// Ajaxvar delayPresentation = 60000;var delayPresentationActive = 3000;function checkPresentationProcess(idPresentation) {    var xReq=getXmlHttpRequest();    url = "http://localhost/fastboil/www.fastboil.net/www/fastboil.php?fct=checkp&i="+idPresentation;    xReq.open("GET",url,true);    xReq.onreadystatechange = function(){                                  if(xReq.readyState  == 4) {                                      if(xReq.status  == 200) {                                          if(xReq.responseText==1) {                                              checkPageProcess(idPresentation);                                              setTimeout("checkPresentationProcess("+idPresentation+")",delayPresentationActive);                                          }                                          else                                              setTimeout("checkPresentationProcess("+idPresentation+")",delayPresentation);                                      }                                  }                              };    xReq.send(null);}var idPresentationPage=0;function checkPageProcess(idPresentation){    url = "http://localhost/fastboil/www.fastboil.net/www/fastboil.php?fct=getppp&i="+idPresentation;    var xReq=getXmlHttpRequest();    xReq.open("GET",url,true);    xReq.onreadystatechange = function(){                                  if(xReq.readyState  == 4) {                                      if(xReq.status  == 200) {                                          idprocessed = xReq.responseText;                                          if(idprocessed!=idPresentationPage) {                                              idPresentationPage = idprocessed;                                              url = "http://localhost/fastboil/www.fastboil.net/www/fastboil.php?fct=dpp&i="+idPresentation+"&pp="+idprocessed;                                              presGetUrlDiv('presentation_content',url,idPresentation);                                          }                                      }                                  }                              };    xReq.send(null);}function presGetUrlDiv(id,url,idPresentation) {    var xReq=getXmlHttpRequest();    var obj=document.getElementById(id);    xReq.open("GET",url,true);    xReq.onreadystatechange=function(){presEventGetUrlDiv(xReq,id,idPresentation);};    xReq.send(null);}function presEventGetUrlDiv(xRequest,anId,idPresentation) {    if (xRequest.readyState==4) {        document.getElementById(anId).innerHTML=xRequest.responseText;    }}function processpresentation(url) {    fbGetUrlDiv('presentation_content',url,'');}function processpage(url) {    fbGetUrlDiv('presentation_content',url,'');}function presentationpage(url,idCurrentPage) {    idPresentationPage = idCurrentPage;    fbGetUrlDiv('presentation_content',url,'');}function fbGetUrlDiv(id,url,innerhtml) {    var xReq=getXmlHttpRequest();    var obj=document.getElementById(id);    if (innerhtml!='') fbShowWaiting(obj,innerhtml);    xReq.open("GET",url,true);    xReq.onreadystatechange=function(){fbEventGetUrlDiv(xReq,id);};    xReq.send(null);    if(pageTracker) pageTracker._trackPageview(url);}function fbEventGetUrlDiv(xRequest,anId) {    if (xRequest.readyState==4) {        document.getElementById(anId).innerHTML=xRequest.responseText;        if (anId=='contentmainbody1') {    var instanceOne = new ImageFlow();    instanceOne.init({ ImageFlowID:'myImageFlow' });        }    }    setLayout();}function fbShowWaiting(obj,innerhtml) {    obj.innerHTML=innerhtml;}function getXmlHttpRequest() {    if (window.XMLHttpRequest) // Firefox    {       return(new XMLHttpRequest());    }    else if (window.ActiveXObject) // Internet Explorer    {        try        {            return(new ActiveXObject("Msxml2.XMLHTTP"));        }        catch (e)        {            try            {                return(new ActiveXObject("Microsoft.XMLHTTP"));            }            catch (e)            {                alert("Your browser does not support XMLHTTPRequest...");            }        }    }    else    { // XMLHttpRequest non supporté par le navigateur       alert("Your browser does not support XMLHTTPRequest...");    }}function fbSendAjaxFormTargetDiv(idForm,baseurl,targetId,innerhtml) {    var xReq=getXmlHttpRequest();    var i;    var url="";    var myForm=document.getElementById(idForm);    if (myForm) {        var first=true;        for(i=0;i<myForm.elements.length;i++) {            var elmt=myForm.elements[i];            var type=elmt.nodeName.toLowerCase();            var ok=true;            if (type=="input") {                switch (elmt.type.toLowerCase()) {                case "radio":                case "checkbox":                    if (!elmt.checked) ok=false;                    break;                case "submit":                case "image":                    ok=false;                    break;                }            }            else if ((type!="select") && (type!="textarea")) ok=false;            if (ok) {                if (first) first=false;                else url+="&";                url+=elmt.name+"="+elmt.value.replace(/%/g,"%25").replace(/&/g,"%26").replace(/=/g,"%3D").replace(/ /g,"%20");            }        }    }    var obj=document.getElementById(targetId);    if (innerhtml!='') fbShowWaiting(obj,innerhtml);    xReq.open("POST",baseurl,true);    xReq.onreadystatechange=function(){fbEventGetUrlDiv(xReq,targetId);};    xReq.setRequestHeader("Content-type","application/x-www-form-urlencoded");    xReq.send(url);}// Slider text - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var slider = new Array();// scroll the element vertically based on its width and the slider maximum valuefunction scrollVertical(value, element, nom) {  element.scrollTop = Math.round(value*slider[nom].scrollMax);}function monter(nom) {  slider[nom].setValueBy(-40/slider[nom].scrollMax);}function descendre(nom) {  slider[nom].setValueBy(40/slider[nom].scrollMax);}// mouse wheel code from http://adomas.org/javascript-mouse-wheel/function handle(delta,nom) {  slider[nom].setValueBy(-(delta*60)/slider[nom].scrollMax);}function initSlider0(adiv) {  var max = $(adiv+'_main').scrollHeight-$(adiv+'_main').offsetHeight;  s = new Control.Slider('contentText_slider_ascenseur', 'contentText_slider_chemin', {    axis: 'vertical',    onSlide: function(v) { scrollVertical(v, $(adiv+'_main'), 'contentText');  },    onChange: function(v) { scrollVertical(v, $(adiv+'_main'), 'contentText'); }  });  s.scrollMax = max;  slider['contentText']=s;}function wheel0(event) {  var delta = 0;  if (!event) /* For IE. */    event = window.event;  if (event.wheelDelta) { /* IE/Opera. */    delta = event.wheelDelta/120;  /** In Opera 9, delta differs in sign as compared to IE. */  if (window.opera)    delta = -delta;  }  else if (event.detail) { /** Mozilla case. */    /** In Mozilla, sign of delta is different than in IE.      * Also, delta is multiple of 3. */    delta = -event.detail/3;  }/** If delta is nonzero, handle it.  * Basically, delta is now positive if wheel was scrolled up,  * and negative, if wheel was scrolled down. */  if (delta)    handle(delta,'contentText');/** Prevent default actions caused by mouse wheel.  * That might be ugly, but we handle scrolls somehow  * anyway, so don't bother here..  */  if (event.preventDefault)    event.preventDefault();  event.returnValue = false;}function initMouseWheel0(adiv) {  // mozilla  Event.observe(adiv+'_main', 'DOMMouseScroll', wheel0);  // IE/Opera  Event.observe(adiv+'_main', 'mousewheel', wheel0);}function initAscenseur(adiv) {  if ($(adiv+'_main').scrollHeight > $(adiv+'_main').offsetHeight) {    $(adiv+'_slider').style.display='block';    divTexte = $(adiv+'_main');    largeur = divTexte.offsetWidth;    largeur2 = largeur-10;    divTexte.style.width = largeur2+'px';    initSlider0(adiv);    initMouseWheel0(adiv);  }}// Scroll menus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var margin, timeout;var initScroll = new Array();var posOrigin = 10000;var scrolling;function scrollTopp(myDiv,longScroll,offset,init) {  if (initScroll[myDiv]==null) initScroll[myDiv]=init;  scrolling = initScroll[myDiv];  if(scrolling >= 5) {    //document.getElementById(myDiv).style.marginTop = "-"+(scrolling--)+"px";    document.getElementById(myDiv).style.marginTop = "-"+(scrolling-=5)+"px";    initScroll[myDiv] = scrolling;  }  else {    return;  }  if(longScroll == true) {    timeout = setTimeout("scrollTopp('"+myDiv+"',true,"+offset+","+init+")", 5);  }}function scrollBottom(myDiv,longScroll,offset,init) {  if (initScroll[myDiv]==null) initScroll[myDiv]=init;  scrolling = initScroll[myDiv];  if(scrolling < (document.getElementById(myDiv).offsetHeight-offset)) {    //document.getElementById(myDiv).style.marginTop = "-"+(scrolling++)+"px";    document.getElementById(myDiv).style.marginTop = "-"+(scrolling+=5)+"px";    initScroll[myDiv] = scrolling;  }  else {    return;  }  if(longScroll == true) {    timeout = setTimeout("scrollBottom('"+myDiv+"',true,"+offset+","+init+")", 5);  }}window.onresize = function(){ setLayout(); };//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// function// Object :// FASTBOIL 1.0 21/09/2010// http://www.fastboil.net// hot@fastboil.net//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function setLayout() {  if (self.innerHeight) { // all except Explorer      h = self.innerHeight;      w = self.innerWidth;  }  else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode      h = document.documentElement.clientHeight;      w = document.documentElement.clientWidth+17;  }  else if (document.body) { // other Explorers      h = document.body.clientHeight;      w = document.body.clientWidth;  }  newHeight = h;  newWidth = (w-217);  if (document.getElementById('theimage')) {      if (document.getElementById('theimage').offsetHeight > h) {          newHeight = document.getElementById('theimage').offsetHeight;      }      if (document.getElementById('theimage').offsetWidth > (w-217)) {          newWidth = document.getElementById('theimage').offsetWidth;      }  }  if (document.getElementById('pres_right_div')) {      document.getElementById('pres_right_div').style.height = newHeight+'px';      document.getElementById('pres_right_div').style.width = newWidth+'px';  }}
