﻿
    $(document).ready(function() {
        // Tabs
        $('.TabNavigation a').mouseover(function() {
            $(this.hash).siblings(".TabContainer").hide();
            $(this.hash).show();
            $(this).parent("li").siblings().removeClass("TabSelected");
            $(this).parent("li").addClass('TabSelected');
        }).filter(':first').mouseover();
    });
    
    function LoadCommentList(rid, page, size) {
        $.getJSON("/Ajax/LoadCommentList?rootID=" + rid + "&page=" + page + "&size=" + size + "&date=" + new Date(),
		            function(obj) {
		                $("#CommentList").processTemplate(obj);
		            });
    }

    function SubmitComment(rid) {
        
        $.post('/Ajax/CreateComment',
                   { rootID: rid, title: "", body: $('#txt_Comment').val() },
                   function(obj) {
                       alert(obj);
                       $('#txt_Comment').val("");
                   }
               );
    }

    function ThumbUpComment(sid, cid) {
        $.post('/Ajax/ThumbUpComment',
                   { siteID: sid, commentID: cid },
                   function(obj) {
                       alert(obj);
                   }
               );
    }

    function ThumbDownComment(sid, cid) {
        $.post('/Ajax/ThumbDownComment',
                   { siteID: sid, commentID: cid },
                   function(obj) {
                       alert(obj);
                   }
               );
    }