

function initScroll(){

  var play = $('play');
  var ff = $('FF');
  var rewind = $('rewind' );

  // add scroll and stop events to elements
  if( play ){
    play.speed = 30; //miliseconds
    play.distance = 2; //pixels
    Event.observe( play, 'mouseover',go );
    Event.observe( play, 'mouseout', stop );
  }
  if( ff ){
    ff.speed = 50;
    ff.distance = 50;
    Event.observe( ff, 'mouseover', go );
    Event.observe( ff, 'mouseout', stop );
  }
  if( rewind ){
    rewind.speed = 50;
    rewind.distance = -50;
    Event.observe( rewind, 'mouseover', go );
    Event.observe( rewind, 'mouseout', stop );
  }

  if (window.addEventListener) {
    window.addEventListener("DOMMouseScroll", this.mouseScroll, false);
  } else {
    document.attachEvent("onmousewheel", this.mouseScroll);
  }

  correctPNG();
}
	  
function go(e){
  Event.extend( e ); 
  var element = Event.element(e);
  //console.log( "scrolling "+ element.id +" by: " + element.distance + "; speed: " + element.speed );
  element.ix = setInterval( "window.scrollBy("+element.distance+",0)", element.speed );  
}

function stop(e){
  Event.extend( e ); 
  var element = Event.element(e);
  //console.log( "clearing timeout for " + element.id );
  clearInterval( element.ix );  
}

function mouseScroll(e){
  if (!e) var e = window.event;

  if (e.wheelDelta <= 0 || e.detail>=0){  
    window.scrollBy(80,0);
  } else {
    window.scrollBy(-80,0) ; 
  }
}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version < 7) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}

