var options = {average : false};

$(document).ready( function() {
	$("#gallery_items").find("a").each(function(i) {
		$(this).find("img").show();
		$(this).find("canvas").show();
	});
	$("#side_gallery_items").find("a").each(function(i) {
		$(this).find("img").show();
		$(this).find("canvas").show();
	});
	$("#side_gallery_items_wide").find("a").each(function(i) {
		$(this).find("img").show();
		$(this).find("canvas").show();
	});
	$("a.blackened").each(function(i) {
		$(this).find("img").show();
		$(this).find("canvas").show();
	});

	$("a.explicitlt").lightbox();
	$("#gallery_items").find("a.lt").lightbox();
	$("#side_gallery_items").find("a.lt").lightbox();
	$('#referencelist').jcarousel({
			vertical: true,
			scroll: 1,
			visible: 3
	});
	$('#referencelist_two').jcarousel({
			vertical: true,
			scroll: 1,
			visible: 2
	});
	$('#smallestminiaturelist').jcarousel({
			vertical: false,
			scroll: 1,
			visible: 10
	});
	$('#referencelisttext').jcarousel({
			vertical: false,
			scroll: 1,
			visible: 2
	});	
	
	
	$("#gallery_items").find("a").each(function(i) {
		$(this).hover(function(){
			$(this).find("img").hide();
			$(this).find("canvas").hide();
		},function(){
			$(this).find("img").show();
			$(this).find("canvas").show();
		});
	});

	$("#side_gallery_items").find("a").each(function(i) {
		$(this).hover(function(){
			$(this).find("img").hide();
			$(this).find("canvas").hide();
		},function(){
			$(this).find("img").show();
			$(this).find("canvas").show();
		});
	});
	$("#side_gallery_items_wide").find("a").each(function(i) {
		$(this).hover(function(){
			$(this).find("img").hide();
			$(this).find("canvas").hide();
		},function(){
			$(this).find("img").show();
			$(this).find("canvas").show();
		});
	});	
	$("a.blackened").each(function(i) {
		$(this).hover(function(){
			$(this).find("img").hide();
			$(this).find("canvas").hide();
		},function(){
			$(this).find("img").show();
			$(this).find("canvas").show();
		});
	});

	$(window).load(function() {
		$("#gallery_items").find("a").find("img").pixastic("desaturate");
		$("#side_gallery_items").find("a").find("img").pixastic("desaturate");
		$("#side_gallery_items_wide").find("a").find("img").pixastic("desaturate");
		$("a.blackened").find("img").pixastic("desaturate");
	});

});


