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 += '
    '; if (row['author'] != "") video += row['author'] ; video += "
    " if (row['hrs_ago'] < 25) video += '
    ' + Math.round(row['hrs_ago']) + ' hrs ago
    '; else video += '
    ' + Math.round(row['hrs_ago']/24) + " days ago
    "; video += "Report Abuse "; video += '
    '; video += '
    ' + row['comment'] + "
    "; 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://johnston.mync.com/site/johnston/video/4021/Johnston_County_Homeschoolers/'; comment_list = eval([{"com_id":"269","video_id":"4021","begin":"0","timestamp":"1231086693","hrs_ago":7740,"author":"Cathy Royal","comment":"Great job everyone and Happy New Year! I'm glad to see you all using your talents."},{"com_id":"267","video_id":"4021","begin":"0","timestamp":"1230597832","hrs_ago":7876,"author":"Angela Lafferty","comment":"You guys did great..... That was beautiful..."},{"com_id":"266","video_id":"4021","begin":"0","timestamp":"1230523822","hrs_ago":7896,"author":"Sharon Bishop","comment":"I always enjoy hearing the Ivan boys sing. Great job boys!"},{"com_id":"264","video_id":"4021","begin":"0","timestamp":"1230294635","hrs_ago":7960,"author":"Janet Purk","comment":"So enjoyed hearing and seeing the Singing Ivans. You always bless my heart. "},{"com_id":"263","video_id":"4021","begin":"0","timestamp":"1230267589","hrs_ago":7968,"author":"Kelly Williams","comment":"Great job Ivan boys! Good job everyone :)\r\n"},{"com_id":"261","video_id":"4021","begin":"0","timestamp":"1230213102","hrs_ago":7983,"author":"Julie Stewart","comment":"Awesome job guys! Merry Christmas!"}]); document.write('

    Comments

    Post A Comment

    ');