var ClipVal = 0; //temporary variable

var scrolltimer = null; //just the timer



function scrollthumbs(sVal,MaxVal) //scrolls the images

{


  if(ClipVal+sVal<1 && ClipVal+sVal>MaxVal) //ClipVal is current position - works out if it is between the limits.

  {

    ClipVal = ClipVal + sVal; // adds on scroll value

    //grabs the display frame

    var objt = document.getElementById('thumbs'); 
    objt.style.marginLeft = ClipVal+"px"; //sets marginLeft for the display frame. When scrolling up and down would be marginTop
    if(sVal==3 || sVal==-3 || sVal==4 || sVal==-4) scrolltimer = setTimeout("scrollthumbs("+sVal+", "+MaxVal+")", 10); //if mousing over then start timer. Need to change these values if change mouseover values.

  }

}



//clears the timer

function StopScroll()

{

  clearTimeout(scrolltimer);

}




