/*************************************************************************
  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 = [];
var docwidth = (document.body) ? document.body.clientWidth : 800;

// 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();
}

// 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() {
  if (document.getElementById && !document.all) {
  	var wn = document.getElementById("wn");
  }
  
  // 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', 't1');
  
  // 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'); 
  initDesc();
}

function showDesc(id)
{
	var box_content;
	var prod;
	
	if (document.getElementById) {
		//box_content = document.getElementById('moreinfo_content');
		prod = document.getElementById('prod_'+id);
	}
	else if (document.all) {
		//box_content = document.all['moreinfo_content'];
		prod = document.all['prod_'+id];
	}
	//if (docwidth > 800)
	//	box_content.innerHTML = desc[id];
		
	prod.className = 'homepicb';
}

function hideDesc(id)
{
	var box_content;
	var prod;
	
	if (document.getElementById) {
		//box_content = document.getElementById('moreinfo_content');
		prod = document.getElementById('prod_'+id);
	}
	else if (document.all) {
		//box_content = document.all['moreinfo_content'];
		prod = document.all['prod_'+id];
	}
	//if (docwidth > 800)
	//	box_content.innerHTML = desc['default'];
	prod.className = 'homepic';
}

function initDesc()
{
	var box_content;
	
	if (document.getElementById) {
		box_content = document.getElementById('moreinfo_content');
	}
	else if (document.all) {
		box_content = document.all['moreinfo_content'];
	}
	
	if (docwidth > 800)
		box_content.innerHTML = desc['default'];
}
