function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('maintable').offsetHeight;
			var footerElement = document.getElementById('pagefoot');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight + 125) >= 0) {
				footerElement.style.position = 'relative';
				footerElement.style.top = (windowHeight - (contentHeight + footerHeight + 125)) + 'px';
			}
			else {
				footerElement.style.position = 'static';
			}
		}
	}
}

		window.onload = function() {
			setFooter();
		}
		window.onresize = function() {
			setFooter();
		}
		
function launchFull(url, name, height, width) 

{
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) 
  {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",resizable=no,menubar=no,locationbar=no,status=no,scrollbars=yes,screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  window.open(url, name, str);
}


function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_over = newImage("images/navi/home_over.gif");
		musik_over = newImage("images/navi/musik_over.gif");
		bio_over = newImage("images/navi/bio_over.gif");
		termine_over = newImage("images/navi/termine_over.gif");
		downloads_over = newImage("images/navi/downloads_over.gif");
		shop_over = newImage("images/navi/shop_over.gif");
		gaeste_over = newImage("images/navi/gaeste_over.gif");
		nl_over = newImage("images/navi/nl_over.gif");
		kontakt_over = newImage("images/navi/kontakt_over.gif");		
		credits_over = newImage("images/navi/credits_over.gif");
		preloadFlag = true;
	}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(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 MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function openlivedome()
        {
			window.open('http://kunden.wundermedia.de/livedome/player/demos/78/inamueller.de','MBC',
                                        'height=620,width=990,menubar=no,location=no,resizeable=no,status=no,toolbar=no,dependent=no,scrollbars=no');
        }
