/************************************************************************
		Copyright 2010 Darren Berry

		All rights reserved. The information contained in this document
		is confidential and may also be proprietary and trade secret. It
		is the intellectual property of Darren Berry, and without
		prior written approval from Darren Berry no part of this
		document may be reproduced or transmitted in any form or by any
		means, including but not limited to electronic, mechanical,
		photocopying or stored in any retrieval system of whatever nature.
		The use of copyright notice does not imply unrestricted public
		access to any part of this document. 
*************************************************************************/

var sliderSpeed = 1;
var sliderDelay = 20;
var sliderWidth = 0;
var arrThumb = new Array();
var timer = null;

function addThumb(strThumb, strHref, strTip)
{
	arrThumb.push('<a href="' + strHref + '" title="' + strTip + '"><img width="120" height="150" src="' + strThumb + '" /></a>');
}

function initSlider()
{
	if (obj = document.getElementById("sliderThumbs"))
	{
		strThumbs = arrThumb.join();
		obj.innerHTML = '<nobr>' + strThumbs + '</nobr>';
		sliderWidth = obj.offsetWidth;
		obj.innerHTML = '<nobr>' + strThumbs + " " + strThumbs + '</nobr>';
	}
	setTimeout("startSlider()", 2000);
}

function startSlider()
{
	if (timer)
		clearInterval(timer);
	timer = setInterval("doSlider()", sliderDelay);
}

function stopSlider()
{
	clearInterval(timer);
}

function doSlider()
{
	if (obj = document.getElementById("sliderThumbs"))
	{
		offset = parseInt(obj.style.left);
		obj.style.left = (offset > -sliderWidth) ? (offset - sliderSpeed + "px") : (offset + sliderWidth + "px");
	}
}

