function islteIE6()
{
  if ((navigator.userAgent.indexOf("MSIE 6") >= 0) ||
      (navigator.userAgent.indexOf("MSIE 5") >= 0) ||
      (navigator.userAgent.indexOf("MSIE 4") >= 0))
    return true;
  else
    return false;
}

function makeHeaderFixed()
{
  document.getElementById("header").style.position = "fixed";
  document.getElementById("pin").src = "http://www.yogularm.de/graphics/pin-down.png";  
}

function makeHeaderScrolling()
{
  document.getElementById("header").style.position = "absolute";
  document.getElementById("pin").src = "http://www.yogularm.de/graphics/pin.png";  
}

function toggleHeaderFixed()
{            
  if (islteIE6()) return;
  
  if (document.getElementById("header").style.position == "fixed")
  {
    makeHeaderScrolling();
    document.cookie = "header=scrolling";
  }      
  else
  {
    makeHeaderFixed();
    document.cookie = "header=fixed";
  }
}

function loadHeaderFixed()
{
  if (islteIE6()) return;

  if (document.cookie.indexOf("header=fixed") > -1) makeHeaderFixed();       
          
  document.getElementById("pin").style.display = "block";
  
  /*if (location.hash != "")
  {
    var y;
    
    if (document.anchors[document.hash])
      y = document.anchors[document.hash].y;
    else if (document.getElementById(location.hash))
      y = document.getElementById(location.hash).style.y;     
      
    window.scrollTo(0, y-110);
  }*/
}
