﻿function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function zentriere(layername){
	winWidth = (document.all)?document.body.clientWidth:window.innerWidth;
	winHeight = (document.all)?document.body.clientHeight:window.innerHeight;
	
	if (winWidth < 995){
		wertx = 500;
		//werty = 300;
		if(typeof(document.all) == 'object'){
			 document.all[layername].style.left = wertx+'px';
		//	 document.all[layername].style.top = werty+'px';
		 }
		 if(typeof(document.getElementById(layername)) == 'object' && typeof(document.all) != 'object'){
			  document.getElementById(layername).style.left = wertx+'px';
		//	  document.getElementById(layername).style.top = werty+'px';
		 }
		 if(typeof(document[layername]) == 'object') {
			  document[layername].left = wertx;
		//	  document[layername].top = werty;
		 }
		 if(typeof(window.opera)) {
			  document.all[layername].style.left = wertx;
		//	  document.all[layername].style.top = werty;
		 }
	}
}

function GetElementHeight (elm)
{
  if (!elm)
    return 0;

  if (document.layers)
  {
    if (!elm.height)
      elm.height = elm.clip.height;
    return elm.height;
  }
  else if (typeof(elm.style && elm.style.height) == 'number')
  {
    return elm.style.height;
  }
  else if (typeof(elm.style && elm.style.height) == 'string' && !isNaN(parseInt(elm.style.height)))
  {
    return parseInt(elm.style.height);
  }
  else if (elm.offsetHeight)
  {
    return elm.offsetHeight;
  }
  else if (typeof(elm.style && elm.style.pixelHeight) == 'number')
  {
    return elm.style.pixelHeight;
  }
  else if (elm.clientHeight)
  {
    return elm.clientHeight;
  }

  return 0;
}

function bg_height(id)
 {
	//alert(GetElementHeight(document.getElementById(id))); 
	 
  if(GetElementHeight(document.getElementById(id)) > 450){
  document.getElementById("bg_img").style.height=((GetElementHeight(document.getElementById(id)))+24)+"px"; //höhe des hg_bildes
  document.getElementById("trenner").style.height=((GetElementHeight(document.getElementById(id)))-4)+"px"; //höhe des Gelben trenners
  document.getElementById("bg_img").style.width="100%";
  }
 }
