
var DHTML = (document.getElementById || document.all || document.layers);

function getObj(name)
{
   if (document.getElementById) {
      this.obj = document.getElementById(name);
      this.style = document.getElementById(name).style;
   }
   else if (document.all) {
      this.obj = document.all[name];
      this.style = document.all[name].style;
   }
   else if (document.layers) {
      this.obj = document.layers[name];
      this.style = document.layers[name];
   }
}

// Return the available content width space in browser window
function getInsideWindowWidth() {
   if (window.innerWidth) {
      return window.innerWidth;
   } else if (document.body && document.body.clientWidth) {
      return document.body.clientWidth;
   }
   return screen.availWidth;
}

var imgWidth = 3447;
var imgPosition = -1500;
var insideWindowWidth = getInsideWindowWidth();
var distance = 1;
var interval = 30;

window.setInterval("pan();", interval);

function pan()
{
   if (!DHTML) return;
   var theImg = new getObj('panorama');
   if ((imgPosition - insideWindowWidth + distance <= -imgWidth) || (imgPosition + distance >= 0)) distance = -distance;
   imgPosition += distance;
   theImg.style.backgroundPosition = imgPosition + 'px';
}

