function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function initImgRotation() {
  // create rotating image objects here 
  // arguments: image name, rotation speed
  var rotator1 = new rotateImgObj('img1',3500);
  // add the images to rotate into that image object  
  rotator1.addImages("cart1.jpg","cart2.jpg","cart3.jpg","cart4.jpg","cart5.jpg","cart6.jpg");
  rotator1.rotate();
  
  rotateImgObj.start();
}

// If all the images you wish to display are in the same location, you can specify the path here 
rotateImgObj.imagesPath = "/_images/";

// no need to edit code below 
/////////////////////////////////////////////////////////////////////
rotateImgObjs = []; // holds all rotating image objects defined
// constructor 
function rotateImgObj(nm,s) {
  this.speed=s; this.ctr=0; this.timer=0;  
  this.imgObj = document.images[nm]; // get reference to the image object
  this.index = rotateImgObjs.length; rotateImgObjs[this.index] = this;
  this.animString = "rotateImgObjs[" + this.index + "]";
}

rotateImgObj.prototype = {
  addImages: function() { // preloads images
    this.imgObj.imgs = [];
    for (var i=0; arguments[i]; i++) {
      this.imgObj.imgs[i] = new Image();
      this.imgObj.imgs[i].src = rotateImgObj.imagesPath + arguments[i];
    }
  },

  rotate: function() {
    if (this.ctr < this.imgObj.imgs.length-1) this.ctr++;
    else this.ctr = 0;
    this.imgObj.src = this.imgObj.imgs[this.ctr].src;
  }
}

// sets up rotation for all defined rotateImgObjs
rotateImgObj.start = function() {
  for (var i=0; i<rotateImgObjs.length; i++) 
    rotateImgObjs[i].timer = setInterval(rotateImgObjs[i].animString + ".rotate()", rotateImgObjs[i].speed);                     
}

var iF_timer=null;

function stopScroll(){
clearTimeout(iF_timer)}

function Lvl_iFrameScroller(f,i,t,d,a){ //v1.0 4LevelWebs
  var r="frames['"+i+"']",ie=document.all,y,c=(f&&!i)?f:(f&&i)?r:i;
 var b=(!f)?r:f+"."+r,o=(eval("opener&&opener.parent."+b))?"opener.":'';
 var v=(f&&i)?y=o+"parent."+f+"."+c:y=o+"parent."+r;
  var e=(a==1)?'scrollLeft':'scrollTop',n =(a==1)?'pageXOffset':'pageYOffset';
   var x=(a==1)?'p,0':(a==2)?'10000,0':(a==3)?'0,10000':'0,p',s=(d==0)?(ie)?t:t+.9:(ie)?-t:-(t-.9);
    var p=(document.all)?eval(y+".document.body."+e+"")+s:eval(y+"."+n+"")+s;
     var m =eval(y+".window.scrollTo("+x+")");
  iF_timer=setTimeout("Lvl_iFrameScroller('"+f+"','"+i+"',"+t+","+d+","+a+")",1)
}

function Lvl_targetIframe(f,i,u){ //v1.0 4LevelWebs
 var b=(!f)?i:f+".frames['"+i+"']",o=(eval("opener&&opener.parent."+b))?"opener.":'';
 var el=eval(o+"parent."+b);el.location=u;document.MM_returnValue=false;
}

