function document_write(text)
{
	document.write(text);
}

function restore_flashes() {
	var $objects_to_redraw = $j('object').parent().not('.no-redraw');
	$objects_to_redraw.each(function(){
		//alert("test");
		this.innerHTML = this.innerHTML;
	});
}

$j(function(){
	setTimeout(restore_flashes, 200);
});


function window_height () {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.body && document.body.offsetHeight) {
    return document.body.offsetHeight;
  } else {
    return 0;
  }
}


$j(document).ready(function()
{
	setTimeout(place, 200);
});

function place_home_button_on_bottom()
{
	//alert($j("#white_bg").height());
	$j("#home_button").css({"top":"auto","bottom":"0"});	
	
	home_y = $j("#white_bg").height()+135;
	
	//alert($j("#white_bg").height());
	//alert($j("#home_button")[0].offsetTop);
	
	if ($j("#bottom_navi").length)
		home_y += 20;
		
	if (typeof($j("#home_button")[0]) == "undefined")
		return;
	
	if (home_y > $j("#home_button")[0].offsetTop)
	{
		$j("#home_button").css("top",home_y);
	}
	else
	{
		$j("#home_button").css({"top":"auto","bottom":"0"});	
	}

}

function place()
{

	
	
	if($j("#divContentWithBorder").length)
	{
		//alert("test");
		//alert($j("#divContentWithBorder")[0].offsetHeight);
	}
	
	if ($j("#InlineSlots2").length && typeof($j("#InlineSlots2")[0].className) != "undefined")
	{

		//place_home_button_on_bottom();
		$j(window).bind("resize",place_home_button_on_bottom);
		return;
	}
	
	if (typeof($j("#white_bg")[0]) != "undefined") 
	{
		//bg_height = $j("#white_bg")[0].offsetTop+$j("#white_bg").height();
		
		var max_y = 0;
		
		var items = $j(".BlockContainer").add("#divContentWithBorder");
		
		items.each(function()
		{
			new_height = this.offsetHeight+this.offsetTop-$j("#white_bg")[0].offsetTop;
			
			my_max_y = this.offsetHeight + this.offsetTop;
			
			if (this.id == "InlineSlots2")
			{
				//alert("test");
				
				my_max_y -= 8;
			}
			
			if (max_y < my_max_y)
			{
				//alert(this.id);
				max_y = my_max_y
			}
	
		});
		
		if ($j("#divContentWithBorder").length && $j("#divContentWithBorder").height() > max_y)
		{
			max_y = $j("#divContentWithBorder").height()+$j("#divContentWithBorder")[0].offsetTop+8;
		}
			
		
		max_y -= $j("#white_bg")[0].offsetTop;
		//alert($j("#white_bg")[0].offsetTop);
		
		//max_y -= 17;
		max_y += 8;
		
		
		if ($j('#IdbIframe').length)
		{
			max_y -= 8;
		}
		
		//alert($j(".GroupSmalls").length);
		
		if ($j(".GroupSmalls").length)
		{
			max_y +=4;
		}
		// Technologie->wenn Groupsmalls mehrzeilig ist
		//if($j(".GroupSmalls").length>0)
		//	max_y += $j(".GroupSmalls")[0].offsetHeight-120;
		
		//alert(max_y);
		if (max_y && $j("#white_bg").height() < max_y)
			$j("#white_bg").css("height",max_y);
	}
	//place_home_button();
	
	//$j(window).bind("resize",place_home_button);
}
