// JavaScript Document

// Error handling
function killError(){
	//return true;	
}
window.onError=killError;

// Grafik-Funktion Vorschau/Vergroesserung Einzeln

function showBig(o){
	if(o.childNodes){
		if(o.childNodes[0].style.display=="none"){
			o.childNodes[0].style.display="block";
			o.childNodes[2].style.display="none";
		}else{
			o.childNodes[0].style.display="none";
			o.childNodes[2].style.display="block";	
		}
	}
}

// Grafik-Funktion Vorschau/Vergroesserung Bilderbogen

function showBigBibo(o){
	if(o.childNodes){
		if(o.childNodes[0].style.display=="none"){
			o.childNodes[0].style.display="block";
			o.childNodes[2].style.display="none";
		}else{
			o.childNodes[0].style.display="none";
			o.childNodes[2].style.display="block";	
		}
	}
}

if (document.images) {
  //Suche OK-Button
	ok  = new Image();	ok.src  = "/papstbesuch/images-m/button-ok.gif";
	oko = new Image();	oko.src = "/papstbesuch/images-m/button-ok-o.gif";
}

function iFlip() {
  	if (document.images){
    	for (var i=0; i<iFlip.arguments.length; i+=2){
    		document[iFlip.arguments[i]].src = eval(iFlip.arguments[i+1] + ".src");
		}
	}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

// Copyright Menuscript Reinecke Expertensystem GmbH
// sets the active menu items to be highlighted
// (needs the variable "mA" to be set in the page)
function setmenuA() {
  if(typeof(mA)!= "undefined"){
    if (mA !="x"){
	  if (document.all || document.getElementById){ //IE or NS6
        menact=document.getElementById("ma" + mA);
        menact.className="weiss";
      }
	}
  }
} 
// (needs the variable "mB" to be set in the page)
function setmenuB() {
  if(typeof(mB)!= "undefined"){
    if (mB !="x"){
      if (document.all || document.getElementById){ //IE or NS6
        menact=document.getElementById("mb" + mB);
        menact.className="weiss";
	  }
	}
  }
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) {
    if ((obj=MM_findObj(args[i]))!=null) {
	  v=args[i+2];
      if (obj.style) { 
	    obj=obj.style; 
	    v=(v=='show')?'visible':(v='hide')?'hidden':v; 
	  }
	} 
    obj.visibility=v; 
  }
}

function mover(){
// alert(event.x + " " + event.y);
    if ((event.x < 155) || (event.x > 300) || (event.y < 155) || (event.y > 450)){
      MM_showHideLayers('laMenu','','hide');
    }
}