/*
 * Verwendet Funktionen aus der tpl/!general/generalFunctions.js
 * und tpl/!general/admin/ajax/prototype/prototype.functions.js
 */

window.onload = setStartConfig;
var configImageGalleryPagingCount = 6;

var cust_addthis_top_mozilla = -179;
var cust_addthis_left_mozilla = -180;

var cust_addthis_top_ie = -194;
var cust_addthis_left_ie = -160;

var cust_addthis_small_top_safari = -16;

var div_overlay_hide_ids = new Array("sponsor_container","podcast_player_small","area_flash_panorama");

function setStartConfig()
{
	if (document.getElementById("content_main_text"))	setKlappText();
	if (typeof initSlideShow == "function")	
	{
		initSlideShow();
	}
	setCurrentPictureOverlay();
	getPreviousButton();
	setPageHeight(true);
}

function setPageHeight(first_call)
 {	
	page_height = 0;
	height_body = 0;
	content_height = 0;
	text_height = 0;
	height_text = 0;
	dynamic_height_text = 0;
	
	has_text_content = false;
	body_command = false;
	
	page_height = $("main_page").offsetHeight;
	height_body = $("main_page_body").offsetHeight;
	height_banner = $("area_banner").offsetHeight;
	height_bottom = $("area_bottom").offsetHeight;		
	if($("content_main_text"))
	{
		height_text = $("content_main_text").offsetHeight;
	}
	if($("content_dynamic_text"))
	{
		dynamic_height_text = $("content_dynamic_text").offsetHeight;	
	}
		
	if(first_call)
	{
		page_height = page_height + height_bottom;		
	}
	
	if(page_height < height_body)
	{
		content_height = height_body - height_banner - height_bottom;
		body_command = true;
		$("main_page_background").style.height = height_body  + "px";
	}else
	{
		$("main_page_background").style.height = page_height + height_bottom + "px";
	}	
	
	if ((!body_command || height_text > content_height || dynamic_height_text > content_height))
	{
		$("area_content").style.height ="";
	}else
	{
		$("area_content").style.height = content_height + "px";
	}
	
	window.setTimeout("setPageHeight()",30);
 }