// Für Kurs-Select
function start(x) {
	if(x == "no_link") {
		document.forms[0].reset();
		document.forms[0].elements[0].blur();
		return;
 	}
	//else if(x == "end")
	//top.location.href = parent.frames[1].location;
	else {
		top.location.href = x;
		document.forms[0].reset();
		document.forms[0].elements[0].blur();
	}
}
// Für Video-Select
function rubrikauswahl(x) {
	location.href = x;
}

// Loginfelder
function uservalue() {
	if (document.login.user.value == 'E-Mail-Adresse') {
		document.login.user.value = '';
	}
}
function passwortvalue() {
	if (document.login.password.value == 'Mitgliedsnummer') {
		document.login.password.value = '';
	}
}

// Für Flash-Player
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;

	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

// ---------------------------------------------------

function getPageScroll(){

	var xScroll, yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;	
	}

	arrayPageScroll = new Array(xScroll,yScroll) 
	return arrayPageScroll;
}

// ---------------------------------------------------

function showSelectBoxes(){
	var selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}
}

// ---------------------------------------------------

function hideSelectBoxes(){
	var selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "hidden";
	}
}

// ---------------------------------------------------

function play_flash_file(video_url,video_width,video_height) {
	
	document.getElementById('flash_player_bg').style.visibility = "visible";
	var arrayPageSize = getPageSize('flash_player_bg');
	var arrayPageScroll = getPageScroll();

	document.getElementById('flash_player_bg').style.width = arrayPageSize[0] +"px";
	document.getElementById('flash_player_bg').style.height = arrayPageSize[1] +"px";

	hideSelectBoxes();
	document.getElementById('flash_player').style.visibility = "visible";
	
	
	frame_height = video_height + 20;
	
	document.getElementById('flash_player').style.width = video_width +"px";
	document.getElementById('flash_player').style.height = frame_height +"px";
	
	document.getElementById('flash_player_film').innerHTML = '<script type="text/javascript" src="ufo.js"></script><embed src="mediaplayer.swf" width="'+video_width+'" height="'+video_height+'" allowscriptaccess="always" allowfullscreen="true" flashvars="width='+video_width+'&height='+video_height+'&file='+video_url+'&image=images/salsa-muenchen.gif&displayheight='+video_height+'&searchbar=false&autostart=true" />';
	

	var position_y = arrayPageScroll[1] + (arrayPageSize[3] / 10);
	
	document.getElementById('flash_player').style.left = "50%";
	document.getElementById('flash_player').style.marginLeft = "-"+ (video_width / 2 ) +"px";
	document.getElementById('flash_player').style.top = position_y +"px";	
		

}


function show_pic(pic_url,video_width,video_height) {
	
    var h = video_height;
    var w = video_width;

	document.getElementById('flash_player_bg').style.visibility = "visible";
	var arrayPageSize = getPageSize('flash_player_bg');
	var arrayPageScroll = getPageScroll();

	document.getElementById('flash_player_bg').style.width = arrayPageSize[0] +"px";
	document.getElementById('flash_player_bg').style.height = arrayPageSize[1] +"px";

	hideSelectBoxes();
	document.getElementById('flash_player').style.visibility = "visible";
	
	
	frame_height = h + 20;
	
	document.getElementById('flash_player').style.width = video_width +"px";
	document.getElementById('flash_player').style.height = frame_height +"px";
	
    document.getElementById('flash_player_film').innerHTML = '<img src="'+pic_url+'" style="width:'+w+'px; height:'+h+'px" />';

	var position_y = arrayPageScroll[1] + (arrayPageSize[3] / 10);
	
	document.getElementById('flash_player').style.left = "50%";
	document.getElementById('flash_player').style.marginLeft = "-"+ (w / 2 ) +"px";
	document.getElementById('flash_player').style.top = position_y +"px";	
		

}


// ---------------------------------------------------

function hide_flash_player() {

	document.getElementById('flash_player_film').innerHTML = '';
	
	document.getElementById('flash_player_bg').style.visibility = "hidden";
	document.getElementById('flash_player').style.visibility = "hidden";
	
	showSelectBoxes();
}

function menu_an_1()
{
	if(document.getElementById('menu_1').style.visibility == 'hidden'){
		document.getElementById('menu_1').style.visibility = 'visible';
		menu_aus_2();
		menu_aus_3();
	}else{
		document.getElementById('menu_1').style.visibility = 'hidden';
	}
}

function menu_aus_1()
{document.getElementById('menu_1').style.visibility = 'hidden';}

function menu_an_2()
{
	if(document.getElementById('menu_2').style.visibility == 'hidden'){
		document.getElementById('menu_2').style.visibility = 'visible';
		menu_aus_1();
		menu_aus_3();
	}else{
		document.getElementById('menu_2').style.visibility = 'hidden';
	}
}

function menu_aus_2()
{document.getElementById('menu_2').style.visibility = 'hidden';}

function menu_an_3()
{
	if(document.getElementById('menu_3').style.visibility == 'hidden'){
		document.getElementById('menu_3').style.visibility = 'visible';
		menu_aus_1();
		menu_aus_2();
	}else{
		document.getElementById('menu_3').style.visibility = 'hidden';
	}
}

function menu_aus_3()
{document.getElementById('menu_3').style.visibility = 'hidden';}


function menu_an_10()
{
	if(document.getElementById('menu_10').style.visibility == 'hidden'){
		document.getElementById('menu_10').style.visibility = 'visible';
		menu_aus_11();
	}else{
		document.getElementById('menu_10').style.visibility = 'hidden';
	}
}

function menu_aus_10()
{document.getElementById('menu_10').style.visibility = 'hidden';}

function menu_an_11()
{
	if(document.getElementById('menu_11').style.visibility == 'hidden'){
		document.getElementById('menu_11').style.visibility = 'visible';
		menu_aus_10();
	}else{
		document.getElementById('menu_11').style.visibility = 'hidden';
	}
}

function menu_aus_11()
{document.getElementById('menu_11').style.visibility = 'hidden';}


function clubantrag_bei_kursanmeldung()
{
	if(document.getElementById('clubantrag_bei_kursanmeldung').style.display == 'block'){
		document.getElementById('clubantrag_bei_kursanmeldung').style.display = 'none';
	}else{
		document.getElementById('clubantrag_bei_kursanmeldung').style.display = 'block';
	}
}

function paar_an()
{
	document.getElementById('partner_ueberschrift1').style.display = 'table-row';
	document.getElementById('partner_ueberschrift2').style.display = 'table-row';
	document.getElementById('partner_nachname').style.display = 'table-row';
	document.getElementById('partner_vorname').style.display = 'table-row';
	document.getElementById('partner_tel').style.display = 'table-row';
	document.getElementById('partner_email').style.display = 'table-row';
}

function paar_aus()
{
	document.getElementById('partner_ueberschrift1').style.display = 'none';
	document.getElementById('partner_ueberschrift2').style.display = 'none';
	document.getElementById('partner_nachname').style.display = 'none';
	document.getElementById('partner_vorname').style.display = 'none';
	document.getElementById('partner_tel').style.display = 'none';
	document.getElementById('partner_email').style.display = 'none';
}

