function closePictureBox() {
	document.getElementById('pictureBox').style.visibility = 'hidden';
}

var Bild;
var mausX;
var mausY;

function showPictureBox () {

	tMausX = mausX - Bild.width / 2;
	tMausY = mausY - (Bild.height / 2);

	document.getElementById('pictureBox').style.left = tMausX;
	document.getElementById('pictureBox').style.top  = tMausY;

	document.getElementById('pictureBox').style.height= Bild.height+30;
	document.getElementById('pictureBox').style.width = Bild.width;	
	

	document.getElementById('pictureBox').innerHTML = "<div id=\"pictureBoxHeadline\"><a href=\"javascript:closePictureBox()\">Schliessen</a></div><img name=\"pictureBoxPicture\" onclick=closePictureBox() src=" + Bild.src +">";
	document.getElementById('pictureBox').style.visibility = 'visible';
}


function showLadeBox () {
	tMausX = mausX-70;
	tMausY = mausY-60;

	document.getElementById('pictureBox').style.left = tMausX;
	document.getElementById('pictureBox').style.top  = tMausY;

	document.getElementById('pictureBox').style.height= 20;
	document.getElementById('pictureBox').style.width = 100;	

	document.getElementById('pictureBox').innerHTML = "<div style=\"background: #ffffff; height: 20px; width: 100px;\"><img name=\"pictureBoxPicture\" onclick=closePictureBox() src='http://www.med-music-school.com/Bibliothek/JavaScript/loading.gif'></div>";
	document.getElementById('pictureBox').style.visibility = 'visible';
}


function bildLadePuffer() {
		
	if (Bild.complete) {
		showPictureBox();
	} else {
		setTimeout("bildLadePuffer()", 100);
	}

}

function loadPictureBox(event, bildUrl) {

	var docEl = (
             typeof document.compatMode != "undefined" && 
             document.compatMode        != "BackCompat"
            )? "documentElement" : "body";

	if(!event)event=window.event;
	
	mausX = event.clientX + document[docEl].scrollLeft;
	mausY = event.clientY + document[docEl].scrollTop;; 

	Bild = new Image();
	Bild.src = bildUrl;

 showLadeBox();
	bildLadePuffer();	
}

