/*

function get_style(obj,atr) --- programmed by Tyron Montgomery on 03 June 2010 --- last modified on 03 June 2010

This functions gets the value of a style attribute (atr) of an object (obj).
There is some basic error checking, but the function does not return any error values:
If the object does not exist or if the attribute string is empty or if no style value could be retreived an empty string is returned.

Firefox, safari and Chrome use window.getComputedStyle to determine style settings at runtime. Internet Explorer uses obj.currentStyle.
Opera knows both, but doesn't understand obj.currentStyle.getAttribute(atr). That's why window.getComputedStyle must be checked first in the if-statement! 

*/

function $(x)
	{
	if (!document.getElementById) return false;
	else return document.getElementById(x);
	}
	
	
//--------------------------------------------------------------------------------------------------
	

function get_style(obj,atr)
	{
	if (!obj || atr == "") return "";
	
	var sty = "";
	if (window.getComputedStyle) sty = window.getComputedStyle(obj, null).getPropertyValue(atr);
	else if (obj.currentStyle) sty = obj.currentStyle.getAttribute(atr);
	return sty;
	}
	
	
//--------------------------------------------------------------------------------------------------
	

function set_page_height()
	{
	var p = $("page");
	if (!p || !p.style) return;
	var c = $("content");
	if (!c || !c.style) return;
	
	var ph = p.offsetHeight;
	if (ph == "") return;
	
	var t = $("topButton");

	var fix = 250 + 34 + 70;
	if(ph-fix < fix*1.2)
		{
		// entire page scrolls, top-button required if page is longer than screen height
		c.style.height = "auto";
		if (!t || !t.style) return;
		if (t.offsetTop < ph-fix) t.style.visibility = "hidden";
		else t.style.visibility = "visible";
		}
	else
		{
		// only content scrolls, no top-buttn required
		c.style.height = ph - fix;
		if (!t || !t.style) return;
		t.style.visibility = "hidden";
		}
	}


//--------------------------------------------------------------------------------------------------

function show_submenu(keyword)
	{
	var mmLink = $("mm" + keyword);
	var submenu = $("sm" + keyword);
	if (!mmLink || !submenu) return;
	hide_all_submenus();
	mmLink.className = "mainmenuHere";
	submenu.style.left = String(mmLink.offsetLeft - 10) + "px";
	submenu.style.display = "block";
	menu_over();
	}
	

//--------------------------------------------------------------------------------------------------

function hide_submenu(keyword)
	{
	var mmLink = $("mm" + keyword);
	var submenu = $("sm" + keyword);
	mmLink.className = "mainmenu";
	submenu.style.left = "-500px";
	submenu.style.display = "none";
	}
	

//--------------------------------------------------------------------------------------------------
	

function menu_over()
	{
	if(hideSubmenu)
		{
		clearTimeout(hideSubmenu);
		hideSubmenu = false;
		}
	}

//--------------------------------------------------------------------------------------------------
	

function menu_out(keyword)
	{
	hideSubmenu = setTimeout(hide_all_submenus,1000);
	}

//--------------------------------------------------------------------------------------------------
	

function hide_all_submenus()
	{
	hide_submenu("Szintigraphie");
	hide_submenu("Leistungen");
	hide_submenu("Nuramed");
	hide_submenu("City");
	hide_submenu("West");
	}

//--------------------------------------------------------------------------------------------------
	

function position_header()
	{
	var pageScroll = self.pageYOffset;
	if (typeof pageScroll == "undefined") pageScroll = document.body.scrollTop;
	if (typeof pageScroll == "undefined") return;
	
	var head = document.getElementById("header");
	if (!head || !head.style) return;
	head.style.top = pageScroll;
	
	var menu = document.getElementById("mainmenu");
	if (!menu || !menu.style) return;
	menu.style.top = pageScroll + 60;
	}


//--------------------------------------------------------------------------------------------------
	

var hideSubmenu = false;

