
var website = {
	
	init: function() {

		Cufon.replace('.navigation, h1', {
			 hover: true
			,fontFamily: 'Inspira'
		});

		Cufon.replace('.sketchfont', {
			 hover: true
			,fontFamily: 'Sketch Rockwell'
		});

		$('._blank').click(function() {
			window.open( $(this).attr('href') );
			return false;
		});
		
		$("a.lightbox").fancybox({
			 type: 'iframe'
			,width:900
			,height:500
		});
		
		website.init_newsfeatures();
		
	}
	
	,init_newsfeatures: function() {

		$('.newsfeatures .main-area').hover(function() {
			$(this).find('.tint-panel').slideDown('fast');
		}, function() {
			//$(this).find('.tint-panel').slideUp('fast');
		});

		$('.newsfeatures .left-choices a').hover(function() {
			$(this).blur();
			
			$('.newsfeatures .left-choices a.selected').removeClass('selected');
			$(this).addClass('selected');
			
			var src = '/assets/images/newsfeatures/' + $(this).attr('rel');
			$(this).parents('.newsfeatures').find('.main-area-image').attr('src', src);
			
			var index = $('.left-choices a').index(this);
			
			$('.tint-panel .panel').hide();
			$('.tint-panel .panel').eq(index).show();
			
			return false;
		});

		$('.newsfeatures .left-choices li:first a').trigger('mouseover');
		$('.newsfeatures .main-area:first').trigger('mouseover');
		
	}
	
};

$(document).ready(website.init);
