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 = 3;var thumb_width = 130;var thumb_height = 97;var thumb_width_scaled = 80;var offset = 0;
video_list = eval([{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9077\/ROB CRISP WEB.flv","title":"Rob Crisp wraps up high school career","id":"9077","is_ugc":0,"rating":null,"creator":"Chris Cowperthwaite","duration":8300,"play_count":1,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9077\/ROB CRISP WEB_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9075\/1119mfhweb.flv","title":"Minute for Health: Rev Up Your Metabolism","id":"9075","is_ugc":0,"rating":null,"creator":"Julie Henry","duration":7900,"play_count":2,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9075\/1119mfhweb_0005_130x97.jpg"},{"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":null,"creator":"David Bertram","duration":12000,"play_count":73,"num_comments":"0","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\/9073\/1119womenshealthWEB.flv","title":"New Screening Guidelines Confusing To Women","id":"9073","is_ugc":0,"rating":null,"creator":"Julie Henry","duration":9300,"play_count":2,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9073\/1119womenshealthWEB_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9072\/091120_PKGDentalClinic.flv","title":"Mission of Mercy","id":"9072","is_ugc":0,"rating":null,"creator":"Jaclyn Asztalos","duration":8300,"play_count":16,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9072\/091120_PKGDentalClinic_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9070\/1120_HotDogVendorsWeb.flv","title":"Couple Uses Construction Layoffs To Build Careers","id":"9070","is_ugc":0,"rating":null,"creator":"Kendall Jones","duration":7800,"play_count":38,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9070\/1120_HotDogVendorsWeb_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9069\/frankie_valli.flv","title":"Frankie Valli & the Four Seasons","id":"9069","is_ugc":0,"rating":null,"creator":"Jason Clough","duration":4800,"play_count":12,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9069\/frankie_valli_0010_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9067\/Steve Miller Band.flv","title":"Steve Miller Band","id":"9067","is_ugc":0,"rating":null,"creator":"Jason Clough","duration":6300,"play_count":14,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9067\/Steve Miller Band_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9066\/SittiFoo SITTI FOOD-PKG _2.flv","title":"Sitti Food","id":"9066","is_ugc":0,"rating":null,"creator":"NBC17","duration":20800,"play_count":11,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9066\/SittiFoo SITTI FOOD-PKG _2_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9065\/SittiHis SITTI HISTORY-PKG _2.flv","title":"Sitti History","id":"9065","is_ugc":0,"rating":null,"creator":"NBC17","duration":31700,"play_count":52,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9065\/SittiHis SITTI HISTORY-PKG _2_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9064\/Bus Driver of year web pkg.flv","title":"Chapel Hill Bus Driver","id":"9064","is_ugc":0,"rating":null,"creator":"Stacy Peterson","duration":10300,"play_count":110,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9064\/Bus Driver of year web pkg_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9063\/091120_mature_professionals_durham_tech.flv","title":"Mature Professionals Network","id":"9063","is_ugc":0,"rating":null,"creator":"Josh Green","duration":3000,"play_count":84,"num_comments":"2","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9063\/091120_mature_professionals_durham_tech_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9062\/091119_davis_presser.flv","title":"Nov. 19 Shaniya Davis Presser","id":"9062","is_ugc":0,"rating":null,"creator":"NBC17","duration":15200,"play_count":189,"num_comments":"2","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9062\/091119_davis_presser_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9060\/garnerreviPAC.flv","title":"Garner Considers Downtown Revitalization","id":"9060","is_ugc":0,"rating":null,"creator":"Marilyn Peguero","duration":8700,"play_count":51,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9060\/garnerreviPAC_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9059\/1119wakeschoolcutsWEB.flv","title":"Wake Schools Face More Cuts; Teachers Spared This Time","id":"9059","is_ugc":0,"rating":null,"creator":"Julie Henry","duration":8400,"play_count":12,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9059\/1119wakeschoolcutsWEB_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9058\/1119 INMATES LATEST PKG.flv","title":"Inmates Release On Hold","id":"9058","is_ugc":0,"rating":null,"creator":"David Bertram","duration":8400,"play_count":23,"num_comments":"4","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9058\/1119 INMATES LATEST PKG_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9057\/091119_PKGBellringers.flv","title":"Salvation Army","id":"9057","is_ugc":0,"rating":null,"creator":"Jaclyn Asztalos","duration":8300,"play_count":21,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9057\/091119_PKGBellringers_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9056\/091118_pintsized_football.flv","title":"Pintsized Sports -- Football -- 11\/18","id":"9056","is_ugc":0,"rating":"3","creator":"NBC17","duration":3000,"play_count":64,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9056\/091118_pintsized_football_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9054\/Meteor11_19_256K.flv","title":"Raw Meteor Video","id":"9054","is_ugc":0,"rating":null,"creator":"Jennifer Wig","duration":3100,"play_count":28,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9054\/Meteor11_19_256K_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9053\/Meteor090011_19_256K.flv","title":"Meteor Shower Lights Up Sky","id":"9053","is_ugc":0,"rating":null,"creator":"Jennifer Wig","duration":2100,"play_count":23,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/9053\/Meteor090011_19_256K_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/';