function buildNavi()
{
  for(i=1;i<8;i++) {
    if(document.getElementById("navi-" + i).className == "active") {
      if(i > 1) {
        document.getElementById("split-" + (i-1)).style.backgroundPosition = "0px 0px";
      }
      if(i < 7) {
        document.getElementById("split-" + (i)).style.backgroundPosition = "-"+(2*(document.getElementById("split-" + (i)).style.backgroundPosition.substr(1, 2)/3))+"px 0px";
      }
    }
  }
}

function naviover(e, wl, wr)
{
  document.getElementById("navi-" + e).style.backgroundColor = "#3B7CC0";
  if((lsplit = document.getElementById("split-" + (e-1))) != null) { 
    lnavi = document.getElementById("navi-" + (e-1));
    if(lnavi.className == "active") lsplit.style.backgroundPosition = "-" + wl + "px 0px";
    else lsplit.style.backgroundPosition = "0px 0px";
  }
  if((rsplit = document.getElementById("split-" + e)) != null) {
    rnavi = document.getElementById("navi-" + (e+1));
    if(rnavi.className == "active") rsplit.style.backgroundPosition = "-" + wr + "px 0px";
    else rsplit.style.backgroundPosition = "-" + (2*wr) + "px 0px";
  }
}

function naviout(e, wl, wr)
{
  if(document.getElementById("navi-" + e).className != "active") {
    g = new Array("", "#BDDEFF", "#D6EBFF", "#CCE5FF", "#BDDEFF", "#CCE5FF", "#BDDEFF", "#D6EBFF");
    document.getElementById("navi-" + e).style.backgroundColor = g[e];
    if((lsplit = document.getElementById("split-" + (e-1))) != null) { 
      lnavi = document.getElementById("navi-" + (e-1));
      if(lnavi.className == "active") lsplit.style.backgroundPosition = "-" + (2*wl) + "px 0px";
      else lsplit.style.backgroundPosition = "-" + (3*wl) + "px 0px";
    }
    if((rsplit = document.getElementById("split-" + e)) != null) {
      rnavi = document.getElementById("navi-" + (e+1));
      if(rnavi.className == "active") rsplit.style.backgroundPosition = "0px 0px";
      else rsplit.style.backgroundPosition = "-" + (3*wr) + "px 0px";
    }
  }
}

window.onload = function(){
                  
                  var options = {
                  text:           {
                      cancel:     'Abbrechen',
                      loading:    'Laden',   
                      close:      '<span class="shortcut">B</span>eenden',
                      next:       '<span class="shortcut">W</span>eiter',
                      prev:       '<span class="shortcut">Z</span>ur&uuml;ck',
                      of:         'von'
                  },
                  keysClose:          ['b', 27],
                  keysNext:           ['w', 39],
                  keysPrev:           ['z', 37]
                  };
                                         
                  Shadowbox.init(options);
};
