function ShowComments(c_id) {
	
	if (document.getElementById(c_id).style.display == "none") {
		document.getElementById(c_id).style.display = "block";
	} else {
		if (document.getElementById(c_id).style.display == "block") {
			document.getElementById(c_id).style.display = "none";
		}	
	}
}

function setVisibility(id) {
	document.getElementById(id).style.display = 'none';
}

function UpVote( id )
{
    $("span#vote_button_up"+id).html("<a href='javascript:void(0)' class='vote_up_act' OnClick='InvalidVote("+id+");'>+</a>");
    $("span#vote_button_down"+id).html("<a href='javascript:void(0)' class='vote_down' id='"+id+"' OnClick='DownVote("+id+");'>&ndash;</a>");	
    $.ajax({
		type: "POST",
		data: "action=vote_up&id="+id,
		url: "vote_pic.php",
        success: function(msg)
        {
        	$("span#votes_count"+id).html(msg);

        }
    });
}
function DownVote( id )
{
    $("span#vote_button_down"+id).html("<a href='javascript:void(0)' class='vote_down_act' OnClick='InvalidVote("+id+");'>&ndash;</a>");
    $("span#vote_button_up"+id).html("<a href='javascript:void(0)' class='vote_up' id='"+id+"' OnClick='UpVote("+id+");'>+</a>");	
    $.ajax({
		type: "POST",
		data: "action=vote_down&id="+id,
		url: "vote_pic.php",
        success: function(msg)
        {
        	$("span#votes_count"+id).html(msg);

        }
    });
}
function InvalidVote( id )
{
    $("span#vote_button_down"+id).html("<a href='javascript:void(0)' class='vote_down' id='"+id+"' OnClick='DownVote("+id+");'>&ndash;</a>");
    $("span#vote_button_up"+id).html("<a href='javascript:void(0)' class='vote_up' id='"+id+"' OnClick='UpVote("+id+");'>+</a>");	
    $.ajax({
		type: "POST",
		data: "action=vote_invalid&id="+id,
		url: "vote_pic.php",
        success: function(msg)
        {
        	$("span#votes_count"+id).html(msg);

        }
    });
}

function CaptionUpVote( id )
{
    $("span#caption_vote_button_up"+id).html("<a href='javascript:void(0)' class='caption_vote_up_act' OnClick='CaptionInvalidVote("+id+");'>+</a>");
    $("span#caption_vote_button_down"+id).html("<a href='javascript:void(0)' class='caption_vote_down' id='"+id+"' OnClick='CaptionDownVote("+id+");'>&ndash;</a>");	
    $.ajax({
		type: "POST",
		data: "action=vote_up&id="+id,
		url: "vote_caption.php",
        success: function(msg)
        {
        	$("span#caption_votes_count"+id).html(msg);

        }
    });
}
function CaptionDownVote( id )
{
    $("span#caption_vote_button_down"+id).html("<a href='javascript:void(0)' class='caption_vote_down_act' OnClick='CaptionInvalidVote("+id+");'>&ndash;</a>");
    $("span#caption_vote_button_up"+id).html("<a href='javascript:void(0)' class='caption_vote_up' id='"+id+"' OnClick='CaptionUpVote("+id+");'>+</a>");	
    $.ajax({
		type: "POST",
		data: "action=vote_down&id="+id,
		url: "vote_caption.php",
        success: function(msg)
        {
        	$("span#caption_votes_count"+id).html(msg);

        }
    });
}
function CaptionInvalidVote( id )
{
    $("span#caption_vote_button_down"+id).html("<a href='javascript:void(0)' class='caption_vote_down' id='"+id+"' OnClick='CaptionDownVote("+id+");'>&ndash;</a>");
    $("span#caption_vote_button_up"+id).html("<a href='javascript:void(0)' class='caption_vote_up' id='"+id+"' OnClick='CaptionUpVote("+id+");'>+</a>");	
    $.ajax({
		type: "POST",
		data: "action=vote_invalid&id="+id,
		url: "vote_caption.php",
        success: function(msg)
        {
        	$("span#caption_votes_count"+id).html(msg);

        }
    });
}
