function openLightbox(id) {
    // Abmessungen des kompletten Fensters ermitteln
	var windowWidth = 0, windowHeight = 0, boxWidth = 0, boxHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
		// Non-IE
		windowWidth = window.innerWidth;
		windowHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	}
	
	// Abmessungen der Box ermitteln
	boxWidth = document.getElementById('lightbox-content'+id).offsetWidth;
	boxHeight = document.getElementById('lightbox-content'+id).offsetHeight;
	
	closeboxWidth = document.getElementById('lightbox-closebutton').offsetWidth;
	
	document.getElementById('lightbox-content'+id).style.left = (Math.round((windowWidth/2) - (boxWidth/2))) + 'px';
	document.getElementById('lightbox-content'+id).style.top = (Math.round((windowHeight/2) - (boxHeight/2))) + 'px';
	document.getElementById('lightbox-closebutton').style.left = (Math.round((windowWidth/2) + (boxWidth/2) - closeboxWidth)) + 'px';
    	document.getElementById('lightbox-closebutton').style.top = (Math.round((windowHeight/2) - 12 - (boxHeight/2))) + 'px';
	
	document.getElementById('lightbox-background').style.visibility = "visible";
	document.getElementById('lightbox-closebutton').style.visibility = "visible";
	document.getElementById('lightbox-content'+id).style.visibility = "visible";
	
	if(id == 0) {
		$f(0).play();
	} else {
		$f(id-1).play();
	}
}

function closeLightbox() {
	document.getElementById('lightbox-background').style.visibility = "hidden";
	document.getElementById('lightbox-closebutton').style.visibility = "hidden";

	var counter = 0;
	while (counter <= 10) {
		// Player anhalten
		if($f(counter)) {
			$f(counter).stop();
		}
		
		// Playerfenster schließen
  		if(document.getElementById('lightbox-content'+counter)) {
			document.getElementById('lightbox-content'+counter).style.visibility = "hidden";
		}
  		counter++;
	}
}
