Cufon.replace('#nav a, #subnav a, #subnav span, #subnav div, #contactinfo span', {fontFamily: 'Bauer Bodoni', hover: true, hoverables: { a:true }});
Cufon.replace('body.home .overlay-title', {fontFamily: 'Bodoni Poster Italic', hover: true, hoverables: { a:true }});
Cufon.replace('#info-column .title, #info-column .year, body.inproduction .title, body.inproduction .title, #indevelopment #label', {fontFamily: 'Bauer Bodoni'});

jQuery(document).ready(function(){ 
	
	/* SLIDER ----------------------------------------- */
	
	/* handle when a slider item is clicked */
	$("body.home #slider .slider-item").click(
		function () {
			$("body.home #slider .slider-item").animate({width: "85px"}, { queue:false, duration:400 });
			$("body.home #slider .slider-item").removeClass("current");
			$("body.home #slider .slider-item .overlay-title").fadeOut(75);
			$("body.home #slider .slider-item .overlay-title").hide();
			
			$(this).addClass("current");
			$(this).animate({width: "370px"}, { queue:false, duration:400 });
			$(this).children('.overlay-title').delay(300).fadeIn(300);
			$(this).children('.overlay-link').show();
		}
	);
	
	/* handle when a slider item is hovered over */
	$("body.home #slider .slider-item").hover(
		function () {
			if ($(this).hasClass('current')==false) {
				$(this).animate({width: "105px"}, { queue:false, duration:400 });
			}
		},
		function () {
			if ($(this).hasClass('current')==false) {
				$(this).animate({width: "85px"}, { queue:false, duration:400 });
			}
		}
	);
	
	/* fade in the title when the CURRENT slider item is hovered over */
	$("body.home #slider .slider-item").hover(
		function () {
			if ($(this).hasClass('current')) {$(this).children('.overlay-title').fadeIn(300);}
		},
		function () {
			$(this).children('.overlay-title').fadeOut(300);
		}
	);
	
	/* fade in subnav if productions subpage */
	if ($('body').hasClass('productions-single')) {
		$("#subnav").fadeIn(1000);
	};
	
	
	
	/* MOUSEOVER THUMBNAILS ON MAIN 'PRODUCTION' PAGE ----------------------------------------- */
	$("body.productions-main .thumbnail .thumb-pic").hover(
		function () {
			$(this).parent('.thumbnail').addClass("hover");
		},
		function () {
			$(this).parent('.thumbnail').removeClass("hover");
		}
	);
	
	
	
	/* SWITCH VIDEOS ON 'PRODUCTIONS' SUBPAGES ----------------------------------------- */
	if ($('body').hasClass('productions-single')) {
	
		/* set border for long text columns */
		/*if ($("#info-column").height() > 382) {
			$("#info-column").css('background','url(/inc/img/vertical-divider.png) top right no-repeat');
		};*/
	
		/* toggle video 1 */
		$("body.productions-single #toggleVideo1").click(
			function () {
				$("body.productions-single .toggleLink").removeClass("current");
				$("body.productions-single #toggleVideo1").addClass("current");
				
				$("body.productions-single #video-container").animate({left: "0px"}, {duration:400});
			}
		);
		
		/* toggle video 2 */
		$("body.productions-single #toggleVideo2").click(
			function () {
				$("body.productions-single .toggleLink").removeClass("current");
				$("body.productions-single #toggleVideo2").addClass("current");
				
				$("body.productions-single #video-container").animate({left: "-750px"}, {duration:400});
			}
		);
	}
});
