
/*

  Navigatie

*/
    // GLOBALS
  var menuTimer;

  
  var ns4=document.layers?1:0
  var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
  var ns6=document.getElementById&&!document.all?1:0
  
  var clipHeight = 35;
  var minHeight = 35;
  var mxHeight = 285;
  var inited = true;
  var step = 5;
  
  var sliderOut = false;
/* over selectie */

var overSelect = false;

function clearTimer()
{
  overSelect = true;
}

function move()
{  
  if(!sliderOut) pull();
  else realpush();

}

 function over()
 {
  if(menuTimer) 
  {
    clearTimeout(menuTimer);
  }
 }
 
function pull()
{

  if(!inited) return;
  if(menuTimer)
  {
    clearTimeout(menuTimer);
  }
  
  if (window.pushit) clearInterval(window.pushit);
  pullit=setInterval("pullengine()",10);
  
}


function push()
{
  if(!sliderOut) return;
  if(!inited) return;
  if (window.pullit) clearInterval(window.pullit);
  //alert("te laat")
  menuTimer = setTimeout('realpush()',1000);

}


function realpush()
{
  if(overSelect) return;
  pushit=setInterval("pushengine()",10);
}
//e,iTop,iRight,iBottom,iLeft

function log(str)
{
  xGetElementById("debug").innerHTML+=""+str+"<br />"
}

function pullengine()
{
  if(sliderOut) return;
  if (clipHeight<mxHeight)
  {
    //log("pull"+clipHeight)
    clipHeight+=step;
    xClip("projectslider",0, clipWidth, clipHeight, 0)
    xTop("redLine",xTop("redLine")+step);
  }  
  else if (window.pullit)
  {
    //log("pulled"+clipHeight)
    clearInterval(window.pullit);   
    sliderOut = true;
    xClip("projectslider",0, clipWidth, mxHeight, 0)
  }
  xGetElementById('arrowImg').src = "gfx/btCollapseUp.gif";
}

function pushengine()
{
  //log("pushed");
  if(!sliderOut) return;
  if (clipHeight> minHeight)
  {
    //log("pushing"+clipHeight)
    clipHeight-=step
    xClip("projectslider",0, clipWidth, clipHeight, 0)
    xTop("redLine",xTop("redLine")-step);
  }  
  else if (window.pushit)
  {
    clearInterval(window.pushit);
    sliderOut = false;
    xClip("projectslider",0, clipWidth, minHeight, 0)   
  }
  xGetElementById('arrowImg').src = "gfx/btCollapseDown.gif";
}
