$(function(){
	$('.feature .slideshow').cycle({
		fx:       'fade',
		timeout:   8000,
		pager:  '.feature .feature_nav',
		pauseOnPagerHover: true,
		pagerAnchorBuilder: function(idx, slide) { 
			// return selector string for existing anchor 
			return '.feature .feature_nav li:eq(' + idx + ') a';
		},
		before:     function() {
			$(this).css('background-image', 'url(' + $(this).children('img').attr('src') + ')');
		}
	});
	
	$('<div class="video_container"><div id="cubist_video"></div><div id="phrma_video"></div></div>').insertAfter('#torso');	
	
	$('a[href="#cubist_video_modal"]').colorbox({ 
		inline:true,
		href: "#cubist_video",
		scrolling: false, 
		innerWidth: 512, 
		innerHeight: 288,
		onLoad: function(){jwplayer("cubist_video").setup({ 
			flashplayer: "/sup/js/lib/jwplayer/player.swf", 
			file: "/sup/video/anthem_video.flv",
			autostart: true, 
			width: 512,
			height: 288,
			stretching: "exactfit",
			plugins: {"gapro-2": {}}
		});},
		onClosed: function(){jwplayer('cubist_video').remove();}
	});

	$('a[href="#phrma_video_modal"]').colorbox({ 
		inline:true, 
		href: "#phrma_video",
		scrolling: false, 
		innerWidth: 512, 
		innerHeight: 288,
		onLoad: function(){jwplayer("phrma_video").setup({ 
			flashplayer: "/sup/js/lib/jwplayer/player.swf", 
			file: "/sup/video/phrma_interview.flv",
			autostart: true, 
			width: 512,
			height: 288, 
			
			plugins: {"gapro-2": {}}
		});},
		onClosed: function(){jwplayer('phrma_video').remove();}
	});	
	
});


