// JavaScript Document
<!--

function seite_versenden() {
  str_send = "scripts/versenden.php?adresse="+window.location.hostname+window.location.pathname;
	window.open(str_send,'','width=350,height=230,scrollbars=no,resizable=no');
}

function seite_drucken() {
  str_link = "http://"+window.location.hostname+window.location.pathname+"?drucken=ja";
	window.open(str_link,'','width=680,height=480,scrollbars=yes,toolbar=yes,resizable=no');
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function init() {
var fb; 
if (document.getElementById('history')) {
fb = document.getElementById('history').offsetWidth;

  if (fb < 984 && fb > 760 && document.URL.indexOf("print=1") <= -1) {
    fbDif = 984 - fb;
    strfbDif = 984-fbDif;
    document.getElementById('seitenkopf').style.width = strfbDif+"px";
  } else if (fb <= 760 && document.URL.indexOf("print=1") <= -1) {
    fbDif = 984 - fb;
    strfbDif = 984-fbDif;
    document.getElementById('seitenkopf').style.width = strfbDif+"px";
    document.getElementById('inhalt').style.width = "880px";
    document.getElementById('unterseite-spalte-2').style.width = "440px";
    document.getElementById('unterseite-spalte-2-text').style.width = "400px";
    document.getElementById('unterseite-spalte-2-abschluss').style.width = "440px";
    document.getElementById('unterseite-spalte-2-fusszeile').style.width = "440px";
    document.getElementById('ecke-2').style.left = "631px"; 
    document.getElementById('ecke-3').style.left = "851px";
  }
}
  if (document.URL.indexOf("print=1") > -1) {
    replaceAnchors();
  }
  prepInput();
}

function replaceAnchors(){

    var aryTags = document.getElementsByTagName("a");
    for(c=0;c<aryTags.length;c++){
        var strClick = String(document.getElementsByTagName("a")[c].onclick);
        var strHref = String(document.getElementsByTagName("a")[c].href);
        
        if (document.URL.indexOf("print=1") > -1) {
          if(strHref.substr(0,2) != "ja" && strHref.indexOf("#top") <= 0) {
            document.getElementsByTagName("a")[c].href = "javascript:void(0)";
            document.getElementsByTagName("a")[c].target = "_self";
          }
        }
    }
}

function prepInput() {
  var aryTags = document.getElementsByTagName("input");
  for(c=0;c<aryTags.length;c++){
    var strInput = String(document.getElementsByTagName("input")[c].id);
    var strType = String(document.getElementsByTagName("input")[c].type);
  	if (strInput != "" && strType != "checkbox") { 
  		var elem = document.getElementById(strInput);
  		var origClass = elem.className;
  		elem.onfocus = function() {
  			this.className += " focus";
  		}
  		elem.onblur = function() {
  			this.className = origClass;	
  		}
	  }
	}
}

function farbe(id,check) {
  if (check == 1) {
  document.getElementById(id).style.background = '#FFFFFF'
  document.getElementById(id).style.borderStyle = 'solid'
  document.getElementById(id).style.borderColor = '#888888'
  } else {
  document.getElementById(id).style.background = '#FFFFFF'
  document.getElementById(id).style.borderStyle = 'inset'
  document.getElementById(id).style.borderColor = '#BBBBBB'
  }
}
// -->
