<!--

//addEvent(window, 'load', init);

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];}
}

var imageWin
function openImgWin(imgWidth,imgHeight,imageName,commentURL){
  unescape(commentURL)
  if (imageWin && !imageWin.closed){
    imageWin.close()
    imgHeight += 100
    imgWidth += 40
    imageWin = window.open("../image_popup.php?image="+imageName+"&commentURL="+commentURL,"popup","width="+imgWidth+",height="+imgHeight+",scrollbars=yes");
    //imageWin.name = "popup"
  }
  else{
    imgHeight += 100
    imgWidth += 40
    imageWin = window.open("../image_popup.php?image="+imageName+"&commentURL="+commentURL,"popup","width="+imgWidth+",height="+imgHeight+",scrollbars=yes");
    //imageWin.name = "popup"
  }
}

function setCookie(a_name, a_value, a_lifetime) {
  var now = new Date();
  var expiry = new Date(now.getTime() + a_lifetime*24*60*60*1000);
  if ((a_value != null) && (a_value != ""))
    document.cookie=a_name + "=" + escape(a_value) + "; expires=" + expiry.toGMTString();
  return getCookie(a_name) != null;
}

function getCookie(a_name) {
  var a_start, an_end;
  if (document.cookie) {
    a_start = document.cookie.indexOf(a_name+"=");
    if (a_start < 0) return null;
    a_start = document.cookie.indexOf("=", a_start) + 1;
    an_end = document.cookie.indexOf(";", a_start);
    if (an_end < 0) an_end = document.cookie.length;
    return unescape(document.cookie.substring(a_start, an_end));
  }
  else return null;
}

function toggleFontSize(wert){
  x = parseInt(document.getElementsByTagName('body')[0].style.fontSize);
  if (wert=='0') {
    y = 100.01;
    z = y.toString(10)+"%";
  }
  else {
    y = x + wert + 0.01
    z = y.toString(10)+"%"
  }
  document.getElementsByTagName('body')[0].style.fontSize = z
  setCookie('fontsize', y, 365);
  //document.getElementsByTagName('html')[0].style.fontSize=(document.getElementsByTagName('html')[0].style.fontSize+wert)
}

function init(){
  if (getCookie('fontsize')){
    y = getCookie('fontsize');
    z = y.toString(10)+"%";
    document.getElementsByTagName('body')[0].style.fontSize = z;
  }
  else return null;
}

var set1 = {
        elem1: "headerback1",
        elem2: "headerback2",
        homeImages: ["/assets/graphics/sponsor_sparkasse.gif", "/assets/graphics/sponsor_biotest.gif"],
        sponsLink: ["http://www.sls-direkt.de", "http://www.biotest.de"]
      };

var set2 = {
        elem1: "headerback3",
        elem2: "headerback4",
        homeImages: ["/assets/graphics/sponsor_stadtwerke.gif", "/assets/graphics/sponsor_bmw.gif"],
        sponsLink: ["http://www.stadtwerke-dreieich.de", "http://www.bmw-dreieich.de"]
};

var set3 = {
        elem1: "headerback5",
        elem2: "headerback6",
        homeImages: ["/assets/graphics/sponsor_verkehrsbetriebe_dreieich.gif", "/assets/graphics/sponsor_mercure.gif", "/assets/graphics/sponsor_schlappeseppel.gif"],
        sponsLink: ["http://www.stadtwerke-dreieich.de", "http://www.mercure.com/de/hotel-5378-mercure-hotel-frankfurt-airport-dreieich/index.shtml", "http://www.schlappeseppel.de/"]
}

function anim (animSet) {
    this.t = 10;
    this.opac = 1;
    this.index = 0;
    this.nextIndex = this.index + 1;
    this.initialize(animSet);
}

anim.prototype.constructor = anim;

anim.prototype.initialize = function (animSet) {
    this.animSet = animSet;
    this.homeLoad(this.animSet);
}

anim.prototype.homeLoad = function () {
    var c_self = this;
    document.getElementById(this.animSet.elem1).style.backgroundImage = "url("+this.animSet.homeImages[this.index]+")";
    this.switchOpacity(this.animSet.elem1, 1);
    document.getElementById(this.animSet.elem2).style.backgroundImage = "url("+this.animSet.homeImages[this.nextIndex]+")";
    this.switchOpacity(this.animSet.elem2, 1);
    window.setTimeout(function (){ c_self.opacity()}, 1000);
}

anim.prototype.opacity = function () {
    var c_self = this;
    if (this.opac > 0){
        this.switchOpacity(this.animSet.elem1, this.opac);
        this.opac -=  0.025;
        window.setTimeout(function (){ c_self.opacity()}, this.t);
        this.t = 50
    }
    else {
        this.index = this.nextIndex;
        this.nextIndex = (this.nextIndex + 1) % this.animSet.homeImages.length;
        document.getElementById(this.animSet.elem1).style.backgroundImage = "url("+this.animSet.homeImages[this.index]+")";
        this.switchOpacity(this.animSet.elem1, 1);
        document.getElementById(this.animSet.elem1).firstChild.href = this.animSet.sponsLink[this.index];
        document.getElementById(this.animSet.elem2).style.backgroundImage = "url("+this.animSet.homeImages[this.nextIndex]+")";
        this.switchOpacity(this.animSet.elem2, 1);
        this.opac = 1;
        this.t = 3000;
        this.opacity();
    }
}

anim.prototype.switchOpacity = function (elem, opac) {
    if (navigator.userAgent.toLowerCase().indexOf("safari") !== -1) {
        document.getElementById(elem).style.opacity = opac;
    } else if (navigator.userAgent.toLowerCase().indexOf("msie") !== -1) {
        document.getElementById(elem).style.filter="Alpha(opacity="+opac*100+", finishopacity=0, style=0)";
    } else {
        document.getElementById(elem).style.MozOpacity = opac;
    }
}

function init() {
    var animSet1 = new anim(set1);
    var animSet2 = new anim(set2);
    var animSet3 = new anim(set3);
};

//-->