var cntDefault = 1;
var cntOther   = 1;
var to         = null;

function picChange()
{
  window.clearTimeout(to);
	var pictureArr = null;
  this.imgObj  = document.getElementById('picture');
  this.imgPath = this.imgObj.src.substr(0, this.imgObj.src.lastIndexOf('/') + 1);
  this.imgName = this.imgObj.src.replace(this.imgPath, ''); 
  if(location.href.indexOf('buchung') > -1)
  {
    pictureArr   = buchungArr;
    this.imgPath = '/bilder/wechsel-buchung/';
  }
  else
  {
    pictureArr   = indexArr;
    this.imgPath = '/bilder/wechsel-index/';
  }
  this.imgObj.src = this.imgPath + pictureArr[cntDefault]
  cntDefault = cntDefault < pictureArr.length -1 ? cntDefault + 1 : 0;
  to = window.setTimeout("picChange()", 3000);
}

window.onload = function()
{	
  if(document.getElementById('picture') != null && typeof(document.getElementById('picture')) == 'object')
  {
  	to = window.setTimeout("picChange()", 3000);
  }
}
