/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2001-4 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/
var wndo = [];

// Necessary to avoid errors before page loaded 
function dw_startScroll(num, dir, sp) {
  if ( wndo[num] && wndo[num].startScroll ) wndo[num].startScroll(dir, sp);
}

function dw_stopScroll(num) {
  if ( wndo[num] && wndo[num].stopScroll ) wndo[num].stopScroll();
}

function dw_loadLayer(num, id, cntId) {
  if ( wndo[num] && wndo[num].loadLayer ) wndo[num].loadLayer(id, cntId);
}

// increase speed onmousedown of scroll links
function dw_doubleSpeed(num) {
  if ( wndo[num] && wndo[num].speed ) wndo[num].speed *= 2;
}

function dw_resetSpeed(num) {
  if ( wndo[num] && wndo[num].speed ) wndo[num].speed /= 2;
}

function initScrollLayer() {
  // arguments: id of layer containing scrolling layers (clipped layer), id of layer to scroll, 
  // if horizontal scrolling, id of element containing scrolling content (table?)
  wndo[0] = new dw_scrollLayer('wn', 'lyr');
  
  // bSizeDragBar set true by default (explained at www.dyn-web.com/dhtml/scroll/ )
  // wndo.bSizeDragBar = false;
  
  // arguments: dragBar id, track id, axis ("v" or "h"), x offset, y offset
  // (x/y offsets of dragBar in track)
  // wndo[0].setUpScrollbar("dragBar", "track", "v", 1, 1);

  // this little bit only shows the scroll bars if we're greater than 270px
  var lyr = document.getElementById('lyr');
  var height = lyr.offsetHeight;
/*
  if(height > 270) {
    var up = document.getElementById('up');
    up.style.visibility = "visible";
    var dn = document.getElementById('down');
    dn.style.visibility = "visible";
  }
*/
}