    var scrollSpeed = 20; 		// Speed in milliseconds
			var step = 1; 				// How many pixels to move per step
			var current = 0;			// The current pixel row
			var imageWidth = 948;		// Background image width
			var headerWidth = $(window).width() ;	// How wide the header is.
   
  


   
    $(document).ready(function() {
		
	

		
	$( "#accordion" ).accordion({
			autoHeight: false,
			navigation: true,
			collapsible: true,
			active : 'none'
		});
     
	
			
			 $(".photobox").fancybox();
			  $(".photo_slider").fancybox();
			
			
			
	 
	 
	 try{Typekit.load();}catch(e){};
	 
	 $(".show").hover(
  function () {
    $(this).find("p").slideDown('500');
	// $(this).find(".show_badge").rotate({animateTo:30})
  }, 
  function () {
    $(this).find("p").slideUp('500');
	// $(this).find(".show_badge").rotate({animateTo:0})
  }
);



 $('#show_slider').bxSlider({
            displaySlideQty: 4,
            moveSlideQty: 1,
			speed:700,
			onAfterSlide: function(){
				
				
				 $(".show").hover(
  function () {
    $(this).find("p").slideDown('500');
	// $(this).find(".show_badge").rotate({animateTo:30})
  }, 
  function () {
    $(this).find("p").slideUp('500');
	// $(this).find(".show_badge").rotate({animateTo:0})
  }
);

				
				
				
				}   
	      
        });
		
		
		 $('.gallery_slider.single').bxSlider({
            displaySlideQty: 4,
            moveSlideQty: 1,
			speed:700   
	      
        });


		   $(".gallery_slider.vid").each(function(){
        $(this).bxSlider({
            displaySlideQty: 4,
            moveSlideQty: 1,
			speed:700   
	      
        });
      });

	 
	 
	 
	
	
			
			//Calls the scrolling function repeatedly
			var init = setInterval("scrollBg()", scrollSpeed);
	 
	 
	
	 
	 
    });
	
	
			
			//The pixel row where to start a new loop
			var restartPosition = -(imageWidth - headerWidth);
			
			function scrollBg(){
				//Go to next pixel row.
				current -= step;
				
				//If at the end of the image, then go to the top.
				if (current == restartPosition){
					current = 0;
				}
				
				//Set the CSS of the header.
				$('#clouds').css("background-position",current+"px 0");
			};


