Cufon.replace("h1, h2", {fontFamily: "Yanone Kaffeesatz Light"});

var activeSlide;
function slide() {
	
	prevSlide = activeSlide;
	activeSlide.fadeOut(1000);
	activeSlide = activeSlide.parent().next().find("img");
	if(!activeSlide.size())
		activeSlide = prevSlide.parent().parent().find("> li:first > img");
	activeSlide.fadeIn(1000);
	
}

$(function() {
		   
	$("li").hover(function() {
	
		$(this).addClass("hover");
	
	}, function() {
	
		$(this).removeClass("hover");
	
	});
	
	$("a[rel*=fancybox]").fancybox({
		'zoomOpacity'			: true,
		'zoomSpeedIn'			: 500,
		'zoomSpeedOut'			: 500
	});

	activeSlide = $("#slideshow > li:first > img");
	$("#slideshow > li:not(li:first) > img").fadeOut(0).hide();
	
	setInterval(slide, 8000);
	
	if($.browser.msie && parseFloat($.browser.version) < 8)
		$(".visual").each(function() {
			$(this).width($("img", this).width());
		});
	
	$(window).resize(function() {
		
		if($(window).height() > $("#container").height())
			temp = $(window).height();
		else
			temp = $("#container").height();
		
		$("#content").height("auto");
		if(temp > $("#content").height() + 218)
			$("#content").height(temp - 218);
		
	});
		
	if($(window).height() > $("#container").height())
		temp = $(window).height();
	else
		temp = $("#container").height();
	
	$("#content").height("auto");
	if(temp > $("#content").height() + 218)
		$("#content").height(temp - 218);
	
});
