/*************************************************************************
  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', 'lyr1');
  
  // bSizeDragBar set true by default (explained at www.dyn-web.com/dhtml/scroll/ )
  // wndo.bSizeDragBar = fal????;???>?>?>?>??†????????????????????????i1??`>`>?????†??-?se;
  
  // 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);
  
  // pass id's of any wndo's that scroll inside tables
  // i.e., if you have 3 (with id's wn1, wn2, wn3): GeckoTableBugFix('wn1', 'wn2', 'wn3');
  GeckoTableBugFix('wn'); 
}
