    // ***** header banner ******
var currentBannerId = 0;
var bannerArray     = new Array();
var bannerClicked   = false;

addBannerToArray();
currentBannerId = Math.floor( Math.random() * bannerArray.length );
displayBanner();



// create new Banner
function Banner(url, image, ziel) {
  this.url 	 = url;
  this.image = image;
  this.ziel = ziel;
}


// add the banner to the bannerArray
function addBannerToArray() {


bannerArray.push(new Banner("http://newsletter.actebis.com/landingpage/hp_at/06_10/6139vF6b/hp_ess.html", "ba_598x60_Hyper-V_Bundles.jpg", "_blank"));
bannerArray.push(new Banner("http://www.actebis.com/pub/pdf/O-M8H54_FLYER_RESELLER_HR_DE-DE.pdf", "Webbanner_598x60_20ProzentRabatt.jpg", "_blank"));
bannerArray.push(new Banner("http://www.actebis.com/ec/at/de/ProductSearchList.do?currentMask.keyword=CORELDRAW X5&amp;forwardAction=&amp;currentMask.multipleNumber=true", "cdgsx5-598x60.gif", "_self"));


}


// display all banner from the bannerArray
function displayBanner() {
  currentBannerId = (currentBannerId == bannerArray.length-1) ? 0 : currentBannerId + 1;
  updateBanner();
  setTimeout('displayBanner()', 17000);
};

// update the banner with the currentBannerId
function updateBanner() {
	
  var innerHTML = "<img border=\"0\" src=\"/pub/images/" + bannerArray[currentBannerId].image + "\"/>";
  if (!bannerClicked) {
    innerHTML = "<a style=\"cursor:pointer;\" id=\"bannerLink\" onclick=\"openLink(" + currentBannerId + ")\">" + innerHTML + "</a>";
  }
  document.getElementById("bannerLayer").innerHTML = innerHTML;
}

// open link behind the banner with the currentBannerId
function openLink(id) {
  bannerClicked = true;
  document.getElementById("bannerLink").onclick = "";
  if (bannerArray[currentBannerId].ziel == "_blank") {
  	 newAdWindow = window.open(bannerArray[id].url);
	 newAdWindow.focus();
		}
  else {
	  window.location = bannerArray[id].url;
  	}
}