/* MCF Plugins */

$(document).ready(function(){
   	
	Cufon.replace('#main .article h2', { 
		fontFamily: 'Nimbus Sans',
		color: '-linear-gradient(#999999, #000000)',
		textShadow: '0 -1px #333333' 
	});
	
	Cufon.replace('.article .meta', { 
		fontFamily: 'Metroscript',
		textShadow: '0 -1px #333333'
	});
	
	Cufon.replace('#main h2', { 
		fontFamily: 'Helvetica Neue',
		textShadow: '0 1px #FFFFFF' 
	});
	
	// Home Page Scroller
   	$('#slideshow').cycle({ 
		fx:     	'fade', 
		speed:   	1000, 
		timeout: 	5000,
		delay: 		-3000,
		pause: 		1,
		pager: 		'#nav-slide'
	}).cycle('pause');
	
	// Interior Page Scroller
   	$('#gallery').cycle({ 
		fx:     	'fade', 
		speed:   	1000, 
		timeout: 	4000,
		pause: 		1,
		pager: 		'#nav-slide'
	});

	// Search focus remove
	$('#search-site').focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = '';
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
	
	// Colorbox
	$('#gallery a, .cbox').colorbox({
		maxWidth: '85%', 
		maxHeight: '85%',
		opacity: 0.75
	});

	$('.video').colorbox({iframe:true, innerWidth:640, innerHeight:390});
	
	$('.details').hide();
	$('#cr_list a').click(function () {
		$('#cr_list a').removeClass('active'); // remove any 'active' class
		$(this).addClass('active'); // add active class to current link
		$('.details').hide(); // hide all details content
		
		var activeDetails = $(this).parent().find('.details'); //Find the href attribute value to identify the active bucket + content
		$(activeDetails).fadeIn('fast'); //Fade in the active ID content
		return false;	
	});
	

}); // end doc ready

