$(document).ready(function() {
	
	// INITIALIZE CUFON
	Cufon.set('fontFamily', 'DIN').replace('h1', {hover: true} );
	Cufon.set('fontFamily', 'DIN').replace('h2', {hover: true} );
	Cufon.set('fontFamily', 'DIN').replace('h3', {hover: true} );
	Cufon.set('fontFamily', 'DIN').replace('h4', {hover: true} );
	Cufon.set('fontFamily', 'DIN').replace('h5', {hover: true} );
	Cufon.set('fontFamily', 'DIN').replace('#nav a', {hover: true} );
	Cufon.set('fontFamily', 'DIN').replace('#billboard .text p.credits' );
	Cufon.set('fontFamily', 'DIN').replace('#billboard .text p.alert' );
	Cufon.set('fontFamily', 'DIN').replace('.grid-item li' );
	Cufon.set('fontFamily', 'Hand of Sean').replace('#press-quote p');
	Cufon.set('fontFamily', 'DIN').replace('#press-quote p.quote-credit');
	
	// INITIALIZE CAROUSEL
	$("#carousel").jCarouselLite({
		btnPrev: "a.carousel-prev",
	    btnNext: "a.carousel-next",
		// circular: false,
		speed: 350,
		visible: 8,
		scroll: 4
	});
	
	// CONTACT SLIDER
	$('#contact').hide();
	$('#nav-contact, .contact a.close').toggle(
          function() {
              $('#contact').slideToggle(350);
          },
          function() {
              $('#contact').slideToggle(350);
          }
      );

	// INITIALIZE ACCORDION CLASSES
	$('#sidebar .archive li:first').addClass('current');
	
	// CAROUSEL TITLE HOVER
	$("#carousel li").hover(function() {
		  $(this).find("img").animate({ opacity: 0.4 }, 300);
		  $(this).find(".title").animate({ opacity: 0.9 }, 300);
		}, function() {
		  $(this).find("img").animate({ opacity: 1 }, 300);
		  $(this).find(".title").animate({ opacity: 0 }, 300);
	});
	
	// HISTORY TITLE HOVER
	$(".history li").hover(function() {
		  $(this).find(".rollout").animate({ opacity: 0.4 }, 300);
		  $(this).find(".rollover").animate({ opacity: 0.9 }, 300);
		}, function() {
		  $(this).find(".rollout").animate({ opacity: 1 }, 300);
		  $(this).find(".rollover").animate({ opacity: 0 }, 300);
	});
	
	// ACCORDION FOR NEWS ARCHIVE
	$('#sidebar .archive').accordion();
	
	// GRID - LAST CLASS TO 3RD DIV
	$('#in-production-grid #main div:nth-child(3n)').addClass('last');
	$('#production-grid #main div:nth-child(3n)').addClass('last');
	
	// MAINBAR - LAST CLASS TO LAST ITEM
	$('#mainbar .item:last').addClass('lastbottom');
	
	// CYCLE SLIDESHOW
	$('#slideshow').cycle({ 
		    prev: 'a#gallery-prev', 
		    next: 'a#gallery-next',
			speed: 300,
		    timeout: 0 
		});
		
	// SIMPLE TOOLTIP
	$("a.nav-store").simpletooltip();

});

