// globale PopUp- Funktion
function openWindow(url,name,parameter) {
	name0 = window.open(url,name,parameter);
	name0.focus();
}

// Netscape Resize Problem
function resizeHandler() {
	parent.content.location.reload();
}
if (document.layers) {
	window.captureEvents(Event.RESIZE); window.onresize = resizeHandler;
}


// MINI Image Swap Functions
function swap_a(name) {
	var img = document.images[name];
	if (typeof(document.images[name].active)=='object') {
		document.images[name].src = document.images[name].active.src;
	}
	window.status='';
	return true;
}

function swap_b(name) {
	var img = document.images[name];
	if (typeof(document.images[name].down)=='object') {
		document.images[name].src = document.images[name].down.src;
	}
	window.status='';
	return true;
}


function swap_back(name) {
	if (typeof(document.images[name].inactive)=='object') {
		document.images[name].src = document.images[name].inactive.src;
	}
}

function preloadActiveImage(name,src) {
	document.images[name].inactive = new Object;
	document.images[name].inactive.src = document.images[name].src;
	document.images[name].active = new Image;
	document.images[name].active.src = src;
}

function preloadDownImage(name,src) {
	document.images[name].inactive = new Object;
	document.images[name].inactive.src = document.images[name].src;
	document.images[name].down = new Image;
	document.images[name].down.src = src;
}

// end Image Swap Functions


// show and hide Layer function
function show(name) {getElement(name).visibility = "visible";}

function hide(name) {getElement(name).visibility = "hidden";}

// additional functions used in main navigation
function killAll() {
	for (i=0; i<5; i++) {
 	 hide('menu' + i);
	}
}

var timedelay = 1000;
var openflag = "";

function hideWann(which) {
	openflag = 'menu' + which;
	timedelay = setTimeout('hide(openflag)',1000);
}

function dontHide() {
 clearTimeout(timedelay);
}


// Write LayerContent
function writeLayer(parentLayerName,layerName,layerContent) {
	if (document.layers) {
	  // Function also works with one Layer
   	if (parentLayerName == "") {
   			document.layers[layerName].document.open(); document.layers[layerName].document.write(layerContent); document.layers[layerName].document.close();
   	 } else {
   	 		document.layers[parentLayerName].document.layers[layerName].document.open(); document.layers[parentLayerName].document.layers[layerName].document.write(layerContent); document.layers[parentLayerName].document.layers[layerName].document.close();
   	 }
	}
	else if (document.all) {document.all[layerName].innerHTML = layerContent;}
	else if (!document.all && document.getElementById) {document.getElementById(layerName).innerHTML = layerContent;}
}


// Set the Postition of a Layer
function setLayerPosition(thisLayer,positionLeft,positionTop) {
  thisLayer = getElement(thisLayer);
  thisLayer.left = positionLeft;
  thisLayer.top  = positionTop;
}

// Get the Postition of a Layer
function getLayerPosition(thisLayer) {
  thisLayerPosition = new Array();
  thisLayer = getElement(thisLayer);
  thisLayerPosition["height"] = document.all ? thisLayer.offsetHeight : thisLayer.document.height;
  thisLayerPosition["width"] = document.all ?  thisLayer.offsetWidth : thisLayer.document.width;
  thisLayer = document.layers ? thisLayer : thisLayer.style;
  thisLayerPosition["top"]    = document.all ? thisLayer.pixelTop     : thisLayer.top;
  thisLayerPosition["left"]   = document.all ? thisLayer.pixelLeft    : thisLayer.left;
  thisLayerPosition["right"]   = thisLayerPosition["left"] + thisLayerPosition["width"];
  thisLayerPosition["bottom"]  = thisLayerPosition["top"] +  thisLayerPosition["height"];
  return(thisLayerPosition);
}


function setClip(thisLayer,clipTop,clipRight,clipBottom,clipLeft) {
  oj = getElement(thisLayer);
  if(document.layers) {
    with(oj.clip) {top=clipTop;right=clipRight;bottom=clipBottom;left=clipLeft;}
  } else {
   oj.clip= 'rect('+clipTop+','+clipRight+','+clipBottom+','+clipLeft+')'
  }
}

function selfReload() {
 document.location.href = document.location.href;
}



// function to clear frames and open an external URL

var url = '';
function threedUrl(url) {
top.location.href = url;
}