// JavaScript Document
function grossesBildLaden (bild,id) {
 var grossesBild = new Image()
 grossesBild.src = bild;
 var bildPlatzhalter = document.getElementById(id);
 bildPlatzhalter.src = grossesBild.src;
 bildPlatzhalter.height = grossesBild.height;
 bildPlatzhalter.width = grossesBild.width;
}

function MenuFunc()
{
	var apNaviIcon = false;
	var apNavi = false;
	var event = false;
	
	this.init = function()
	{
		_this = this;
		
		this.apNaviIcon = document.getElementById('apNaviIcon');
		this.apNavi = document.getElementById('apNavi');
		this.addEvent(this.apNaviIcon, 'mouseover' , this.delegate( _this, _this.sichtbar));
	}
	
	this.sichtbar = function()
	{
		_this = this;
		this.apNavi.style.display="block";
		this.event = this.delegate( _this, _this.unsichtbar );
		this.addEvent( this.apNaviIcon, 'mouseout' ,  this.event );
	}

	this.unsichtbar = function ()
	{
		this.apNavi.style.display="none";
	}
	
	this.delegate = function( that, thatMethod )
	{
		return function() { return thatMethod.call(that); }
	}
	
	this.addEvent = function( obj, type, fn   )
	{
	   if (obj.addEventListener) {
	      obj.addEventListener( type, fn, false );
	   } else if (obj.attachEvent) {
	      obj["e"+type+fn] = fn;
	      obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
	      obj.attachEvent( "on"+type, obj[type+fn] );
	   }
	}
	
	this.removeEvent = function( obj, type, fn )
	{
	   if (obj.removeEventListener) {
	      obj.removeEventListener( type, fn, false );
	   } else if (obj.detachEvent) {
	      obj.detachEvent( "on"+type, obj[type+fn] );
	      obj[type+fn] = null;
	      obj["e"+type+fn] = null;
	   }
	}
}

function initMenu()
{	
	mF.init();
}

var mF = new MenuFunc();
mF.addEvent( window, 'load', initMenu );


mF.addEvent( window, 'load', preload );

function preload(){
	icon1 = new Image();
	icon1.src = "Bilder/link-icon-hover.gif"; 
	
	icon2 = new Image();
	icon2.src = "Bilder/pdf-icon-hover.gif"; 
	
	icon3 = new Image();
	icon3.src = "Bilder/tnailIcon-hover.gif";
	
	icon4 = new Image();
	icon4.src = "Bilder/uebersicht-icon-hover.gif";
	
	icon5 = new Image();
	icon5.src = "Bilder/uebersicht-tnail-icon-hover.gif";
	
	icon6 = new Image();
	icon6.src = "Bilder/weiter-pfeil-hover.gif";
	
	icon7 = new Image();
	icon7.src = "Bilder/zurueck-pfeil-hover.gif";
	
	ap1 = new Image();
	ap1.src = "Bilder/ap_bodo1.jpg";
	
	ap2 = new Image();
	ap2.src = "Bilder/ap_bodo2.jpg";
	
	ap3 = new Image();
	ap3.src = "Bilder/ap_bodo3.jpg";
}