// JavaScript Document
$(document).ready (function(){
	 
	 $("div.gallery-text").hide(000);
	 $("div.gallery-text:eq(0)").show(100);
	 $('#flash').hide();
	 
	 
	 // elite slide & text
	 $("#elite-thumb").click(function(){
      $("#gallery-slide-rack").animate({ 
       left:'0',
	   fx: 'fade'
	   }, 1500 );
	
	$("div.gallery-text").fadeOut(1000);
	 $("div.gallery-text:eq(0)").fadeIn(1000);
    });
	 
	// teastained slide & text
	 $("#tea-thumb").click(function(){
      $("#gallery-slide-rack").stop().animate({ 
       left:'-666px'
      }, 1500 );	
	  
	 $("div.gallery-text").fadeOut(1000);
	 $("div.gallery-text:eq(1)").fadeIn(1000);
    });
	 
	 // svarndell slide & text
	 $("#svarndell-thumb").click(function(){
      $("#gallery-slide-rack").stop().animate({ 
       left:'-1332px'
	   }, 1500 );
	  
	 $("div.gallery-text").fadeOut(1000),
	 $("div.gallery-text:eq(2)").fadeIn(1000);
    });	
	 
	 // Crowd6 slide & text
	 $("#crowd6-thumb").click(function(){
      $("#gallery-slide-rack").stop().animate({ 
       left:'-1998px'
	   }, 1500 );
	  
	 $("div.gallery-text").fadeOut(1000),
	 $("div.gallery-text:eq(3)").fadeIn(1000);
    });	
	 
	 // Blog slide & text
	 $("#blog-thumb").click(function(){
      $("#gallery-slide-rack").stop().animate({ 
       left:'-2664px'
	   }, 1500 );
	  
	 $("div.gallery-text").fadeOut(1000),
	 $("div.gallery-text:eq(4)").fadeIn(1000);
    });	
	 
	  // Horse slide and text
	 $("#horse-thumb").click(function(){
      $("#gallery-slide-rack").stop().animate({ 
       left:'-3330px'
	   }, 1500 );
	  
	 $("div.gallery-text").fadeOut(1000),
	 $("div.gallery-text:eq(5)").fadeIn(1000);
    });
	
	// Elizabeth slide & text
	 $("#Elizabeth-thumb").click(function(){
      $("#gallery-slide-rack").stop().animate({ 
       left:'-3996px'
	   }, 1500 );
	  
	 $("div.gallery-text").fadeOut(1000),
	 $("div.gallery-text:eq(6)").fadeIn(1000);
    });	
	 
	
	 
	 
	// set thumbnails 
	 $("#thumbnail-rack img").addClass('transparent');
	 $("#thumbnail-rack img.transparent").fadeTo(100, 0.5); // Sets opacity to 0.5
	 $("#thumbnail-rack img.bright").fadeTo(0, 1.0);
 
        $('#thumbnail-rack img.transparent').hover(function(){
        $(this).fadeTo(100, 1.0); // Sets the opacity to 100% on hover
		},
		function(){
        $('#thumbnail-rack img.transparent:not(#thumbnail-rack img.bright)').fadeTo(100, 0.5); // Sets the opacity back to 50% on mouseout
        $('#thumbnail-rack img.bright').fadeTo(100, 1.0);
		});

		 
		$('#thumbnail-rack img').click(function(){
		$('#thumbnail-rack img').removeClass('bright');									
        $(this).addClass('bright'); // Sets the opacity to 100% on click
		$('#thumbnail-rack img.bright').fadeTo(0, 1.0);
	 });
		
 });
