﻿var count=15;
var myHeads=new Array(15);
myHeads[0]="top1.jpg";
myHeads[1]="top2.jpg";
myHeads[2]="top3.jpg";
myHeads[3]="top4.jpg";
myHeads[4]="top5.jpg";
myHeads[5]="top6.jpg";
myHeads[6]="top7.jpg";
myHeads[7]="top8.jpg";
myHeads[8]="top9.jpg";
myHeads[9]="top10.jpg";
myHeads[10]="top11.jpg";
myHeads[11]="top12.jpg";
myHeads[12]="top13.jpg";
myHeads[13]="top14.jpg";
myHeads[14]="top15.jpg";


var topPos=0;
var speedStep=20;
var currentIdx=0;
function getObj( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  return elem;
}
function scrollRightBanner() 
{
        var objBanner=getObj("bannerInRightSideID");//MM_findObj("bannerInLeftSideID", document);
        currentIdx++;
        if (currentIdx>count-1)
            currentIdx=0;
        if (objBanner!=null)
            objBanner.src="images/"+myHeads[currentIdx];
        else
            alert("bannerInRightSideID ID was removed, please contact our programmer at info@biost.com");    
}
var moveBanner;
function rollBanner() 
{
    moveBanner= setInterval("scrollRightBanner()", 4000);//setTimeout("scrollRightBanner()", 10);//
}
function stopRollingBanner()
{
    clearTimeout(moveBanner);
}
