var userinfo = navigator.userAgent;
// =====================================================================
// ============== Fenstergroessen-Ueberwachung =========================
function init(){
//* Überwachung von Internet Explorer initialisieren */
  if (!window.Weite && document.body && document.body.offsetWidth) {
    window.onresize = posKorrektur;
    Weite = Fensterweite();
    Hoehe = Fensterhoehe();
  }

}
//* Überwachung von Netscape initialisieren 
  if (!window.Weite && window.innerWidth) {
   window.onresize = posKorrektur;
    Weite = Fensterweite();
   Hoehe = Fensterhoehe();
  } 


function Fensterweite () {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}

function Fensterhoehe () {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.body && document.body.offsetHeight) {
    return document.body.offsetHeight;
  } else {
    return 0;
  }
}
// ============== Ende Fenstergroessen-Ueberwachung ==========
// ============================================================

function posKorrektur() {
var horiz = "-495px";
var verti = "-295px";
if (aufl == "min"){horiz = "-375px"; verti = "-200px";}
if (aufl == "max"){horiz = "-600px"; verti = "-375px";}
var run_korr = 0;
var konqueror = userinfo.search(/onqueror/);
   
 // =============== fuer IE usw. =========== konqueror soll ausgeschlossen sein, wenn er
 // == unsinniges offsetHeight zurueckgibt 

   if (document.documentElement.offsetHeight > konqueror){  
         breite= (document.documentElement.offsetWidth);hoehe = (document.documentElement.offsetHeight);
          run_korr =  1;
    }
   
 // =============== fuer mozilla usw.============     
     else {
          breite = (window.innerWidth);hoehe = (window.innerHeight);
          run_korr = 1;
     }
  
  
  
 if(run_korr = 1){    
    if(document.all){
    istPos = document.all["hcont"];}
    else {
    istPos = document.getElementById('hcont');}
    if (aufl == "max"){e = 1210; f = 800;} 
    if (aufl == "middle"){e = 900; f = 500;}
    if (aufl == "min"){e = 805; f = 430;}
    if(parseInt(breite) <= e){istPos.style.left = "5px";istPos.style.marginLeft = "0px";}
    else {var temp1 = parseInt(breite)/2;istPos.style.left = temp1 + "px";istPos.style.marginLeft = horiz;}
    
    if(parseInt(hoehe) <= f){istPos.style.top = "5px";istPos.style.marginTop = "5px";} 
    else {var temp2 = parseInt(hoehe)/2;istPos.style.top = temp2 + "px" ;istPos.style.marginTop = verti ;}
  }    
}


// ========== Hover - Effekte =============
var hoverwidth = "204px";
var hoverheight = "30px";
var nothoverwidth = "196px";
var nothoverheight = "25px";
var hoverlineheight = "28px";
var nothoverlineheight = "25px";
var margleft = "-6px";
var margtop = "-2px";
if (aufl == "min"){
  hoverwidth = "160px"; nothoverwidth = "151px";
  hoverheight = "25px"; nothoverheight = "20px";
  hoverlineheight = "25px";nothoverlineheight = "20px";
  margleft = "-4px";margtop = "-2px";}
if (aufl == "max"){
  hoverwidth = "260px"; nothoverwidth = "240px";
  hoverheight = "38px"; nothoverheight = "30px";
  hoverlineheight = "38px";nothoverlineheight = "30px";
  margleft = "-10px";margtop = "-3px";}

function overstyle(id){
  if(document.all){over = document.all[id];}
  else {over = document.getElementById(id);}
  over.style.border = "solid 1px #aaa";
  over.style.backgroundColor = "#fff";
  over.style.width = hoverwidth;
  over.style.height = hoverheight;
  over.style.lineHeight = hoverlineheight;
  over.style.top = margtop;
  over.style.marginLeft = margleft;
  over.style.fontSize = "120%";
  over.style.fontWeight = "normal";
  over.style.zIndex = "1";
  if(document.all){over.style.cursor = "hand";}
  else over.style.cursor = "pointer"; 
}

function notoverstyle(id){
  if(document.all){over = document.all[id];}
  else {over = document.getElementById(id);}
  over.style.border = "solid 1px #aaa";
  over.style.backgroundColor = "#fff";
  over.style.width = nothoverwidth;
  over.style.height = nothoverheight;
  over.style.lineHeight = nothoverlineheight;
  over.style.top = "0px";
  over.style.marginLeft = "0px";
  over.style.fontSize = "100%";
  over.style.fontWeight = "normal";
  over.style.zIndex = "0";
}
// ===================================
function overstyle2(id){
  if(document.all){over = document.all[id];}
  else {over = document.getElementById(id);}
  over.style.border = "solid 1px #aaa";
  over.style.backgroundColor = "#fff";
  over.style.fontSize = "120%";
  over.style.fontWeight = "normal";
  over.style.zIndex = "1";
  if(document.all){over.style.cursor = "hand";}
  else over.style.cursor = "pointer"; 
  over.style.width = "136px";
  over.style.height = "30px";
  over.style.lineHeight = "30px";
  over.style.top = "-3px";
  over.style.marginLeft = "-4px";
  if (aufl == "max") {
    over.style.width = "170px";
    over.style.height = "36px";
    over.style.lineHeight = "36px";
    over.style.top = "-3px";
    over.style.marginLeft = "-4px"; 
  }
  if (aufl == "min") {
    over.style.width = "100px";
    over.style.height = "24px";
    over.style.lineHeight = "24px";
    over.style.top = "-2px";
    over.style.marginLeft = "-4px";  
  }
}

function notoverstyle2(id){
  if(document.all){over = document.all[id];}
  else {over = document.getElementById(id);}
  over.style.border = "solid 1px #aaa";
  over.style.backgroundColor = "#fff";
  over.style.top = "0px";
  over.style.marginLeft = "0px";
  over.style.fontSize = "100%";
  over.style.fontWeight = "normal";
  over.style.zIndex = "0";
  over.style.width = "125px";
  over.style.height = "22px";
  over.style.lineHeight = "22px";
  if (aufl == "max"){
    over.style.width = "150px";
    over.style.height = "30px";
    over.style.lineHeight = "30px";
  }
  if (aufl == "min"){
    over.style.width = "90px";
    over.style.height = "20px";
    over.style.lineHeight = "20px";
  }
}
// ========== Ende Hover =====================

// =========== Kontaktformular ==============
var reloadv = 0;
function loeschetext(){
if(document.all){eingabefeld = document.all.eingabefeld}
else {eingabefeld = document.getElementById("eingabefeld");}
if (reloadv == 0){eingabefeld.style.fontWeight='normal';eingabefeld.value='';}
reloadv = 1;
}
function reloadk(){
document.form1.email.value='';
document.form1.tel.value='';
document.form1.eingabefeld.value='Ihre Nachricht:';
reloadv = 0;
}

  
function formvalid(){
       meldung1 = "Ihre email-Adresse ist nicht korrekt!";
       meldung2 = "Ihre Telefonnummer ist nicht korrekt! "+"\r\n"+"Eingabe bitte mit Vorwahl in Klammern.";
       meldung3 = "Bitte geben Sie Ihre Telefonnummer und/oder Ihre email-Adresse an."
       meldung4 = "Geben Sie ihre Nachricht ein."
       if((document.form1.email.value=='') && (document.form1.tel.value=='')){alert(meldung3);return false;}
         else{

  	           if((document.form1.email.value.indexOf('@') == '-1')&&(document.form1.tel.value == '')){
 	    	      alert(meldung1);return false;
  	            }
  	            if((document.form1.tel.value.indexOf('0') == '-1')&&(document.form1.email.value == '')){
 	    	      alert(meldung2);return false;
  	            }
   	         if((document.form1.eingabefeld.value == "Ihre Nachricht:") || (document.form1.eingabefeld.value == '')){
 	    	      alert(meldung4);return false;
  	            } 	            
  	       }     
}  

function txtlength(){
istwert = document.form1.eingabefeld.value.length;
if(istwert > 500){neuerwert = 0;}
else{
neuerwert = 500 - istwert;
if (reloadv == 0)neuerwert = 500;}
if (document.all){document.all.zz.firstChild.data = neuerwert;}
else {document.getElementById("zz").firstChild.data = neuerwert;}
if (!reloadv == 0)setTimeout('txtlength()',500);
}
// ======  Ende Kontaktformular ==============
// ======  Links      ==============
var whoami = "";

function linkinfo(){

if(document.all){document.all.tlink.style.visibility = 'hidden';}
else {document.getElementById('tlink').style.visibility = 'hidden';}

for ( i = 1; i < 10 ; i++) {
var name = "tlink" + i;
if(document.all){document.all[name].style.left = '-10000px';}
else {document.getElementById(name).style.left = '-10000px';}
}

var whatsme = "t" + whoami;

if(document.all){which = document.all[whatsme];}
else {which = document.getElementById(whatsme);}

which.style.left = "450px";

 if (aufl == "max"){
  which.style.left = "740px";
  }
  if (aufl == "middle"){
  which.style.left = "600px";
  }

}

function textinfo(){
for ( i = 1; i < 10 ; i++){
var name = "tlink" + i;
if(document.all){document.all[name].style.left = '-10000px';}
else {document.getElementById(name).style.left = '-10000px';}
}

if(document.all){document.all.tlink.style.visibility = 'visible';}
else {document.getElementById('tlink').style.visibility = 'visible';}
}
// ======  Ende Links ==============

