/*************************************************************************
  This code is from Dynamic Web Coding at www.dyn-web.com
  Copyright 2001-4 by Sharon Paine 
  See Terms of Use at 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!
  -------------------------------------------------------
  Code modified by BlackLeaf, LLC to meet requirements.
  http://www.blackleafstudios.com
*************************************************************************/

function initScrollLayers() {
	
  // arguments: id of layer containing scrolling layers (clipped layer), id of layer to scroll, 
  // if horizontal scrolling, id of element containing scrolling content (table?)
var scrolltypes = 0;
var wndo1 = new dw_scrollObj('content1_window', 'content1_layer', null);

  // arguments: dragBar id, track id, axis ("v" or "h"), x offset, y offset
  // (x/y offsets of dragBar in track)
  wndo1.setUpScrollbar("dragBar1", "track1", "v", 1, 1);
  
	if(document.getElementById("content2_layer")) { // Test to see if content2 actually exists, if so load it too
		var wndo2 = new dw_scrollObj('content2_window', 'content2_layer', photo_preview);
		wndo2.setUpScrollbar("dragBar2", "track2", "v", 1, 1);
		scrolltypes = 2;
	}
  // Read instructions if your scrolling layers are inside tables
	if(document.getElementById("previewlayer")) {
		var wndo = new dw_scrollObj('previewwindow', 'previewlayer', 't1');
		scrolltypes = scrolltypes + 3;
	}
	if(scrolltypes == 5) {
		dw_schowLayers("scrollbar1", "scrollbar2", "scrollbar");
		
		if(scrolltypes == 2) {
			dw_showLayers("scrollbar1", "scrollbar2");
		}
			else dw_showLayers("scrollbar1");
	}

  dw_scrollObj.checkScrollbar('content1_window', 'content2_window', 'previewwindow');
}

function dw_showLayers() {
  if ( document.getElementById ) {
    var lyr, i;
    for (i=0; arguments[i]; i++) {
      lyr = document.getElementById( arguments[i] );
      lyr.style.visibility = "visible";
    }
  }
  
}
