var bName = navigator.appName;var bVer = parseInt(navigator.appVersion);
var ie4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
var ns4 = (document.layers)? true:false;

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 datum() {
wochentag = new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
var heute = new Date();

var Tag = heute.getDate();
var WTag = heute.getDay();
var Monat = heute.getMonth();
var Jahr = heute.getYear();

Monat++;
if (Jahr < 1000) Jahr += 1900;
document.write(wochentag[WTag] + ", der " + Tag + "." + Monat + "." + Jahr);
}

function setfocus() {
document.forms[0][0].focus();
}   

var bName = navigator.appName;var bVer = parseInt(navigator.appVersion);
var ns7 = (bName == "Netscape" && bVer > 5);
var ns4 = (bName == "Netscape" && bVer < 5);
var ie4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
var hoch = (screen.width > 800);



function switchStyle(s) {
  if (!document.getElementsByTagName) return;
  if (s==1) {s='martin'} else {s='akb'};
  var el = document.getElementsByTagName("link");
  for (var i = 0; i < el.length; i++ ) {
    if (el[i].getAttribute("rel").indexOf("style") != -1 && el[i].getAttribute("title")) {
      el[i].disabled = true;
      if (el[i].getAttribute("title") == s) el[i].disabled = false;
    }
  }
}

function startesuche() {
suchfeld = document.forms.schnellsuche.suchfeld.value;
suchwort =  document.forms.schnellsuche.suchwort.value;
if (suchwort=="") {alert("Bitte geben Sie einen Suchbegriff ein."); return false} 
document.forms.schnellsuche.autor.value="";
document.forms.schnellsuche.titel.value="";
document.forms.schnellsuche.verlag.value="";
document.forms.schnellsuche.isbn.value="";
if (suchfeld=='autor') {document.forms.schnellsuche.autor.value=suchwort;}
if (suchfeld=='titel') {document.forms.schnellsuche.titel.value=suchwort;}
if (suchfeld=='verlag') {document.forms.schnellsuche.verlag.value=suchwort;}
if (suchfeld=='isbn') {document.forms.schnellsuche.isbn.value=suchwort;}
return true; 
}


function showtip(current,e,text){
  if (ns4){
    // Raender beachten
    var mx=e.pageX;
    var my=e.pageY;
    if (mx < 20) {mx=20} //linker Rand
    if (my < 20) {my=20} //oberer Rand
    if (mx > 445) {mx=mx-70} //rechter Rand
    if (my > 380) {my=my-40} //unterer Rand
    document.info.document.write('<layer bgColor="#fafad2;" style="border:1px solid #000000;font-size:10pt;font-family: Arial, Helvetica, sans-serif"> '+text+' </layer>');
    document.info.document.close();
    document.info.left=mx;
    document.info.top=my+18;
    document.info.visibility="show";
}  else if (ns7) {
    tip = '<div style="padding:1;background-color: #fafad2;border:1px solid #000000;font-size:10pt;font-family: Arial, Helvetica, sans-serif"> ' + text + ' </div>';
    document.getElementById("info").innerHTML= tip;
    // Raender beachten
    var mx=e.pageX;
    var my=e.pageY;
    if (mx < 20) {mx=20} //linker Rand
    if (my < 20) {my=20} //oberer Rand
    if (mx > screen.width-150) {mx=mx-150} //rechter Rand
    if (my > 380) {my=my-40} //unterer Rand
    //alert(screen.width+' '+my+' '+mx);
    document.getElementById("info").style.left=mx;
    document.getElementById("info").style.top=my+18;
    document.getElementById("info").style.visibility="visible";
  }   else  {
    tip = '<div style="padding:1;background-color: #fafad2;border:1px solid #000000;font-size:10pt;font-family: Arial, Helvetica, sans-serif"> ' + text + ' </div>';
    document.all.info.innerHTML= tip;
    // Raender beachten
    var mx=e.x;
    var my=document.body.scrollTop+e.y;
    if (mx < 20) {mx=20} //linker Rand
    if (my < 20) {my=20} //oberer Rand
    if (mx > screen.width-150) {mx=mx-150} //rechter Rand
    if (my > 380) {my=my-40} //unterer Rand
    document.all['info'].style.pixelLeft=mx;
    document.all['info'].style.pixelTop=my-18;
    document.all['info'].style.visibility="visible";
  }
}

function hidetip(){
  if (document.layers)
    document.info.visibility="hidden";
  else if (document.all)
    document.all['info'].style.visibility = 'hidden';
  else 
    document.getElementById("info").style.visibility="hidden";
}

function CheckEmail(eingabe)    {
    if (eingabe.length<8) {return false;}
    if ((eingabe.search("@") == -1) ||
         (eingabe.lastIndexOf(".") < eingabe.search("@")) ||
         (eingabe.lastIndexOf(".") < eingabe.length-5) ||
         (eingabe.lastIndexOf(".") > eingabe.length-3)) {return false;}
    
    var anzahl = 0;
    for (var j = 0; j < eingabe.length; j++) 
    {   var ch = eingabe.substring(j, j + 1);
        if (ch == "@") 
        {   anzahl++;
            continue;
        }
    }
    if (anzahl > 1) {return false;}
    return true;
}
    
    

function checkForm() {
    
    if (document.kontakt.anrede.value=="") {
        document.kontakt.anrede.focus();
        alert("Bitte geben Sie eine Anrede an.");
        return false;
    }   
    
    if (document.kontakt.vorname.value=="") {
        document.kontakt.vorname.focus();
        alert("Bitte geben Sie Ihren Vornamen an.");
        return false;
    }
    
    if (document.kontakt.name.value=="") { 
        document.kontakt.name.focus();
        alert("Bitte geben Sie Ihren Nachnamen an.");
        return false;
    }

    if (document.kontakt.strasse.value=="") {
        document.kontakt.strasse.focus();
        alert("Bitte geben Sie eine Strasse an.");
        return false;
    }
    
    if ((document.kontakt.plz.value=='')||(isnum(document.kontakt.plz.value)!=true))  {
        document.kontakt.plz.focus();
        alert("Bitte geben Sie eine Postleitzahl an.\nDas Feld ist ein Zahlfeld.");
        return false;
    }
    
    if (document.kontakt.ort.value=="") { 
        document.kontakt.ort.focus();
        alert("Bitte geben Sie einen Ort an.");
        return false;
    }
    
    if ((document.kontakt.email.value=="") || (!CheckEmail(document.kontakt.email.value))){
        document.kontakt.email.focus();
        alert("Bitte geben Sie Ihre g¸ltige E-Mail-Adresse an.");
        return false;
    }
    
    return true;
}

/* neu */


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function openWindowWetter() { 
      window.open('wetter.html','wetter','width=151,height=290,screenX=300,left=300,screenY=300,top=300,toolbar=0,menubar=0,location=0,status=0,resizable=0,scrollbars=0');
    }
    
function openWindowWetterEn() { 
      window.open('en_wetter.html','wetter','width=151,height=290,screenX=300,left=300,screenY=300,top=300,toolbar=0,menubar=0,location=0,status=0,resizable=0,scrollbars=0');
    }
        
    
function openWindowWebcam() { 
      window.open('webcam.html','webcam','width=800,height=400,screenX=10,left=10,screenY=10,top=10,toolbar=0,menubar=0,location=0,status=0,resizable=0,scrollbars=0');
    }
    
function openWindowMalvorlage() { 
      window.open('malvorlage.html','malvorlage','width=575,height=570,screenX=200,left=200,screenY=200,top=200,toolbar=0,menubar=0,location=0,status=0,resizable=0,scrollbars=0');
    }
function openWindowMalvorlageEn() { 
      window.open('en_malvorlage.html','malvorlage','width=575,height=570,screenX=200,left=200,screenY=200,top=200,toolbar=0,menubar=0,location=0,status=0,resizable=0,scrollbars=0');
    }
    
function openWindowProspekt() { 
      window.open('upload/flash/quickstart/catalogue.html','popup','width=680,height=820,screenX=100,left=100,screenY=100,top=0,toolbar=0,menubar=0,location=0,status=0,resizable=1,scrollbars=1');
    }
    
function openWindowProspektEn() { 
      window.open('upload/flash/quickstart/en_catalogue.html','popup','width=680,height=820,screenX=100,left=100,screenY=100,top=0,toolbar=0,menubar=0,location=0,status=0,resizable=1,scrollbars=1');
    }
    
function openWindowAnreise() { 
      window.open('anfahrt.html','reise','width=600,height=540,screenX=100,left=100,screenY=100,top=100,toolbar=0,menubar=0,location=0,status=0,resizable=0,scrollbars=0');
    }
    
function openWindowAnreiseEn() { 
      window.open('en_anfahrt.html','reise','width=478,height=400,screenX=300,left=300,screenY=300,top=300,toolbar=0,menubar=0,location=0,status=0,resizable=0,scrollbars=0');
    }
    
function openWindowGruppenanmeldung() { 
      window.open('gruppenanmeldung.html','gruppe','width=478,height=430,screenX=300,left=300,screenY=300,top=300,toolbar=0,menubar=0,location=0,status=0,resizable=0,scrollbars=0');
    }
    
function openWindowGruppenanmeldungEn() { 
      window.open('en_gruppenanmeldung.html','gruppe','width=478,height=430,screenX=300,left=300,screenY=300,top=300,toolbar=0,menubar=0,location=0,status=0,resizable=0,scrollbars=0');
    }
    
function openWindowFilm() { 
      window.open('film.html','video','width=500,height=480,screenX=300,left=300,screenY=300,top=300,toolbar=0,menubar=0,location=0,status=0,resizable=0,scrollbars=0');
    }
    
function openWindowFilmEn() { 
      window.open('en_film.html','video','width=500,height=480,screenX=300,left=300,screenY=300,top=300,toolbar=0,menubar=0,location=0,status=0,resizable=0,scrollbars=0');
    }
    



//Flying planes - by John Ely
//Modified from: Autumn leaves script- by Kurt Grigg (kurt.grigg@virgin.net)
//Modified by Dynamic Drive for NS6 functionality
//visit http://www.dynamicdrive.com for this script

//Pre-load your image below!
//CHANGE 5 to the number of images listed below
/*grphcs=new Array(5) 

//PRELOAD the involved images (extend or contract variables according to # of images used)
Image0=new Image();
Image0.src=grphcs[0]="images/wolke1.png"
Image1=new Image();
Image1.src=grphcs[1]="images/wolke2.png"
Image2=new Image();
Image2.src=grphcs[2]="images/wolke3.png"
Image3=new Image();
Image3.src=grphcs[3]="images/wolke4.png"
Image4=new Image();
Image4.src=grphcs[4]="images/wolke5.png"

//SPECIFY number of images to randomly display concurrently from list above. Less the more efficient
Amount=1; 
Ypos=new Array();
Xpos=new Array();
Speed=new Array();
Step=new Array();
Cstep=new Array();
ns=(document.layers)?1:0;
ns6=(document.getElementById&&!document.all)?1:0;
ie=document.all

if (ns){
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=80><img src="+rndPic+"></LAYER>");
}
}
else{
document.write('<div style="position:absolute;top:80px;left:0px;"><div style="position:absolute";>');
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write('<img id="si'+i+'" src="'+rndPic+'" style="position:absolute;top:80px;left:0px;">');
}
document.write('</div></div>');
}
WinHeight=(ns||ns6)?window.innerHeight-70:window.document.body.clientHeight;
WinWidth=(ns||ns6)?window.innerWidth:window.document.body.clientWidth;
for (i=0; i < Amount; i++){                                                                
 Ypos[i] = Math.round(Math.random()*3);
 Xpos[i] = Math.round(Math.random()*WinWidth);
 Speed[i]= Math.random()*5+1;
 Cstep[i]=0;
 Step[i]=0;
}
function fly(){
var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;
var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;

for (i=0; i < Amount; i++){
sy = Speed[i]*Math.sin(Cstep[i]);
sx = Speed[i]*0.2;
Ypos[i]+=sy;
Xpos[i]+=sx; 
if (Xpos[i] > WinWidth){
Ypos[i]=Math.round(Math.random()*300);
Xpos[i]=-60;
Speed[i]=Math.random()*5+1;
}

if (ns){
document.layers['sn'+i].left=Xpos[i]+wscrll;
document.layers['sn'+i].top=Ypos[i];
}

else if (ns6){
document.getElementById("si"+i).style.left=Xpos[i]+wscrll;
document.getElementById("si"+i).style.top=Math.min(WinHeight,Ypos[i]);
}

else{
eval("document.all.si"+i).style.left=Xpos[i]+wscrll;
eval("document.all.si"+i).style.top=Ypos[i];
} 
Cstep[i]+=Step[i];
}
setTimeout('fly()',20);
}

if (ie||ns||ns6)
window.onload=fly*/

function fly() {
 if(document.getElementById) {
  var planeStyle = document.getElementById("cloud1").style
  window.defaultStatus = "("+planeStyle.left+","+planeStyle.top+")"
  if(parseInt(planeStyle.left) > 1024) {
   planeStyle.left = 0
   planeStyle.top = 200
  }else{
   planeStyle.left = parseInt(planeStyle.left) + 2
   planeStyle.top = parseInt(planeStyle.top) - 0
  }
 }else if(document.all) {
  var planeStyle=window.document.all.cloud1.style
  window.defaultStatus = "("+planeStyle.posLeft+","+planeStyle.posTop+")"
  if(planeStyle.posTop < 10) {
   planeStyle.posLeft = 0
   planeStyle.posTop = 400
  }else{
   planeStyle.posLeft += 6
   planeStyle.posTop -= 5
  }
 }
 
 if(document.getElementById) {
  var planeStyle = document.getElementById("cloud2").style
  window.defaultStatus = "("+planeStyle.left+","+planeStyle.top+")"
  if(parseInt(planeStyle.left) > 1024) {
   planeStyle.left = 400
   planeStyle.top = 300
  }else{
   planeStyle.left = parseInt(planeStyle.left) + 2
   planeStyle.top = parseInt(planeStyle.top) - 0
  }
 }else if(document.all) {
  var planeStyle=window.document.all.cloud2.style
  window.defaultStatus = "("+planeStyle.posLeft+","+planeStyle.posTop+")"
  if(planeStyle.posTop < 10) {
   planeStyle.posLeft = 400
   planeStyle.posTop = 300
  }else{
   planeStyle.posLeft += 1
   planeStyle.posTop -= 5
  }
 }
 
}





