// Bildertausch für Zimmerseiten
function bildertausch_over(kleines_id) {
	//Quelle von großem Bild holen
	grosses_quelle = document.getElementById('bigpic').src;
	//Speichern großes Bild
	document.getElementById('bigpic_alt').src = document.getElementById('bigpic').src;
	//Kleines Bild wird gross
	document.getElementById('bigpic').src = document.getElementById(kleines_id).src;
	//großes Bild wird klein
	//document.getElementById(kleines_id).src = grosses_quelle;
}
function bildertausch_out(kleines_id) {
	//Quelle von großem Bild holen
	grosses_quelle = document.getElementById('bigpic_alt').src;
	//Großes Bild wiederherstellen
	document.getElementById('bigpic').src = document.getElementById('bigpic_alt').src;	
}

// 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="../js/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/hotel.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 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();
}