/*
//The following code is needed in any document that includes this to deal with the slider width
window.onload = function() {
document.getElementById("productSlider").style.width="480px";
document.getElementById("productSliderContainer").style.left="0px";
document.getElementById("productSliderContainer").style.width=(480*3)+"px";
}
*/
function loading( id )
{
	sc=document.getElementById("sliderControls").innerHTML="<img style='vertical-align: bottom' src='/images/loading.gif' border='0' alt='Loading' />";
}

function slide( sliderid, containerid, speed )
{
	sc=document.getElementById("sliderControls");
	s=document.getElementById(sliderid);
	c=document.getElementById(containerid);
	slider_offset=parseInt(c.style.left);
	slider_offset=slider_offset-speed;
	c.style.left = slider_offset+"px ";
	if( slider_offset % parseInt(s.style.width) != 0 )
	{
		t=setTimeout("slide('"+sliderid+"','"+containerid+"',"+speed+")",5);
	}
	else
	{
		controls = '';
		if( parseInt(c.style.left) < 0 )
		{
			if( parseInt(c.style.width) + parseInt(c.style.left) < parseInt(s.style.width) )
			{
				controls += "<br />";
			}
			controls += '<a href="javascript:loading(\'sliderControls\');slide(\'productSlider\',\'productSliderContainer\',-5);">&lt;&lt; Previous</a>';
		}
		//container left + container width > slider width
		if( parseInt(c.style.width) + parseInt(c.style.left) > parseInt(s.style.width) )
		{
			controls += '<br /><a href="javascript:loading(\'sliderControls\');slide(\'productSlider\',\'productSliderContainer\',5);">See More &gt;&gt;</a>';
		}
		sc.innerHTML=controls;
	}
}
