
function init() {

  /*
  	$("#content a").mouseover(function(){
      		$(this).animate({ color: "#990100" },1000);
      	})
  $("#content a").mouseout(function(){
      		$(this).animate({ color: "#2A1870" },200);
      	})
  */
  
  $(function(){
    for (var i=1;i<6;i++) {
      if ($("#a"+i).attr("class")!='selected') {
        $("#a"+i)
          .css( {backgroundPosition: "0 -66px"} )
      }
    	$("#a"+i)
      		.mouseover(function(){
      			if ($(this).attr("class")!='selected') $(this).stop().animate({backgroundPosition:"(0 -44px)"}, {duration:200})
      		})
      		.mouseout(function(){
      			if ($(this).attr("class")!='selected') $(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:100, complete:function(){
      				$(this).css({backgroundPosition: "0 -66px"})
      			}})
      		})
      		.click(function(){
      			$(this).css({backgroundPosition:"0 -88px"});
      		})
      }
  });
}
function toggleNav(cssid) {
  var id = cssid.substring(1);
  if (document.getElementById('n'+id)) {
    var hide = 0;
    for (var i=1;i<6;i++) {
      if (document.getElementById('n'+i)) {
        var subnav = document.getElementById('n'+i);
        if (subnav.style.display=='block'&&!hide) {
          hide = 1;
          if (i==id) {
             $('#menuLock').css({display:"block"});
             //$('#a'+i).css({backgroundPosition:"0 -66px"});
             $('#n'+i).hide(200, function() { $('#menuLock').css({display:"none"}); } );
          }
          else {
             $('#menuLock').css({display:"block"});
             $('#a'+i).css({backgroundPosition:"0 -66px"});
             $('#n'+i).hide(200, function() { $('#n'+i).css({backgroundPosition:"0 -88px"}); $('#n'+id).show(200, function() { $('#menuLock').css({display:"none"}); } )} ); 
          }
        }
      }
      if (document.getElementById('a'+i)) { 
        if (i==id) {
          document.getElementById('a'+i).className='selected'; 
        }
        else {
          document.getElementById('a'+i).className='';
          $('#a'+i).css({backgroundPosition:"0 -66px"});
        }
      }
    }
    if (!hide) {
      $('#menuLock').css({display:"block"})
      $('#n'+id).show(200, function() { $('#n'+id).css({backgroundPosition:"0 -88px"}); $('#menuLock').css({display:"none"}); });
    }
    return false;
  }
}

function start(){
if(document.getElementById) {
   l1 = document.getElementById("p1").style;
}
else if(document.layers) {
   l1 = document.p1;
}
else if(document.all) {
   l1 = document.all.p1.style;
}

l1x=18;
l1xs=18;
l1y=aY[page];
l1ys=aY[page];
anpassen();
move();
}

function wh() {
if ( window.innerHeight ) return window.innerHeight;
if ( document.body.clientHeight) return document.body.clientHeight;
return -1;
}
function ww() {
if ( window.innerWidth ) return window.innerWidth;
if ( document.body.clientWidth) return document.body.clientWidth;
return -1;
}
function move(){

dy=l1ys-l1y;
if (dy>0){if (dy<1){dy=1}else {l1y=Math.ceil(l1y+dy/8)}}
else if (dy<0){
	if (dy>-1){dy=-1}else {l1y=Math.floor(l1y+dy/8)}
}

l1.top=y0+l1y+'px';
l1.left=x0+l1x+'px';

setTimeout("move()",40);
}
function anpassen(){
x0=0;y0=0;
}
function home(){aktiv=false;l1ys=aY[page];}
function out(){if (aktiv)clearTimeout(timer);aktiv=true;timer=setTimeout('home()',1500);}
function inn(nr){if (aktiv)clearTimeout(timer);aktiv=false;l1ys=aY[nr];}

/*--------------------*/
/* Completely loaded  */
/*--------------------*/
jsComplete = 1;
