var TIPWIDTH=400;
var TIPHEIGHT=300;
var intWindowHeight, intWindowWidth;

var objBannerAnimation=null;
var arrFunctionCalls=new Array();

var IE=document.all?1:0;

function fnNavClick (param) {
	window.location.href=param;
}

function fnShowTip(event, strText) {

  if (IE) {
    intPosX=window.event.clientX;
    intPosY=window.event.clientY;
    intPosXabs=document.body.scrollLeft;
    intPosYabs=document.body.scrollTop;
  } else {
    intPosX=event.clientX;
    intPosY=event.clientY;
    intPosXabs=window.pageXOffset;
    intPosYabs=window.pageYOffset;
  }

  if (document.getElementById ("linktip").style.visibility="hidden") {
    if (intPosX<intWindowWidth/2) {
      document.getElementById ("linktip").style.left=intPosX+intPosXabs+15;
      document.getElementById ("linktip").style.right="";
    } else {
      document.getElementById ("linktip").style.right=intWindowWidth-intPosX-intPosXabs+15;
      document.getElementById ("linktip").style.left="";
    }
    if (intPosY<intWindowHeight/2) {
      document.getElementById ("linktip").style.top=intPosY+intPosYabs+15;
      document.getElementById ("linktip").style.bottom="";
    } else {
      document.getElementById ("linktip").style.bottom=intWindowHeight-intPosY-intPosYabs+15;
      document.getElementById ("linktip").style.top="";
    }
    document.getElementById ("linktip").innerHTML=strText;
    document.getElementById ("linktip").style.visibility="visible";
  }
}


function fnHideTip () {
  document.getElementById ("linktip").style.visibility="hidden";
}


function fnChangeFlyer () {
  intCurFlyer=(intCurFlyer+1)%arrFlyers.length;
  document.getElementById ("flyerwechsel").src=arrFlyers[intCurFlyer];
}


function fnPrintMe () {

  var strPage=document.getElementsByTagName ('body')[0].innerHTML;
  strPage=strPage.substring (strPage.indexOf ('<!--  DRAW AREA ANFANG -->')+26, strPage.indexOf ('<!--  DRAW AREA ENDE -->')-1);

  document.getElementsByTagName ('body')[0].innerHTML='<STYLE type="text/css">body {font-family: Arial; text-align: justify} h1 {text-align: center;}</STYLE><H1>Mittelalterlich Phantasie Spectaculum<BR>das größte reisende Mittelalter-Kultur-Festival der Welt</H1><HR>'+strPage+'<HR><A href="javascript:location.reload()">zurück</A>';
  
  for (var dummy=document.getElementsByTagName ('img').length-1; dummy>=0; dummy--) {
    document.getElementsByTagName ('img')[dummy].parentNode.removeChild (document.getElementsByTagName ('img')[dummy]); 
  }

  for (var dummy=0; dummy<document.getElementsByTagName ('link').length; dummy++) document.getElementsByTagName ('link')[dummy].href='';
  var arrLinks=document.getElementsByTagName ('A');
  for (var dummy=0; dummy<arrLinks.length; dummy++) {
    arrLinks[dummy].href='';
    arrLinks[dummy].style.color='#000';
    arrLinks[dummy].style.textDecoration='none';
    arrLinks[dummy].style.cursor='default';
    
  }
  
}



function fnInit () {

  var blnScrollBars=false;

  if (IE) {
    intWindowWidth=document.body.clientWidth;
    intWindowHeight=document.body.clientHeight;
    if (document.body.clientWidth<(document.body.offsetWidth-10)) blnScrollBars=true;
  } else {
    intWindowWidth=window.innerWidth;
    intWindowHeight=window.innerHeight;    
    if (window.scrollMaxY) blnScrollBars=true;
  }

  if (document.getElementById ('shoutbox')) {
    document.getElementById ('shoutbox').style.left=(intWindowWidth-document.getElementById ('shoutbox').offsetWidth)/2;
    document.getElementById ('shoutbox').style.top=(intWindowWidth-document.getElementById ('shoutbox').offsetHeight)/2-200;
  }

  fnInitIdgBox ();
// Kommt erstmal raus - ist eh fast nirgends drinnen  
//  fnInitAnimation ();  
  if (blnScrollBars) document.getElementById ('menu_up_line').style.display='';

  intCurFlyer=0;

  if (document.getElementById ('flyerwechseldiv') && arrFlyers.length>0) {
    document.getElementById ('flyerwechseldiv').innerHTML='<img id="flyerwechsel" src="/pics/clearpixel.gif">';
    fnChangeFlyer ();
    intInterval=window.setInterval ("fnChangeFlyer ()",5000);
  }

  document.getElementById ("picturebar").style.height=Math.max ((document.getElementById ("content").offsetHeight-25),document.getElementById ("pictureBarAdditionals").offsetHeight);
  for (var dummy=0; dummy<arrFunctionCalls.length; dummy++) arrFunctionCalls[dummy]();

}