
function getWindowWidth() {
			var windowWidth = 0;
			if (typeof(window.innerWidth) == 'number') {
				windowWidth = window.innerWidth;
			}
			else {
				if (document.documentElement && document.documentElement.clientWidth) {
					windowWidth = document.documentElement.clientWidth;
				}
				else {
					if (document.body && document.body.clientWidth) {
						windowWidth = document.body.clientWidth;
					}
				}
			}
                          if (windowWidth == 0){
                           windowWidth = screen.width;
                          }

			return windowWidth;
		}


var windowWidth=getWindowWidth();

var externerLinkText = "Externer Link";
var textNeuesFenster = "(neues Fenster)";
var isOp = (navigator.userAgent.toLowerCase().indexOf("opera") != -1) ? true : false; function titleAnpassen(linkObjekt) {
  if (linkObjekt.getAttribute) {
    textAlt = linkObjekt.getAttribute("title");
    if(textAlt && textAlt.indexOf(textNeuesFenster) == -1) {
      textZusatz = textAlt.substring((textAlt.indexOf(externerLinkText)) + externerLinkText.length, textAlt.length);
      linkObjekt.setAttribute("title", externerLinkText + " " + textNeuesFenster + textZusatz);
    }
  }
}


var InternerLinkText = "Interner Link";
var textNeuesFenster = "(neues Fenster)";
var isOp = (navigator.userAgent.toLowerCase().indexOf("opera") != -1) ? true : false; function titleAnpassenIntern(linkObjekt) {
  if (linkObjekt.getAttribute) {
    textAlt = linkObjekt.getAttribute("title");
    if(textAlt && textAlt.indexOf(textNeuesFenster) == -1) {
      textZusatz = textAlt.substring((textAlt.indexOf(externerLinkText)) + externerLinkText.length, textAlt.length);
      linkObjekt.setAttribute("title", externerLinkText + " " + textNeuesFenster + textZusatz);
    }
  }
}





function fensterOeffnenExtern(linkObjekt) {
  var linkHref= "";
  if (linkObjekt.getAttribute) linkHref = linkObjekt.getAttribute("href");
  if (linkHref == "") return true;
  var fensterName = "extern";
  var externesLinkFenster = window.open(linkHref,fensterName);
  if (externesLinkFenster && !isOp) externesLinkFenster.focus();
  return (externesLinkFenster) ? false : true;
}
function fensterOeffnenIntern(linkObjekt) {
  var linkHref= "";
  if (linkObjekt.getAttribute) linkHref = linkObjekt.getAttribute("href");
  if (linkHref == "") return true;
  var fensterName = "intern";
  var externesLinkFenster = window.open(linkHref,fensterName);
  if (externesLinkFenster && !isOp) externesLinkFenster.focus();
  return (externesLinkFenster) ? false : true;
}

		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('content').offsetHeight;

					var footerElement = document.getElementById('footer');
					var footerHeight  = footerElement.offsetHeight;

					var top_position = windowHeight - (contentHeight + footerHeight );

					if (windowHeight - (contentHeight + footerHeight) >= 0) {
						footerElement.style.position = 'relative';
						footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			}
					else {
						footerElement.style.position = 'static';
					}
				}
			}


		}



// Javascript Fehler unterdruecken
//onerror = stopError;
function stopError()
{
return true;
}

// Umgebungsvariablen auslesen

	// convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
	

// blur focus

function nix(x)
	{
	if(x.blur)x.blur();
	}
	
	// Formular-Buttons Rollover

function butover(x)
	{
	if (is_nav4) return;
	url=x.src;
	found=url.split("/");
	nfound=found[found.length-1].split(".");
	nlength=nfound[0].length-1;
	folder=url.replace(found[found.length-1],"");
	name=nfound[0].substr(0,nlength);
	x.src = folder+name+"1."+nfound[1];
	}
	
function butout(x)
	{
	if (is_nav4) return;
	url=x.src;
	found=url.split("/");
	nfound=found[found.length-1].split(".");
	nlength=nfound[0].length-1;
	folder=url.replace(found[found.length-1],"");
	name=nfound[0].substr(0,nlength);
	x.src = folder+name+"0."+nfound[1];
	}
	
	
	// PopUp Fenster öffnen

var ioWindow;

function openWindow(url,x,y)
	{
	if (ioWindow) {if (!ioWindow.closed) ioWindow.close()}
	h=screen.availHeight-30;
	w=screen.availWidth-30;
	t=(h-y)/2; if (t<0) t=0;
	u=(w-x)/2; if (w<0) w=0;
	ioWindow = window.open(url,"popuprii",'width='+x+',height='+y+',left='+u+',top='+t+',scrollbars=auto');
	ioWindow.focus();
	}	

	
	
	
	
function initImages()
	{
	zz=top.window.name;
	imo = new Array(); // Mouseover-Bilder
	ino = new Array(); // Normal-Zustand-Bilder
	if (document.images)
		{
		for (i=0;i<80;i++) 
			{
			ll=0;
			if (is_nav4) ll=document.layers.length;
			for (l=-1; l<ll; l++)
				{
				dok=document;
				if ((is_nav4)*(l!=-1)) dok=document.layers[l].document;
				if (dok.images["b"+i])
					{
					// Folder ermitteln
					url=dok.images["b"+i].src;
					found=url.split("/");
					nfound=found[found.length-1].split(".");
					nlength=nfound[0].length-1;
					folder=url.replace(found[found.length-1],"");
					name=nfound[0].substr(0,nlength);
					imo[i] = new Image(); imo[i].src = folder+name+"1."+nfound[1];
					ino[i] = new Image(); ino[i].src = url;
					}
				}
			}
		}
	myload=1;
	top.window.name=zz;
	}

