jQuery(function(){


	$('a.media').media({
		preferMeta:    1,         				// true if markup metadata takes precedence over options object 
		autoplay:      0,       				// normalized cross-player setting 
		 bgColor:       '#ffffff', // background color 
		params:        { autoplay:'0', rel:'0', id:'ytapiplayer' },		// added to object element as param elements; added to embed element as attrs      	
		attrs:         { autoplay:'0', rel:'0', id:'ytapiplayer' },		// added to object and embed elements as attrs        			
		flashvars:     { autoplay:'0', rel:'0', id:'ytapiplayer' },    // added to flash content as flashvars param/attr 
		flashVersion:  '7'       				// required flash version 
	});
	

	
	// Clearing method for 3 column states
	//$('#youtube li:nth-child(5n)').addClass('last');
	
	// Thumbnails Navigation
	//$('#youtube li.thumbs:first a').addClass('active').addClass('visited');
	
	$('.thumbs a').live('click',function(){
		//$('#youtube li.thumbs a').removeClass('active');
		//$(this).addClass('active').addClass('visited');
		var $href = $(this).attr('href');
		$('#featured').empty().append('<a class="media {width:320, height:300, bgColor:\'#ffffff\', type:\'swf\'}" href="'+$href+'"></a>');
		$('a.media').media({
			params:        { autoplay:'1', rel:'0' },		// added to object element as param elements; added to embed element as attrs      	
			attrs:         { autoplay:'1', rel:'0' },		// added to object and embed elements as attrs        			
			flashvars:     { autoplay:'1', rel:'0' }
		});
		return false;
	});
	
});
