// JavaScript Bibliothek

// ************************************************************************************
// functions for rollover-effects
// ************************************************************************************
var browserOK = true;
var Bilder;
var anzahlObj = 0;

Bilder    = new Array();

// functionality for header
function laden(name, erstes, zweites) {  
  if (browserOK) {     
    Bilder[anzahlObj]        = new Array(3);
    Bilder[anzahlObj][0]     = new Image();
    Bilder[anzahlObj][0].src = erstes;
    Bilder[anzahlObj][1]     = new Image();
    Bilder[anzahlObj][1].src = zweites;
    Bilder[anzahlObj][2]     = name;
    anzahlObj++;
  }
}

function an(name){
  if (browserOK) {
     for (i = 0; i < anzahlObj; i++) {
      if (document.images[Bilder[i][2]] != null)
        if (name != Bilder[i][2]) { 
          // alle anderen Bilder zuruecksetzen
          document.images[Bilder[i][2]].src = Bilder[i][0].src;
        } else {
          document.images[Bilder[i][2]].src = Bilder[i][1].src;
        }
    }
  }
}

function aus(){
  if (browserOK) {
     // alle Bilder zuruecksetzen
     for (i = 0; i < anzahlObj; i++) {
      if (document.images[Bilder[i][2]] != null) 
        // alert ("aus  " + i);
        document.images[Bilder[i][2]].src = Bilder[i][0].src;
    }
  }
}



// ************************************************************************************
// functions for dia-show
// name of pictures in img-tag must be "animation"
// ************************************************************************************

// variables for dia-show
var bilder2;
bilder2    = new Array();
pictnr     = 1;      // Initalisierung

// init Animation  of dia-show
function nextpict_init(pictname, pictnrmax)
{
  // alert ('pictname:  ' + pictname + '    pictnrmax:  ' + pictnrmax);
  for (i=1; i<=pictnrmax; i++)
  {
      if (browserOK) 
	  {
      bilder2[i]     = new Image();
	  bilder2[i].src = pictname + i + ".jpg";
	  } 
  }
}
										
// Animation  of dia-show
function nextpict(pictnrmax)
{  
    
	if (browserOK) 
	{
	// alert ('pictnr:  ' + pictnr  + '   pictnrmax ' + pictnrmax);
	document.animation.src = bilder2[pictnr].src;
	pictnr++;
	if (pictnr > pictnrmax) pictnr = 1;
	bildermax = pictnrmax;
    setTimeout('nextpict(bildermax)',verzoegerung);	
	}
}

// ************************************************************************************
// functions for browser-check
// ************************************************************************************

// BrowserCheck

//ns4 = (document.layers)? true:false
//ie4 = (document.all)? true:false

var b = navigator.appName;
if (b=="Netscape") 
   this.b = "ns";
else if (b=="Microsoft Internet Explorer") 
   this.b = "ie";
else
   this.b = b;
//alert (" name " + this.b + " " + this.v);
this.v   = parseInt(navigator.appVersion);
this.ns  = (this.b == "ns" && this.v >= 4);
this.ns3 = (this.b == "ns" && this.v == 3);
this.ns4 = (this.b == "ns" && this.v == 4);
this.ns5 = (this.b == "ns" && this.v == 5);  // netscape 6.1 is identified as ns 5 !!
this.ns6 = (this.b == "ns" && this.v == 6);
this.ie  = (this.b == "ie" && this.v >= 4);
// handling for opera (opera identifies itself as ie5 !)
if (navigator.userAgent.indexOf('Opera')>0)
   {
   this.ie4 = false;
   this.ie5 = false;
   this.ie6 = false;
   this.ie7 = false;
   this.ie8 = false;
   this.ie9 = false;
   }
else
   {
   this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0);
   this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0);
   this.ie6 = (navigator.userAgent.indexOf('MSIE 6')>0);
   this.ie7 = (navigator.userAgent.indexOf('MSIE 7')>0);
   this.ie8 = (navigator.userAgent.indexOf('MSIE 7')>0);
   this.ie9 = (navigator.userAgent.indexOf('MSIE 9')>0);
   }

if (this.ie5) this.v = 5;
if (this.ie6) this.v = 6;
if (this.ie7) this.v = 7;

this.dhtml  = (this.ns||this.ie);
this.filter = (this.ie5 || this.ie6 || this.ie7 || this.ie8 || this.ie9)
