/********************************************************************************
 Vorgefertigte JS-Funktionen zur Autoanpassung des Fensters
********************************************************************************/

/* 
 * resize autoget window measures
 */
var height = 0;
var width = 0;
 
function getWindowWidth() {
  if (window.innerWidth)
    return window.innerWidth;
  if (document.documentElement && document.documentElement.clientWidth)
    return document.documentElement.clientWidth;
  return 0;
}

function getWindowHeight() {
  if (window.innerHeight)
    return window.innerHeight;
  if (document.documentElement && document.documentElement.clientHeight)
    return document.documentElement.clientHeight;
  return 0;
}

function adjustResize () {
	width = getWindowWidth();
	height = getWindowHeight();
	
	// header-bild: 116px + tablemargin (10px) = 126px
	document.getElementById('contentframe').height = height - 127;
}

// event handler initialization for Netscape
if (!window.width && window.innerWidth) {
	window.onresize = adjustResize;
	width = getWindowWidth();
	height = getWindowHeight();
}


/* Event handler initialization of onresize for IE
 * we have to put this into a function and call it after the body tag was written,
 * because otherwise it won't work for IE. For Netscape this is not nessecary, so
 * we call it directly in the prebody-script block above
 */
function initAdjustResizeEventIE ()
{
	if (!window.width && document.body && document.body.offsetWidth) {
 		window.onresize = adjustResize;
		width = getWindowWidth();
		height = getWindowHeight();
	}
}


/********************************************************************************
 Menü-Hilighting
********************************************************************************/

/*
 * unhilight all menu points
 */
function unhilight ()
{
  var i=1;
  var mp = document.getElementById('mp'+i);
  
  while (mp != null)
  {  mp.className='menu';
     i++;
     mp = document.getElementById('mp'+i);
  }
}

/*
 * hilighting a menu point
 */
function hilight (obj)
{
  unhilight();
  obj.className='menu_hi';
}



/********************************************************************************
 Site in Iframe (bei Menü), Popup, oder aktuelles Frame laden
********************************************************************************/

function page (name)
{
  document.getElementById('contentframe').src = name;
}


function openwnd (url, width, height, scrollbars, properties_string)
{
  var gallerywnd;
  var ns4up = (document.layers) ? 1 : 0;
  var ie4up = (document.all) ? 1 : 0;
  var xsize = screen.width;
  var ysize = screen.height;
  
  var width=xsize;
  var height=ysize;
  var xpos=(xsize-width)/2;
  var ypos=(ysize-height)/2;
  gallerywnd = window.open(url,"",proberties_string + ",width="+width+",height="+height+",screenX="+xpos+",screenY="+ypos+",top="+ypos+",left="+xpos);
}


function openDynamicWnd(url, width, height)
{ 
  openwnd(url, width, height, 
	"scrollbars=yes,status=yes,toolbar=yes,location=yes,directories=yes,resizable=yes,menubar=yes");
}
	

function openStaticWnd(url, width, height)
{ 
  openwnd(url, width, height, 
	"scrollbars=no,status=no,toolbar=no,location=no,directories=no,resizable=no,menubar=no");
}




	
