$(document).ready(function() {
	
	Cufon.replace("#promo span, #side .more, #side .events span.date", { fontFamily: "Soho Gothic Pro Bold", hover: true });
	Cufon.replace("#content h2", { fontFamily: "Soho Gothic Pro Medium", textShadow: "#602319 3px 3px" });
	Cufon.replace("h3", { fontFamily: "Soho Gothic Pro Bold", textShadow: "#602319 2px 2px" });
	
	$("#promo-banners").cycle({
		timeout: 6000,
		speed: 2000,
		slideExpr: "div"
	});
	$("#promo").click(function() {
		window.location.href = $(this).find("a:visible").attr("href");
	});
	
	$(".slideshow").cycle({
		timeout: 1000,
		speed: 1000,
		slideExpr: "div img"
	});
	
	function formatTitle(title, currentArray, currentIndex, currentOpts) {
		if(currentArray[currentIndex].name) {
			return '<a href="' + currentArray[currentIndex].name + '">Download High Resolution</a><span>Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</span>';
		} else {
			return '<span>Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</span>';
		}	    
	}
	
	$(".photo-listing a, .shop-image").fancybox({
		autoScale: false,
		overlayColor: "#000000",
		overlayOpacity: "0.7",
		titleShow: true,
		titlePosition: "inside",
		titleFormat: formatTitle
	});
	
});