var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0;
var old = 0;
var images = new Array();

function DHTML_init()
{
  if (window.opera) OP = 1;
  if (document.getElementById) {
    DHTML = 1;
    DOM = 1;
  }
  if (document.all && !OP) {
    DHTML = 1;
    MS = 1;
  }
  if (document.layers && !OP) {
    DHTML = 1;
    NS = 1;
  }
}

function getElem(param)
{
  var Elem;

  if (DOM) {
    if (typeof document.getElementById(param) == "object")
      Elem = document.getElementById(param);
    else
      Elem = void(0);
    return(Elem);
  }
  else if (MS) {
    if (typeof document.all[param] == "object")
      Elem = document.all[param];
    else
      Elem = void(0);
    return(Elem);
  }
  else if (NS) {
    if (typeof document[param] == "object")
      Elem = document[param];
    else
      Elem = void(0);
    return(Elem);
  }
  else
    return void(0);
}

function newBanner() {
  var n;
  do
    n = Math.floor (Math.random() * imageCount);
  while (n == old)
  getElem('bannerImage').src = images[n];
  old = n;
}

function startRotation(interval) {
  DHTML_init();

  imageCount=2;
  images[0]='./bilder/haupt_rotation1.jpg';
  images[1]='./bilder/haupt_rotation2.jpg';

  newBanner();
  window.setInterval ('newBanner()', eval(interval)*1000);
}




