var comment_list = "";
var comment_page = 1;
/* Util function that gets called to trigger animated search results */
function animResult(count)
{
$("#comment_container_"+count).fadeIn(350)
}
function commentSubmit(form)
{
if (form.comment.value == "")
{
alert("Please enter your comment.");
return false;
}
else if (form.author.value == "")
{
alert("Please enter your name.");
return false;
}
else
{
form.submit;
}
}
function flagComment(id)
{
$("#report_abuse_form_"+id).submit();
}
$(document).ready(function(){
function updatePaginationStats()
{
num_pages = Math.floor(comment_list.length / comment_per_page) + 1;
if (comment_list.length / comment_per_page == Math.round(num_pages))
num_pages--;
$text = "Page "+comment_page+" of " + num_pages;
if (comment_list.length < comment_per_page)
{
$("#comment_prev_next_container").html("");
}
else
{
$("#comment_prev_next_container").css("display", "block");
$("#comment_pagination_nav_container").css("display", "block");
$("#comment_pagination").html($text);
}
}
function displaySearchResults()
{
$("#comment_list_container").html("");
// Iterate through array of results to build out a list
var num_videos = comment_list.length;
var this_url = window.location.href;
var search_results = '';
num_display_videos = Math.min(comment_per_page, (num_videos - comment_offset))
// Loop through the videos and display them
for (count = comment_offset; count < (num_display_videos + comment_offset); count++)
{
row = comment_list[count];
// Build the row
var video = "
';
$(video).appendTo("#comment_list_container")
$("#comment_container_"+count).css("display", "none");
setTimeout("animResult("+count+");" , (count-comment_offset)*100)
}
// Hide/Show the left right buttons depending on where you are in the list
if ((comment_offset+comment_per_page) >= comment_list.length)
$("#comment_right_btn").children().addClass("inactive")
else
$("#comment_right_btn").children().removeClass("inactive")
if (comment_offset <= 0)
$("#comment_left_btn").children().addClass("inactive")
else
$("#comment_left_btn").children().removeClass("inactive")
}
$("#comment_left_btn").click(function()
{
if (comment_offset > 0)
{
comment_offset = Math.max((comment_offset - comment_per_page + 1), 0);
displaySearchResults();
comment_page--;
updatePaginationStats();
}
});
$("#comment_right_btn").click(function()
{
if (comment_offset < comment_list.length - comment_per_page - 1)
{
comment_offset = Math.min((comment_offset + comment_per_page - 1), (comment_list.length));
displaySearchResults();
comment_page++;
updatePaginationStats();
}
});
displaySearchResults();
updatePaginationStats();
if (comment_list.length != 0)
$("#comment_list_header").css("display", "block");
});
;var comment_per_page = 20;var comment_offset = 0;var comment_flag_abusive_webservice_url = 'http://vms.mync.com/vms/comment/flag-abuse/';var video_page_url = 'http://wake.mync.com/site/wake/video/6204/India Fest -/';
comment_list = eval([{"com_id":"521","video_id":"6204","begin":"0","timestamp":"1238724708","hrs_ago":5618,"author":" ","comment":"Great video!!!"},{"com_id":"520","video_id":"6204","begin":"0","timestamp":"1238691628","hrs_ago":5627,"author":"Doug","comment":"What an awesome video! "}]);
document.write(' ');