jQuery(document).ready(function() {  
	
	// Hide 'howitsmade div's
	$("div.howitsmade").hide(); 
	$("div.howitsmade").hide();
	
	// Test for flash player 
 	if ($.browser.flash == true) { 
   		$("div.howitsmade.flash").show();  
	}
 	else {
   		$("div.howitsmade.noflash").show(); 
 	}
	
	// Tabbed browsing for non-flash player page
	//$("#howitsmade_lighters_link").click(function() {
	//	$("#howitsmade_lighters_noflash").hide();
	//	$("#howitsmade_lighters_main").fadeIn(); 
	//	return false;
	//});

});  

jQuery(document).ready(function() {  
	
	// Shows Archives "lightbox"
	$("a#see_archives").click(function() {
		$("div#fade_layer").show();
		$("div#sd_archives").fadeIn(); 
		return false;
	});
	
	// Closes Archives "lightbox"
	$("div#fade_layer").click(function() {
		$("div#fade_layer").hide();
		$("div#sd_archives").hide(); 
		return false;
	});
	
	// Archives "lightbox" tabbed browsing
	$("div.tabs #Ltab").click(function() {
		$("div.tabs .nav").removeClass("sel"); 
		$(this).addClass("sel"); 
		$("div.documents div.docs").hide(); 
		$("div.documents div#docs1").show(); 
		return false;
	});
	$("div.tabs #Mtab").click(function() {
		$("div.tabs .nav").removeClass("sel"); 
		$(this).addClass("sel"); 
		$("div.documents div.docs").hide(); 
		$("div.documents div#docs2").show(); 
		return false;
	});
	$("div.tabs #Rtab").click(function() {
		$("div.tabs .nav").removeClass("sel"); 
		$(this).addClass("sel"); 
		$("div.documents div.docs").hide(); 
		$("div.documents div#docs3").show(); 
		return false;
	});
	
});

// Older Archives slideshow
function mycarousel_initCallback(carousel) {
	// Assign prev/next buttons
    $('a#arcNext').bind('click', function() {
        carousel.next();
        return false;
    });

    $('a#arcPrev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

jQuery(document).ready(function() {
    jQuery("div#docs3 ul#docsList").jcarousel({
        scroll: 1,
        initCallback: mycarousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null, 
		wrap: 'circular'
    });
});
