$(document).ready(function() {
    $("#slides").cycle({
        fx: 'fade',
        speed: 'slow',
        timeout: 0,
        prev: '#prev',
        next: '#next',
        pager: 'span#pagination',
    });
	
	// Thumbnails
	$(".thumb img").fadeTo("slow", 1.0); // This sets the opacity of the thumbs to fade down to 60% when the page loads

	$(".thumb img").hover(function(){
		$(this).fadeTo("slow", 0); // This should set the opacity to 0% on hover
	},function(){
   		$(this).fadeTo("slow", 1.0); // This should set the opacity back to 100% on mouseout
	});
	
	// Navigation Menu
	$("#menu-nav li").hover(
	  function () {
	    $(this).prepend($("<span>&brvbar; </span>"));
	  }, 
	  function () {
	    $(this).find("span:first").remove();
	  }
	);
	
	// Accordion Catalogues
	//$( "#accordion" ).accordion({
	//			autoHeight: false,
	//			navigation: true,
	//			collapsible: true,
	//			alwaysOpen: false,
	//			active: false
	//		});
	
	$('.status').text('+');
	   $('.accordionButton').click(function() {
	      $('.accordionButton').removeClass('on');
	      $('.accordionContent').slideUp();
	      $('.status').text('+');
	                                        
	      if($(this).next().is(':hidden') == true) {
	         $(this).addClass('on');
	         $(this).next().show();
	         $(this).find('.status').text('-');
	      } 
	   });
	        
	   $('.accordionContent').hide();
	                                
	   $(".scroll").click(function(event){
	      $('.accordionContent').hide();
	      event.preventDefault();
	                                        
	      var trgt = $(this).attr("id");
	      var target_offset = $("#"+trgt).offset();
	      var target_top = target_offset.top;
	                                        
	      $('html, body').animate({scrollTop:target_top}, 500);
	    });
			
});

