// Bild-Rollover
function fnRollImgIn(bild) {
  if(bild) {
    bild.src = '/images/bpa/BROnline_.gif';
  }
}
function fnRollImgOut(bild) {
  if(bild) {
    bild.src = '/images/bpa/logo.gif';
  }
}

// ****** Font-Scale ******
function FontSize(_size, _targets, _exceptions) {
    this.size = _size || 11;
    this.min = 9;
    this.max = 16;
    this.targets = _targets || ['fsTextbody','fsHeadbold','fsHeadnormal'];
    this.exceptions = _exceptions || 'haferbrei#hirsebrei#';
    this.lucky = this.checkBrowser();
  }
FontSize.prototype = {
  larger : function() {
    (this.size < this.max) ? ++this.size : this.size;
    if (this.lucky) this.scale();
  },
  smaller : function() {
    (this.size > this.min) ? --this.size : this.size + 'px';
    if (this.lucky) this.scale();
  },
  scale : function() {
    var oTarget = null;
    for (var k = 0; k < this.targets.length; k++) {
      oTarget = document.getElementById(this.targets[k]);
      if (oTarget) this.changeSize(oTarget);
    }
  },
  changeSize : function(oo) {
    if (oo.style) {
      oo.style.fontSize = this.size + 'px';
      oo.style.lineHeight = '1.3em';
    }
    for (var k = 0; k < oo.childNodes.length; k++) if (this.exceptions.indexOf((oo.childNodes[k].id || '#') + '#') == -1) this.changeSize(oo.childNodes[k]);
  },
  checkBrowser : function() {
    if (document.all && document.getElementById) return true;
    if (navigator.userAgent.indexOf('Netscape6/') >= 0 || navigator.userAgent.indexOf('Gecko') >= 0) return true;
    return false;
  },
  inc : function(oo) {
    this.larger();
    if (oo) oo.blur();
    return false;
  },
  dec : function(oo) {
    this.smaller();
    if (oo) oo.blur();
    return false;
  }
}
font_size = new FontSize();

// ehemals in utility.js
function Utility() {
this.ua();
this.libPath = '';
}
Utility.prototype = {
  ua : function() {
    this.version = navigator.appVersion;
    this.agent = navigator.userAgent;
    this.dom = document.getElementById?1:0
    this.opera5 = this.agent.indexOf("Opera 5")>-1;
    this.ie5 = (this.version.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
    this.ie6 = (this.version.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
    this.ie = this.ie5 || this.ie6;
    this.gecko = this.agent.indexOf('Gecko') != -1;
    this.ns6 = (this.dom && parseInt(this.version) >= 5 && this.gecko)?1:0;
    this.mac = this.agent.indexOf('Mac') != -1;
    this.good_browser = (this.ie || this.ns6 || this.gecko) && !this.mac;
  },
  goodBrowser : function() {
    return this.good_browser;
  },
  setLibPath : function(path) {
    this.libPath = path;
  },
  include : function(source, path) {
    var p = path || this.libPath || '';
    if (p.substr(p.length-1) != "/") p += "/";
    var s_inc = '';
    var s_incx = '';
    var xs = source.split(/\s*;\s*/);
    if (xs.length > 0) {
      for (var k = 0; k < xs.length; k++) {
        if (xs[k].indexOf('.css') >= 0) s_incx = '<LINK REL="STYLESHEET" TYPE="text\/css" HREF="source-name" ID="'+ p + xs[k] +'">\n';
        else s_incx = '<SCRIPT SRC="source-name" LANGUAGE="JavaScript1.2"><\/SCRIPT>\n';
        s_inc += s_incx.replace('source-name', p + xs[k]);
      }
    }
    document.write(s_inc);
  },
  addWindowListener : function(type, fn) {
    if (!type || !fn || 'onload;onunload;onerror;'.indexOf(type+';') == -1) return false;  /* s.h. fehler behandlung eingebaut */
    if (typeof(window.addEventListener) != 'undefined')window.addEventListener(type.replace(/^on/,''), fn, false);
    else if (typeof(window.attachEvent) != 'undefined')window.attachEvent(type, fn);
    else if (window[type] != null) {
      var __onload = window[type];
      window[type] = function(e) {
        __onload(e);
        fn();
      }
    } else {
      window[type] = fn;
    }
  }
}


