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\/8905\/CHAIN GANG WEB.flv","title":"Chain Gangs","id":"8905","is_ugc":0,"rating":null,"creator":"Chris Cowperthwaite","duration":9200,"play_count":2,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8905\/CHAIN GANG WEB_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8904\/1106 CANES LEAFS POST.flv","title":"Canes Leafs Post Game...Boychuk, Sutter, Coach Maurice","id":"8904","is_ugc":0,"rating":null,"creator":"David Bertram","duration":12900,"play_count":2,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8904\/1106 CANES LEAFS POST_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8903\/stevemuslimreax.flv","title":"Muslim Reaction","id":"8903","is_ugc":0,"rating":null,"creator":"Daniel West","duration":8700,"play_count":19,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8903\/stevemuslimreax_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8902\/1106lungcancersurvivor.flv","title":"Cancer Advances Mean More Hope For Patients","id":"8902","is_ugc":0,"rating":null,"creator":"Julie Henry","duration":10100,"play_count":18,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8902\/1106lungcancersurvivor_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8901\/1106 FUNERAL.flv","title":"Maxwell Family Funeral","id":"8901","is_ugc":0,"rating":"5","creator":"David Bertram","duration":11000,"play_count":68,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8901\/1106 FUNERAL_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8900\/EnStarPkg.flv","title":"No Sales Tax On Energy Savers","id":"8900","is_ugc":0,"rating":null,"creator":"Kerry Hall","duration":7600,"play_count":20,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8900\/EnStarPkg_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8898\/1106_MinorityWeb.flv","title":"Conference Aims To Increase Minority Graduation Rates","id":"8898","is_ugc":0,"rating":null,"creator":"Kendall Jones","duration":7000,"play_count":9,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8898\/1106_MinorityWeb_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8897\/091027_sotApexShow.flv","title":"Rusty Bucket TV Show","id":"8897","is_ugc":0,"rating":null,"creator":"Jaclyn Asztalos","duration":4700,"play_count":17,"num_comments":"2","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8897\/091027_sotApexShow_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8896\/091106_PKGOliveChapelPark.flv","title":"Olive Chapel Park","id":"8896","is_ugc":0,"rating":null,"creator":"Jaclyn Asztalos","duration":9800,"play_count":43,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8896\/091106_PKGOliveChapelPark_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8895\/Fosterin FOSTERING BRIGHT FUTURES-PKG _2.flv","title":"Fostering Bright Futures","id":"8895","is_ugc":0,"rating":null,"creator":"NBC17","duration":27800,"play_count":47,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8895\/Fosterin FOSTERING BRIGHT FUTURES-PKG _2_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8894\/Big Boss Web Pkg.flv","title":"Business Flowing At Big Boss Brewery.","id":"8894","is_ugc":0,"rating":null,"creator":"Charles Malloy","duration":17300,"play_count":18,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8894\/Big Boss Web Pkg_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8893\/Fort Bragg Reax.flv","title":"Fort Bragg Reaction To Fort Hood Shooting","id":"8893","is_ugc":0,"rating":null,"creator":"Shawn Replogle","duration":8200,"play_count":16,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8893\/Fort Bragg Reax_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8892\/H1N1attendancePAC.flv","title":"Superintendent Says Students Will Not Fail Because They're Sick","id":"8892","is_ugc":0,"rating":null,"creator":"Marilyn Peguero","duration":8200,"play_count":26,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8892\/H1N1attendancePAC_0010_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8891\/091105_east_durham_revitilization.flv","title":"Saving East Durham - NBC 17 @ 11","id":"8891","is_ugc":0,"rating":null,"creator":"Josh Green","duration":15200,"play_count":19,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8891\/091105_east_durham_revitilization_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8890\/epic games web.flv","title":"Epic Games Giving Away \"Unreal Development Kit\"","id":"8890","is_ugc":0,"rating":"3","creator":"Chris Cowperthwaite","duration":9400,"play_count":178,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8890\/epic games web_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8889\/091105_PKGwithtagDaycare.flv","title":"Daycare Closes","id":"8889","is_ugc":0,"rating":null,"creator":"Jaclyn Asztalos","duration":10100,"play_count":73,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8889\/091105_PKGwithtagDaycare_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8888\/1105 UNEMPLOYMENT PKG.flv","title":"Unemployment Benefits Extension","id":"8888","is_ugc":0,"rating":null,"creator":"David Bertram","duration":9900,"play_count":84,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8888\/1105 UNEMPLOYMENT PKG_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8887\/1105_BBBScam.flv","title":"Work-At-Home Scams Sting Consumers","id":"8887","is_ugc":0,"rating":null,"creator":"Kendall Jones","duration":7500,"play_count":44,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8887\/1105_BBBScam_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8886\/PKGcnnheroaward.flv","title":"Former Raleigh Bartender A Top Ten Finalist For CNN \"Heroes\" Award","id":"8886","is_ugc":0,"rating":null,"creator":"Lauren Hills","duration":8500,"play_count":61,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8886\/PKGcnnheroaward_0005_130x97.jpg"},{"location":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8885\/Healthcare050011_05_256K.flv","title":"Both Sides of Healthcare Reform Want Voice Heard","id":"8885","is_ugc":0,"rating":null,"creator":"NBC Network","duration":7700,"play_count":4,"num_comments":"0","image_130_97":"http:\/\/wds.mp.advection.net\/mp\/wncn\/_dld\/vms\/8885\/Healthcare050011_05_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/';