/* brand tray */

function slider(dir)
	{
		if(slider != 0)
			{

				if(dir != 0)  //move left
					{
						if(sliderCounter == 0)
							{
								$('sliderGroup2').style.left = sliderWidth;
							}
						//reset the photo containers and the counter 
						if(sliderCounter == (sliderTotal-(sliderTotal*2)))
							{
								$('sliderGroup1').style.left = '0px';
								$('sliderGroup2').style.left = sliderWidth;
								sliderCounter = 0;
							}
						sliderCounter = sliderCounter -1;
						Effect.MoveBy( 'sliderGroup1', 0, -230, { beforeStart: function() { disablesliderBtns(0); }, afterFinish: function() { disablesliderBtns(1); }, duration:1} );
						Effect.MoveBy( 'sliderGroup2', 0, -230, {duration:1} );
						$('next').style.background = 'url(/patient/Images/Pods/slider_arrow_right_on.gif) no-repeat';
					}
				else  //move right
					{
						if(sliderCounter == 0)
							{
								$('sliderGroup2').style.left = sliderWidthRight;
							}
						//reset the photo containers and the counter
						if(sliderCounter == sliderTotal)
							{
								$('sliderGroup1').style.left = '0px';
								$('sliderGroup2').style.left = sliderWidthRight;
								sliderCounter = 0;
							}
						sliderCounter = sliderCounter +1;
						Effect.MoveBy( 'sliderGroup1', 0, 230, { beforeStart: function() { disablesliderBtns(0); }, afterFinish: function() { disablesliderBtns(1); }, duration:1} );
						Effect.MoveBy( 'sliderGroup2', 0, 230, {duration:1} );
						$('prev').style.background = 'url(/patient/Images/Pods/slider_arrow_left_on.gif) no-repeat';
					}
			}
	}

//this function deactivates button while photo gallery is moving
function disablesliderBtns(active)
	{
		if(active == 0)
			{
				$('next').onclick =  null;
				$('prev').onclick =  null;
			}
		if(active == 1)
			{
				$('next').onclick =  slider;
				$('next').style.background = 'url(/patient/Images/Pods/slider_arrow_right_off.gif) no-repeat';
				$('prev').onclick =  new Function("slider("+0+")");
				$('prev').style.background = 'url(/patient/Images/Pods/slider_arrow_left_off.gif) no-repeat';
			}
	}
