var feed_widget_data=eval([{"id":"1206868","title":"Coming up on Friday","description":"The Devastating Results","link":{"0":"http:\/\/video.stevewilkos.com\/player\/?id=1206868&dst=rss|steve%20wilkos|"},"thumbnail":"http:\/\/video.nbcuni.com\/stevewilkos\/thumb\/2f8435cb032c7e8500c837cdc6c793e3_large.jpg","pub_date":"2010-03-11 07:00:00","pub_ms":1268308800000},{"id":"1205892","title":"I Know You Murdered My Son","description":"Watch this recap from March 3, 2010","link":{"0":"http:\/\/video.stevewilkos.com\/player\/?id=1205892&dst=rss|steve%20wilkos|"},"thumbnail":"http:\/\/video.nbcuni.com\/stevewilkos\/thumb\/20bd1f50032c7e8500c837cd88762af3_large.jpg","pub_date":"2010-03-03 09:00:00","pub_ms":1267624800000},{"id":"1205539","title":"Steve Got it Wrong?","description":"Watch this recap from March 2, 2010","link":{"0":"http:\/\/video.stevewilkos.com\/player\/?id=1205539&dst=rss|steve%20wilkos|"},"thumbnail":"http:\/\/video.nbcuni.com\/stevewilkos\/thumb\/1a9efad3032c7e8500c837cd734e01c6_large.jpg","pub_date":"2010-03-02 09:00:00","pub_ms":1267538400000},{"id":"1204145","title":"3 Teens Pregnany By 1 Man","description":"Watch this recap from Feb. 26, 2010","link":{"0":"http:\/\/video.stevewilkos.com\/player\/?id=1204145&dst=rss|steve%20wilkos|"},"thumbnail":"http:\/\/video.nbcuni.com\/stevewilkos\/thumb\/fcab9714032c7e8500c798090e616429_large.jpg","pub_date":"2010-02-26 11:00:00","pub_ms":1267200000000},{"id":"1204122","title":"It's Been 8 Years, Tell the Truth!","description":"Watch this recap from Feb. 25, 2010","link":{"0":"http:\/\/video.stevewilkos.com\/player\/?id=1204122&dst=rss|steve%20wilkos|"},"thumbnail":"http:\/\/video.nbcuni.com\/stevewilkos\/thumb\/fc842543032c7e8500c79809eed71858_large.jpg","pub_date":"2010-02-25 09:00:00","pub_ms":1267106400000},{"id":"1203395","title":"16 Year Old Prostitute Runaway","description":"Watch this recap from Feb. 24, 2010","link":{"0":"http:\/\/video.stevewilkos.com\/player\/?id=1203395&dst=rss|steve%20wilkos|"},"thumbnail":"http:\/\/video.nbcuni.com\/stevewilkos\/thumb\/e7d8071c032c7e8500c837cd3aedf245_large.jpg","pub_date":"2010-02-24 11:00:00","pub_ms":1267027200000}]); function FeedWidget() { this.div_id='feed_widget'; this.feed_data=null; this.video_script_base='http://video.nbcuni.com/framework/'; this.video_script_name='FrameworkManager.js?include=EmbeddedPlayerManager'; this.video_width=330; this.video_height=300; this.widget_type='accordion'; this.timeouts=null; this.at_video_index=0; this.start_id=null; this.config_id=10000; var args=[]; if(typeof(arguments[0])=='object') { args=arguments[0]; } if(window.feed_widget_params) { args=window.feed_widget_params; } if(typeof(args)=='object') { for(var j in args) { var value=args[j]; switch(j) { case 'data': this.feed_data=value; break; case 'type': this.widget_type=value; break; case 'width': case 'height': var p=parseInt(value); if(p>0) { if(j=='width'){this.video_width=p;} else{this.video_height=p;} } break; case 'script': this.video_script=value; break; case 'script_name': this.video_script_name=value; break; case 'div_id': this.div_id=value; break; case 'start_id': this.start_id=parseInt(value); break; case 'config_id': this.config_id=value; break; } } } if(window.feed_widget_data && this.feed_data===null) { this.feed_data=window.feed_widget_data; } this.at_video_index=this.id_in_data(this.start_id); if(this.at_video_index===false) { this.start_id=this.feed_data[0].id; this.at_video_index=0; } this.add_video_script(); var self=this; $(document).ready(function(){ self.build_widget(); self.bind_links(); }); } FeedWidget.prototype.get_current_video_id = function() { var at=arguments[0]?arguments[0]:this.at_video_index; if(this.feed_data.length>at) { return this.feed_data[at].id; } else { return ''; } }; FeedWidget.prototype.bind_links = function() { var self=this; if(this.widget_type=='accordion') { $('#'+this.div_id+' ul li a.widget_button').unbind(); $('#'+this.div_id+' ul li a.watch_video_button').unbind(); $('#'+this.div_id+' ul li a.watch_video_button').bind('click',function(e){self.play_video(e);}); $('#'+this.div_id+' ul li a.widget_button').bind('click',function(e){self.show_video_data(e);}); } else if(this.widget_type=='fullpage') { $('#'+this.div_id+' ul.image_items_list li a').unbind(); $('#'+this.div_id+' #go_left').unbind(); $('#'+this.div_id+' #go_right').unbind(); $('#'+this.div_id+' ul.image_items_list li a').bind('click',function(e){self.play_video(e);}); $('#'+this.div_id+' #go_left').bind('click',function(e){self.move_list('left',1);}); $('#'+this.div_id+' #go_right').bind('click',function(e){self.move_list('right',1);}); } }; FeedWidget.prototype.move_list = function(direction,amount) { $('#'+this.div_id+' #go_left').removeClass('disabled'); $('#'+this.div_id+' #go_right').removeClass('disabled'); var width=parseInt($('#'+this.div_id+' ul.image_items_list li').width())+parseInt($('#'+this.div_id+' ul.image_items_list li').css('margin-left'))+parseInt($('#'+this.div_id+' ul.image_items_list li').css('margin-right')); var moved=width*amount; var pos=parseInt($('#'+this.div_id+' ul.image_items_list').css('left')); var container_width=parseInt($('#'+this.div_id+' div#image_list').width()); var num=this.feed_data.length; var max_pos=(num*width)-container_width; var newpos=0; if(direction=='left') { newpos=pos-moved; } else { newpos=pos+moved; } if(newpos<-max_pos) { newpos=-(max_pos); //disable left $('#'+this.div_id+' #go_left').addClass('disabled'); } if(newpos>=0) { newpos=0; $('#'+this.div_id+' #go_right').addClass('disabled'); } $('#'+this.div_id+' ul.image_items_list').animate({'left':newpos}); }; FeedWidget.prototype._get_event_id = function(e) { var id=''; if(typeof(e)=='object') { if($.browser.msie) { id=e.target.id; } else { id=e.currentTarget.id; } } else { id=e; } return id; }; FeedWidget.prototype.show_video_data = function(e) { var id=this._get_event_id(e).replace(/\D/g,''); this.bind_links(); $('#show_'+id).unbind(); $('#'+this.div_id+' dd').slideUp(); var self=this; $('#desc_'+id).slideDown(function(){ $('#'+self.div_id+' a.widget_button').removeClass('selected'); $('#show_'+id).addClass('selected'); }); }; FeedWidget.prototype.play_video = function(e) { var link_id=''; var video_id=''; link_id=this._get_event_id(e); video_id=link_id.replace(/\D/g,''); embeddedPlayerManager.getPlayer().playVideo(video_id); this.at_video_index=this.id_in_data(video_id); if($('#video_description').length > 0) { $('#video_description').html(this.feed_data[this.at_video_index].description); } if($('#video_date').length > 0) { $('#video_date').html(this.format_date(this.feed_data[this.at_video_index].pub_ms)); } if($('#video_title').length > 0) { $('#video_title').html(this.feed_data[this.at_video_index].title); } }; FeedWidget.prototype.format_date = function(ms) { var d=new Date(); d.setTime(ms); var h=d.getHours(); var ampm='AM'; if(h===0) { h=12; } else if(h>12) { h-=12; ampm='PM'; } return d.getMonth()+'/'+d.getDay()+'/'+d.getFullYear()+' '+h+':'+d.getMinutes()+' '+ampm; }; FeedWidget.prototype.set_width_height = function() { if(arguments.length==2) { this.video_width=arguments[0]; this.video_height=arguments[1]; } else if(arguments.length==1) { this.video_width=parseInt(arguments[0].replace(/^.*w:(\d+).*$/,'$1')); this.video_height=parseInt(arguments[0].replace(/^.*h:(\d+).*$/,'$1')); } }; FeedWidget.prototype.build_widget = function() { switch(this.widget_type) { case 'accordion': this.build_accordion_widget(); break; case 'fullpage': this.build_fullpage_widget(); break; } }; FeedWidget.prototype.build_fullpage_widget = function() { $('#'+this.div_id).html('
<>
'); if(this.feed_data.length) { var list=''; $('#video_description').html(this.feed_data[this.at_video_index].description); $('#video_title').html(this.feed_data[this.at_video_index].title); $('#video_date').html(this.format_date(this.feed_data[this.at_video_index].pub_ms)); for(var i=0;i'; var thumb_link=''+thumb+''; list+='
  • '+thumb_link+'
  • '+"\n"; } $('#'+this.div_id+' ul').html(list); if($.browser.msie) { $('#'+this.div_id+' ul a').attr('href','javascript:;'); $('#'+this.div_id+' #go_left').attr('href','javascript:;'); $('#'+this.div_id+' #go_right').attr('href','javascript:;'); } this.initialize_video_player(); this.move_list('left',(this.at_video_index)); var vid='videos'; if(this.feed_data.length==1){vid='video';} $($('#'+this.div_id+' #video_count')).html((this.feed_data.length)+' '+vid); } }; FeedWidget.prototype.build_accordion_widget = function() { $('#'+this.div_id).html('
    '); if(this.feed_data.length) { var list=''; for(var i=0;iWatch Video'; var thumb=''; var desc='
    '+this.feed_data[i].description+'
    '; if(title_length < 34) var b=''+this.feed_data[i].title+''; else var b=''+this.feed_data[i].title.substr(0,33)+'...'; var dd='
    '+thumb+wv+'
    '+desc; list+='
  • '+b+'
    '+dd+'
  • '+"\n"; } $('#'+this.div_id+' ul').html(list); if($.browser.msie) { $('#'+this.div_id+' ul a').attr('href','#'); } this.initialize_accordion_video_player(); this.show_video_data(this.feed_data[0].id); } }; FeedWidget.prototype.id_in_data = function(id) { for(var i=0;i'); } };