// JavaScript Document
function get( ID ) {
	return	document.getElementById( ID );	
}
VisibleNavs		=	Array();
CurrentNavs		=	Array();
ABSTAND			=	16;		// Abstand, wie viel PX ueberlagert werden
function showDiv( ID ) {
	if( Div = get( ID ) ) {
		Div.style.display	=	"";	
	}
}
function hideDiv( ID ) {
	if( Div = get( ID ) ) {
		Div.style.display	=	"none";	
	}
}
function addNav() {
	CurrentNavs	=	addNav.arguments;
	checkNav();
}
function remNav() {
	CurrentNavs	=	Array();	
	setTimeout( "checkNav()", 100 );
}
function checkNav() {
	for( i=0; i<VisibleNavs.length; i++ ) {
		if( getIndexOf( CurrentNavs, VisibleNavs[ i ] ) == -1 ) {
			hideDiv( "nav" + VisibleNavs[ i ] );	
		}
	}
	PreNav	=	0;
	for( i=0; i<CurrentNavs.length; i++ ) {
		Left	=	get( "NAVIGATION" ).offsetWidth - ABSTAND;
		if( Div = get( "nav" + PreNav ) ) {
			Left	=	parseInt( Div.offsetWidth - ABSTAND );
		}
		if( Div = get( "nav" + CurrentNavs[ i ] ) ) {
			Div.style.left	=	Left + "px";
			showDiv( "nav" + CurrentNavs[ i ] );
			PreNav	=	CurrentNavs[ i ];
		}
	}
	VisibleNavs	=	CurrentNavs;
}
function getIndexOf( Arr, Wert ) {
	for( count=0; count<Arr.length; count++ ) {
		if( Arr[ count ] == Wert ) {
			return	count;
		}
	}
	return -1;
}
function hideVideo( ID ) {
	hideDiv( "FLASHVIDEO" + ID );
	hideDiv( "GREY" );
	if( Vid = get( "player" + ID ) ) {
		Vid.sendEvent("STOP","true");
	}
}
function showVideo( ID ) {
	showDiv( "FLASHVIDEO" + ID );
	main	=	document.getElementById('MAIN');
	height	= 	main.offsetHeight;	
	grey	=	document.getElementById('GREY');
	grey.style.height	=	height + "px";	
	showDiv( "GREY" );	
	if( Vid = get( "player" + ID ) ) {
		Vid.sendEvent("PLAY","true");
	}
}
var	Players	=	Array();
function playerReady(thePlayer) {
	Players[ thePlayer.id ]	=	window.document[ thePlayer.id ];
}
function createPlayer( ID, PlaceHolder, File, Breite, Hoehe ) {
	var flashvars = {
		file:File, 
		autostart:"true"
	}

	var params = {
		allowfullscreen:"true", 
		allowscriptaccess:"always"
	}

	var attributes = {
		id:ID,  
		name:ID
	}
	swfobject.embedSWF("videos/mediaplayer.swf", PlaceHolder, Breite, Hoehe+20, "9", false, flashvars, params, attributes);
}
function recommend( nav, lan, org ) {
	var	fenster	=	window.open("empfehlen.asp?navid="+nav+"&lid="+lan+"&oid="+org+"", "fenster", "width=350,height=380,scrollbars=no,menubar=no,resizable=no,status=no,toolbar=no,dependent=yes" );
}
//---------------------------------------------------------------------------------------------------
function printwindow() {
	content	=	document.getElementById( 'CONTENT' );
	tarea	=	document.getElementById( 'printhtml' );
	try {
		tarea.value	=	content.innerHTML;
	}
	catch( e ) {
		tarea.value =	document.body.innerHTML;
	}
	document.printarea.submit();
}
