
document.observe('dom:loaded', function() 	
	{ 
		
		new Effect.Opacity('scroll_left', { from: 1.0, to: 0.4, duration: 0.5 });
	});

function scroll_left()
	{ 
		
		//JS HANDS BACK A STRING FOR A POSITION - THIS CHANGES IT TO A NUNBER 
		stupid_text_variable = document.getElementById('product').style.left; 				
		text_variable = stupid_text_variable.split("p"); 	
		var position = Number(text_variable[0]); 				
		
		
		if (position == -340) 
			{
				new Effect.Opacity('scroll_left', { from: 1, to: 0.4, duration: 0.5});
			}

		
		if (position < 0 || position==undefined)
			{
				new Effect.Opacity('scroll_right', { from: 1, to: 1, duration: 0.5});	
				new Effect.Move('product', { x: 340, y: 0,  mode: 'relative',  queue: { position: 'end', scope: 'scroll', limit: 1 } }); return false;
			}

	}
	

function scroll_right()
	{ 
		
		//JS HANDS BACK A STRING FOR A POSITION - THIS CHANGES IT TO A NUNBER 
		stupid_text_variable = document.getElementById('product').style.left; 				
		text_variable = stupid_text_variable.split("p"); 	
		var position = Number(text_variable[0]); 		
		

		if (position == -400) 
			{
				new Effect.Opacity('scroll_right', { from: 1, to: 0.4, duration: 0.5});
			}
		
		if (position > -400|| position==undefined)
			{ 
				new Effect.Opacity('scroll_left', { from: 1, to: 1, duration: 0.5 });
				new Effect.Move('product', { x: -340, y: 0,  mode: 'relative',  queue: { position: 'end', scope: 'scroll', limit: 1 } }); return false;										
			}
			
	}