var video_list = "";
var video_page = 1;
/* Util function that gets called to trigger animated search results */
function animVideoBrowseResult(count)
{
$("#video_container_"+count).fadeIn(350)
}
$(document).ready(function(){
function updateVideoBrowsePaginationStats()
{
num_pages = Math.round(video_list.length / video_per_page) + 1;
if (video_list.length / video_per_page == Math.round(num_pages))
num_pages--;
$text = "Page "+video_page+" of " + num_pages;
$("#vid_pagination").html($text);
}
function displayVideoBrowseSearchResults()
{
$("#video_list_container").html("");
// Iterate through array of results to build out a list
var num_videos = video_list.length;
var search_results = '';
num_display_videos = Math.min(video_per_page, (num_videos - offset))
// Loop through the videos and display them
for (count = offset; count < (num_display_videos + offset); count++)
{
row = video_list[count];
title= row['title'];
title = title.replace(/[^a-z0-9]/ig, "_");
video_url = video_page_base_url + row['id'] + "/" + title + "/";
create_timestamp = new Date(row['create_timestamp'] * 1000);
video_url_js = 'onClick="window.location = \''+video_url+'\'"; return false;';
// Build the row
var video = "
';
$(video).appendTo("#video_list_container")
$("#video_container_"+count).css("display", "none");
setTimeout("animVideoBrowseResult("+count+");" , (count-offset)*100)
}
// Hide/Show the left right buttons depending on where you are in the list
if ((offset+video_per_page) >= video_list.length)
$("#video_right_btn").children().addClass("inactive")
else
$("#video_right_btn").children().removeClass("inactive")
if (offset <= 0)
$("#video_left_btn").children().addClass("inactive")
else
$("#video_left_btn").children().removeClass("inactive")
}
$("#video_left_btn").click(function()
{
if (offset > 0)
{
offset = Math.max((offset - video_per_page + 1), 0);
displayVideoBrowseSearchResults();
video_page--;
updateVideoBrowsePaginationStats();
}
});
$("#video_right_btn").click(function()
{
if (offset < video_list.length - video_per_page - 1)
{
offset = Math.min((offset + video_per_page - 1), (video_list.length));
displayVideoBrowseSearchResults();
video_page++;
updateVideoBrowsePaginationStats();
}
});
displayVideoBrowseSearchResults();
updateVideoBrowsePaginationStats();
});
var video_page_base_url = 'http://news.mync.com/site/news/video/'; var video_per_page = 5;var thumb_width = 130;var thumb_height = 97;var thumb_width_scaled = 50;var offset = 0;
video_list = eval([{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9074\/1120 MCNEILL.flv","title":"Mario McNeill In Court","id":"9074","is_ugc":0,"rating":"3","creator":"David Bertram","duration":12000,"play_count":347,"num_comments":7,"image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9074\/1120 MCNEILL_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9039\/1118 SEANC HEALTH FAIR PKG.flv","title":"SEANC Health Fair","id":"9039","is_ugc":0,"rating":0,"creator":"David Bertram","duration":11500,"play_count":138,"num_comments":0,"image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9039\/1118 SEANC HEALTH FAIR PKG_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/5023\/2009ReflectionsMontage.flv","title":"NBC 17 \"WOW\"-ed by Youth Artwork","id":"5023","is_ugc":1,"rating":null,"creator":"Jess Coscia","duration":6200,"play_count":49,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/5023\/2009ReflectionsMontage_0000_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/4842\/JobShadowDay2009.flv","title":"NBC 17 Employees See Their Shadows on Ground Hog Day","id":"4842","is_ugc":1,"rating":null,"creator":"Jess Coscia","duration":3200,"play_count":61,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/4842\/JobShadowDay2009_0005_130x97.jpg"}]);
document.write(' ');
var playlist_url = 'http://vms.mync.com/vms/playlist/combine-playlist-with-search/format/json/ad_tag_base_64//combine_with_search/y/';
var video_page_url = 'http://mync.com/site/nbc17/video/';