/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// resize fix for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// link style change
var cur_link;
function doLinkClass(lnk) {
  if (lnk && lnk.blur) lnk.blur();	// remove marquee
  if (!lnk || cur_link == lnk) return;
  if (cur_link) cur_link.className = "done";
  lnk.className = "on";
  cur_link = lnk;
}

var cur_lyr;	// holds id of currently visible layer
function swapLayers(lnk,id) {
  doLinkClass(lnk);
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

// get reference to nested layer for ns4
// from old dhtmllib.js by Mike Hall of www.brainjar.com
function getLyrRef(lyr,doc) {
	if (document.layers) {
		var theLyr;
		for (var i=0; i<doc.layers.length; i++) {
	  	theLyr = doc.layers[i];
			if (theLyr.name == lyr) return theLyr;
			else if (theLyr.document.layers.length > 0) 
	    	if ((theLyr = getLyrRef(lyr,theLyr.document)) != null)
					return theLyr;
	  }
		return null;
  }
}

function init(id,lyr) {
	var lnk = getElemRefs(id);
	swapLayers(lnk,lyr);
}

//select-felder ausblenden
function hideSelects(action) {
	//documentation for this script at http://www.shawnolson.net/a/1198/
	//possible values for action are 'hidden' and 'visible'
	if (action!='visible'){action='hidden';}
		if (navigator.appName.indexOf("MSIE")) {
		for (var S = 0; S < document.forms.length; S++){
			for (var R = 0; R < document.forms[S].length; R++) {
				if (document.forms[S].elements[R].options) {
					document.forms[S].elements[R].style.visibility = action;
				}
			}
		}
	}
}

// Globals
// Major version of Flash required
var requiredMajorVersion = flashVersionDE;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;

var popupFlashDE = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + flashVersionDE + ',0,0,0" width="' + popupWidthDE + '" height="' + popupHeightDE + '" id="flash-popup" align="top">'
			+ '<param name="allowScriptAccess" value="sameDomain" />'
			+ '<param name="movie" value="' + flashFileDE + '" />'
			+ '<param name="quality" value="high" />'
			+ '<param name="scale" value="noscale" />'
			+ '<param name="wmode" value="transparent" />'
			+ '<param name="bgcolor" value="#ffffff" />'
			+ '<embed src="' + flashFileDE + '" quality="high" scale="noscale" wmode="transparent" bgcolor="#ffffff" width="' + popupWidthDE + '" height="' + popupHeightDE + '" name="flash-popup" align="top" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
			+ '</object>';

var popupFlashEN = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + flashVersionEN + ',0,0,0" width="' + popupWidthEN + '" height="' + popupHeightEN + '" id="flash-popup" align="top">'
			+ '<param name="allowScriptAccess" value="sameDomain" />'
			+ '<param name="movie" value="' + flashFileEN + '" />'
			+ '<param name="quality" value="high" />'
			+ '<param name="scale" value="noscale" />'
			+ '<param name="wmode" value="transparent" />'
			+ '<param name="bgcolor" value="#ffffff" />'
			+ '<embed src="' + flashFileEN + '" quality="high" scale="noscale" wmode="transparent" bgcolor="#ffffff" width="' + popupWidthEN + '" height="' + popupHeightEN + '" name="flash-popup" align="top" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
			+ '</object>';

var popupIFrameDE = '<a href="#" onclick="javascript:stopPopup()" style="display:block; position:absolute; right:1px; top:-20px; width:60px; height:20px; background-color:#CCC;">X schlie&szlig;en</a>'
			+ '<iframe name="html-popup" src="' + htmlFileDE + '" width="' + popupWidthDE + '" height="' + popupHeightDE + '" scrolling="auto"></iframe>';

var popupIFrameEN = '<a href="#" onclick="javascript:stopPopup()" style="display:block; position:absolute; right:1px; top:-20px; width:50px; height:20px; background-color:#CCC;">X close</a>'
			+ '<iframe name="html-popup" src="' + htmlFileEN + '" width="' + popupWidthEN + '" height="' + popupHeightEN + '" scrolling="auto"></iframe>';

var blank = '';

function stopPopup () {
	WriteLayer('lyr1',null,blank);
	swapLayers(this._parent,'lyr2');
}

function WriteLayer(ID,parentID,sText) {
	if (document.layers) {
		var oLayer;
			if(parentID){
				oLayer = eval('document.' + parentID + '.document.' + ID + '.document');
			}else{
				oLayer = document.layers[ID].document;
			}
		oLayer.open();
		oLayer.write(sText);
		oLayer.close();
	} else if (parseInt(navigator.appVersion)>=5&&navigator.
		appName=="Netscape") {
		document.getElementById(ID).innerHTML = sText;
	} else if (document.all) document.all[ID].innerHTML = sText
}

function openPopupDE (popupContentDE) {
	document.write ('<div id="lyr1" style="visibility: visible; position: absolute; z-index: 1000; top: ' + popupTopDE + 'px; left: ' + popupLeftDE + 'px; width: ' + popupWidthDE + 'px; height: ' + popupHeightDE + 'px">');
	if (popupContentDE=='flash'){
		document.write (popupFlashDE);
	} else {
		document.write (popupIFrameDE);
	}
	document.write ('</div>');
	
	document.write ('<div id="lyr2" style="visibility: hidden; position: absolute; z-index: 1000; top: 0px; left: 0px; width: 1px; height: 1px"></div>');
}

function openPopupEN (popupContentEN) {
	document.write ('<div id="lyr1" style="visibility: visible; position: absolute; z-index: 1000; top: ' + popupTopEN + 'px; left: ' + popupLeftEN + 'px; width: ' + popupWidthEN + 'px; height: ' + popupHeightEN + 'px">');
	if (popupContentEN=='flash'){
		document.write (popupFlashEN);
	} else {
		document.write (popupIFrameEN);
	}
	document.write ('</div>');
	
	document.write ('<div id="lyr2" style="visibility: hidden; position: absolute; z-index: 1000; top: 0px; left: 0px; width: 1px; height: 1px"></div>');
}