//fadeIn #wrapper on pageload, fadeOut transition to be fixed		
$(document).ready(function() {
            $("#logo").css("display", "none");
			$("#logo").fadeIn(500);
			
	$("a.trans").click(function(event){
        event.preventDefault();
        linkLocation = this.href;
        $("#wrapper").fadeOut(500, redirectPage);
    });
 
    function redirectPage() {
        window.location = linkLocation;
    }
});
		
//Product image cycles
$(function(){
			$('.glassFront').cycle({ 
				fx:     'fade', 
				easing: 'easeInOutQuad',
				speed:  'slow', 
				timeout: 0, 
				next:   '.glassFrontNext', 
				prev:   '.glassFrontPrev' 
			});
		});	

$(function(){
			$('.pillarSlide').cycle({ 
				fx:     'fade', 
				easing: 'easeInOutQuad',
				speed:  'slow', 
				timeout: 0, 
				next:   '.pillarNext', 
				prev:   '.pillarPrev' 
			});
		});	
		
$(function(){
		$('.churchSlide').cycle({ 
				fx:     'fade', 
				easing: 'easeInOutQuad',
				speed:  'slow', 
				timeout: 0, 
				next:   '.churchNext', 
				prev:   '.churchPrev' 
			});
		});	

$(function(){
		$('.napkinSlide').cycle({ 
				fx:     'fade', 
				easing: 'easeInOutQuad',
				speed:  'slow', 
				timeout: 0, 
				next:   '.napkinNext', 
				prev:   '.napkinPrev' 
			});
		});	
		
$(function(){
		$('.tableSlide').cycle({ 
				fx:     'fade', 
				easing: 'easeInOutQuad',
				speed:  'slow', 
				timeout: 0, 
				next:   '.tableNext', 
				prev:   '.tablePrev' 
			});
		});	

$(function(){
		$('.treeSlide').cycle({ 
				fx:     'fade', 
				easing: 'easeInOutQuad',
				speed:  'slow', 
				timeout: 0, 
				next:   '.treeNext', 
				prev:   '.treePrev' 
			});
		});	
		
$(function(){
		$('.skullSlide').cycle({ 
				fx:     'fade', 
				easing: 'easeInOutQuad',
				speed:  'slow', 
				timeout: 0, 
				next:   '.skullNext', 
				prev:   '.skullPrev' 
			});
		});	
		
	
/*	
//Expandable Submenu
$(function() {
	// Expand or collapse:
	$("#cloth").click(function() {
		$("#clothSub").slideToggle("slow");
	});
	$("#candles").click(function() {
		$("#candleSub").slideToggle("slow");
	});
	$("#glass").click(function() {
		$("#glassSub").slideToggle("slow");
	});
	$("#curios").click(function() {
		$("#curiosSub").slideToggle("slow");
	});
});*/

//Expandable Submenu
$(function() {
	// Expand or collapse:
	$("#cloth").click(function() {
		$("#clothSub").slideToggle("slow");
	});
	$("#candles").click(function() {
		$("#candleSub").slideToggle("slow");
	});
	$("#curios").click(function() {
		$("#curiosSub").slideToggle("slow");
	});
});

//Tabbed Content
$(function() {
	$(".product").hide();  
	$("ul.subMenu li:first").addClass("active").show(); 
	//$(".product:first").show(); 

	$("ul.subMenu li").click(function() {
		$("ul.subMenu li").removeClass("active"); 
		$(this).addClass("active"); 
		$(".product").hide(); 
		$(".front").hide();
		var activeTab = $(this).find("a").attr("href"); 
		$(activeTab).fadeIn('slow');
		return false;
	});	
});


//Tabbed (nav to #glassFront)
$(function() {
	$("#glass").click(function() {
		$("#glassSub").slideToggle("slow");
		$("ul.subMenu li").removeClass("active"); 
		$(this).addClass("active"); 
		$(".product").hide(); 
		$("#glassFront").fadeIn('slow');
		return true;
	});
});

//Fade in Gallery thumbs on hover.
$(function() {
	$("#gallery li a img").fadeTo("slow", 0.8); // This sets the opacity of the thumbs to fade down to 60% when the page loads

	$("#gallery li a img").hover(function(){
		$(this).fadeTo("slow", 1.0); // This should set the opacity to 100% on hover
	},function(){
   		$(this).fadeTo("slow", 0.8); // This should set the opacity back to 60% on mouseout
	});
});



