$(document).ready(function()
{
	//view switcher
	$('#view_switcher a').hover(function(e)
	{
		//check that its not active already - if it is, don't do anything
		if($(this).attr('class')!='active')
		{ 
			//want to change src of image #view-img
			var switchTo =	$(this).attr('name');
			var imgId=			$(this).attr('id');
			var imgPath = 'http://www.cherrybrush.co.uk/images/uploads/'+switchTo+'/'+imgId+'.jpg';
			//remove classes of others
			$('#view_switcher a').removeClass('active');
			//tell this one to be actice
			$(this).addClass('active');
			
			//alert('swicth to '+switchTo+', id '+imgId+', path '+imgPath);
			
			//change the image
			$('#view-img').fadeOut('fast',
								   function(){
									 $('#view-img').attr('src',imgPath); 
									  $('#view-img').fadeIn('fast');
									}
			);
		}//end if not active		
		
	}, function(){}); //end view switcher listener
	
	//stop link loading on click
	$('#view_switcher a').click(function(e){ e.preventDefault(); });
	
	
	//expand scroll info
	$('#view-showscrollinfo').click(function(e){
												 e.preventDefault();
												// $('#view-more-scroll-info').addClass('showme');
												 $('#view-more-scroll-info').slideDown('slow');
	});
	
	//collpse scroll info
	$('#view-more-scroll-info .close').click(function(e){
												 e.preventDefault();
												// $('#view-more-scroll-info').addClass('showme');
												 $('#view-more-scroll-info').slideUp('slow');
	});
	
}); //end rdy



		
	