﻿function votingMouseEvent(currentLink, direction,eventType)
{
/*
    if (direction == "up") {
        if (eventType == "over") {
            jQuery("div[id*=upVotes]").html(parseInt(jQuery("div[id*=upVotes]").html()) + 1);
        }
        else {
            jQuery("div[id*=upVotes]").html(parseInt(jQuery("div[id*=upVotes]").html()) -1);
        }
    }
    else {
        if (eventType == "over") {
            //jQuery("div[id*=downVotes]").html(parseInt(jQuery("div[id*=downVotes]").html()) + 1);
        }
        else {
            //jQuery("div[id*=downVotes]").html(parseInt(jQuery("div[id*=downVotes]").html()) - 1);
        }
    }
    */
}
function vote(direction) 
{
    var feedUrl = "/ajax/votingHandler.ashx";
    var ID = $("input[id*=hdnParentID]").val();
    var direction = direction;
    var mediaTypeID = jQuery("input[id*=hdnMediaTypeID]").val();
    
    var dataToSend = "vote=1&mediaTypeID="+mediaTypeID+"&parentID="+ID+"&direction="+direction;
    $.ajax({
        type: "POST",
        url: feedUrl,
        dataType: "json",
        data: dataToSend,
        success: function(msg) {
        jQuery("div[id*=upVotes]").html(msg.upVotes);
        jQuery("div[id*=downVotes]").html(msg.downVotes);
        }
    });
}
