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) {
		annett_over = newImage("images/navi/annett_over.gif");
		stefan_over = newImage("images/navi/stefan_over.gif");
		cosmo_over = newImage("images/navi/cosmo_over.gif");
		henni_over = newImage("images/navi/henni_over.gif");
		heinz_over = newImage("images/navi/heinz_over.gif");
		roman_over = newImage("images/navi/roman_over.gif");
		adriana_nicole_over = newImage("images/navi/adriana_nicole_over.gif");
		frans_over = newImage("images/navi/frans_over.gif");
		venice_over = newImage("images/navi/venice_over.gif");		
		kontakt_over = newImage("images/navi/kontakt_over.gif");
		impressum_over = newImage("images/navi/impressum_over.gif");
		djt_over = newImage("images/navi/djt_over.gif");
		demos_over = newImage("images/navi/demos_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;
}
