/* ----------------------------------------------------------
	title		  : Stoops Video Wall
	created		  : 1/29/10
	last updated  : 3/1/10
	
	In a separate file because this code has to appear at the top of the page, before the embed code. Also easier to manage separately.
---------------------------------------------------------- */
var baseFeed = 'http://pipes.yahooapis.com/pipes/pipe.run?_id=094e434224dc35d25fb51a5bf68a4c60&_render=rss';
var motivationalFeed = 'http://vimeo.com/channels/oumotivational/videos/rss';
var introFeed = 'http://vimeo.com/channels/ougamedayintros/videos/rss';
var positionHighlightsFeed = 'http://vimeo.com/channels/oupositionhighlights/videos/rss';
var seasonHighlightsFeed = 'http://vimeo.com/channels/ouseasonhighlights/videos/rss'; 
var classicsFeed = 'http://vimeo.com/channels/ouclassics/videos/rss';
var allFeed = 'http://vimeo.com/channels/ouall/videos/rss';
var feed = '';
    
jQuery.noConflict();     
jQuery(document).ready(function($){


var adminView = $('#adminbar #toolbar').length;

   $('#content-feature').prepend('<ul id="video-nav">' + 
   '<li><a id="all" href="#">All Videos</a></li>' +
   '<li><a id="mot" href="#">Motivational</a></li>' +
   '<li><a id="int" href="#">Gameday Intros</a></li>' +
   '<li><a id="pos" href="#">Position Highlights</a></li>' +
   '<li><a id="sea" href="#">Season Highlights</a></li>' +
   '<li><a id="cla" href="#">Classics</a></li>' +
   '</ul>');
	
	$('#all').addClass('activeVideoSection');	
	
	$('#video-nav a').click(function(){
	
	$('#video-nav a').removeClass('activeVideoSection').filter(this).addClass('activeVideoSection');
	
	switch( $(this).attr('id') ) {
	case 'all':
	  feed = allFeed;
	  break;
	case 'mot':
	  feed = motivationalFeed;
	  break;
	case 'int':
	  feed = introFeed;
	  break;
	case 'pos':
	  feed = positionHighlightsFeed;
	  break;
	case 'sea':
	  feed = seasonHighlightsFeed;
	  break;
	case 'cla':
	  feed = classicsFeed;
	  break;
	default:
	  cooliris.embed.setFeedURL(baseFeed+'&killcache='+Math.random());
	  return false;
	}
	
	cooliris.embed.setFeedURL(baseFeed+'&feed='+feed+'&killcache='+Math.random());
	return false;
	})



	
//the embed.js from cooliris is failing to embed the vimeo player in the wall, so until its fixed we are recommending that users try a better browser.
if (adminView) {

$("#browser-wars").show().prepend('<h1>This section below is for the lightbox that pops up for Internet Explorer users</h1><p>It lets them know they are missing out on some functionality and should get a better browser.</p>');

} else {
	
	if ($.browser.name == 'msie' && $.browser.versionX <= 8) {
	
		if ( $('#browser-wars .element').length <= 0) { 
		//nothing
		} else {	
		
		//show lightbox
		$.fn.colorbox({width:'600px',height:'350px', opacity:0.4, inline:true, href:"#browser-wars",
		onClosed:function(){ 
		$("#browser-wars").hide();
		}});
		$("#browser-wars").show();
	
		}//if empty
	
	//alert($.browser.name +' '+ $.browser.versionX);
	}
	
}//if admin
		


});//end doc ready