var feed_widget_data=eval([{"id":"1175515","title":"The Steve Wilkos Show Goes Green","description":"See how Steve Wilkos goes green!","link":{"0":"http:\/\/video.stevewilkos.com\/player\/?id=1175515&dst=rss|steve%20wilkos|"},"thumbnail":"http:\/\/video.nbcuni.com\/stevewilkos\/thumb\/ef252ca0032c7e85003bc47316611a67_large.jpg","pub_date":"2009-11-20 11:00:00","pub_ms":1258732800000},{"id":"1177563","title":"Lie Detector Meltdown","description":"Watch this recap from Nov. 20, 2009","link":{"0":"http:\/\/video.stevewilkos.com\/player\/?id=1177563&dst=rss|steve%20wilkos|"},"thumbnail":"http:\/\/video.nbcuni.com\/stevewilkos\/thumb\/0dd614f1032c7e8500c837cd5a8f9331_large.jpg","pub_date":"2009-11-20 11:00:00","pub_ms":1258732800000},{"id":"1177999","title":"Coming up on Monday","description":"I'm a Father ... Does Age Matter?","link":{"0":"http:\/\/video.stevewilkos.com\/player\/?id=1177999&dst=rss|steve%20wilkos|"},"thumbnail":"http:\/\/video.nbcuni.com\/stevewilkos\/thumb\/12c9cade032c7e8500c837cd0e217010_large.jpg","pub_date":"2009-11-20 09:00:00","pub_ms":1258725600000},{"id":"1178015","title":"Coming up on Tuesday","description":"Update: Did He Really Change?","link":{"0":"http:\/\/video.stevewilkos.com\/player\/?id=1178015&dst=rss|steve%20wilkos|"},"thumbnail":"http:\/\/video.nbcuni.com\/stevewilkos\/thumb\/12ca294a032c7e8500c837cd31524dc9_large.jpg","pub_date":"2009-11-20 08:00:00","pub_ms":1258722000000},{"id":"1176941","title":"Shattering Lie Detector Results","description":"Watch this recap from Nov. 19, 2009","link":{"0":"http:\/\/video.stevewilkos.com\/player\/?id=1176941&dst=rss|steve%20wilkos|"},"thumbnail":"http:\/\/video.nbcuni.com\/stevewilkos\/thumb\/083ad30d032c7e8500c837cda61a3d00_large.jpg","pub_date":"2009-11-19 10:00:00","pub_ms":1258642800000},{"id":"1176327","title":"Update: He Beat Me and My Baby","description":"An update on the guests from Sept. 17, 2009: He Beat Me and My Baby","link":{"0":"http:\/\/video.stevewilkos.com\/player\/?id=1176327&dst=rss|steve%20wilkos|"},"thumbnail":"http:\/\/video.nbcuni.com\/stevewilkos\/thumb\/ff842abf032c7e8500c837cd561c6bf4_large.jpg","pub_date":"2009-11-18 10:00:00","pub_ms":1258556400000}]); 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+'
    '; var b=''+this.feed_data[i].title.substr(0,37)+''; 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_video_player(); this.show_video_data(this.feed_data[0].id); } }; FeedWidget.prototype.id_in_data = function(id) { for(var i=0;i'); } };