var i = 1;

function show_infolayer(layer_id) {
	
	/*document.getElementById(layer_id).style.visibility = 'visible';
	
	if(i <= 90) {
		document.getElementById(layer_id).style.opacity = i/100;
		document.getElementById(layer_id).style.filter = "Alpha(opacity='"+i+"', finishopacity=0, style=0)";
		
		i += 8;
		i = Math.floor(i);
		
		if(i <= 90) window.setTimeout("show_infolayer('"+layer_id+"')",10);
	}*/
	document.getElementById(layer_id).style.visibility = 'visible';
	document.getElementById(layer_id).style.height = '420px';

}

// ---------------------------------------------------

function hide_infolayer(layer_id) {
	
	window.setTimeout("document.getElementById('"+layer_id+"').style.visibility = 'hidden';document.getElementById('"+layer_id+"').style.height = '100px';",100);
	
		/*document.getElementById(layer_id).style.opacity = i/100;
		document.getElementById(layer_id).style.filter = "Alpha(opacity='"+i+"', finishopacity=0, style=0)";
		
		i -= 20;
		i = Math.floor(i);
		
		if(i >= 0) window.setTimeout("hide_infolayer('"+layer_id+"')",20);
		else document.getElementById(layer_id).style.visibility = 'hidden';*/

}

// ---------------------------------------------------

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/glor_for_investors.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";	
	
	/*alert(document.getElementById('flash_player').style.top);*/
		

}

// ---------------------------------------------------

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 play_mp3_file(video_url,titel,bild_url,video_width,video_height) {
	
	video_width = 400;
	video_height = 310;
	
	document.getElementById('mp3_player_bg').style.visibility = "visible";
	var arrayPageSize = getPageSize('mp3_player_bg');
	var arrayPageScroll = getPageScroll();

	document.getElementById('mp3_player_bg').style.width = arrayPageSize[0] +"px";
	document.getElementById('mp3_player_bg').style.height = arrayPageSize[1] +"px";

	hideSelectBoxes();
	document.getElementById('mp3_player').style.visibility = "visible";
	
	
	frame_height = video_height + 20;
	
	document.getElementById('mp3_player').style.width = video_width +"px";
	document.getElementById('mp3_player').style.height = frame_height +"px";
	
	if(titel.length > 0) titel_mp3 = titel; else titel_mp3 = video_url;
	
	document.getElementById('mp3_player_bild').innerHTML = '<img src="' + bild_url + '" class="bilderrahmen" />';
	
	ausgabe_fuer_mp3_layer = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="275" height="50" id="mp3" align="middle">';
	ausgabe_fuer_mp3_layer += '<param name="allowScriptAccess" value="sameDomain" />';
	ausgabe_fuer_mp3_layer += '<param name="movie" value="../mp3.swf?mp3url=' + video_url + '&txt=' + titel_mp3 + '&amp;bgcolor=#ffffff&amp;txtcolor=#000000&amp;barbgcolor=#eeeeee&amp;loadbar=#e19aa7&amp;posbar=#a9213b&amp;loop=true" />';
	ausgabe_fuer_mp3_layer += '<param name="quality" value="high" />';
	ausgabe_fuer_mp3_layer += '<param name="bgcolor" value="#ffffff" />';
	ausgabe_fuer_mp3_layer += '<embed src="../mp3.swf?mp3url=' + video_url + '&txt=' + titel_mp3 + '&amp;bgcolor=#ffffff&amp;txtcolor=#000000&amp;barbgcolor=#eeeeee&amp;loadbar=#e19aa7&amp;posbar=#a9213b&amp;loop=true" quality="high" bgcolor="#ffffff" width="275" height="50" name="mp3" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
	
	document.getElementById('mp3_player_film').innerHTML = ausgabe_fuer_mp3_layer;

	var position_y = arrayPageScroll[1] + (arrayPageSize[3] / 10);
	
	document.getElementById('mp3_player').style.left = "50%";
	document.getElementById('mp3_player').style.marginLeft = "-"+ (video_width / 2 ) +"px";
	document.getElementById('mp3_player').style.top = position_y +"px";	
		

}

// ---------------------------------------------------

function hide_mp3_player() {

	document.getElementById('mp3_player_film').innerHTML = '';
	
	document.getElementById('mp3_player_bg').style.visibility = "hidden";
	document.getElementById('mp3_player').style.visibility = "hidden";
	
	showSelectBoxes();
}



