function voteup(obj,content_type,content_id) {
        if ($(obj).hasClass("votedup"))
        {
                $(obj).removeClass("votedup");
                $(obj).addClass("voteup");
	        $.post('/commons/newvote', { hash: obj.parentNode.id, type: content_type, id: content_id, value: 0 } );
        }
	else
	{
                $(obj).removeClass("voteup");
                $(obj).addClass("votedup");
	        $.post('/commons/newvote', { hash: obj.parentNode.id, type: content_type, id: content_id, value: 1 }  );
	}

	$('#' + obj.parentNode.id + ' > .voteddown').addClass("votedown").removeClass("voteddown");
//	alert('#' + obj.parent.id + ' > a');
//	$('.voteddown').removeClass("voteddown");
//	alert(obj.parentNode.id);
}
function votedown(obj,content_type,content_id) {
        if ($(obj).hasClass("voteddown"))
        {
                $(obj).removeClass("voteddown");
                $(obj).addClass("votedown");
	        $.post('/commons/newvote', { hash: obj.parentNode.id, type: content_type, id: content_id, value: 0 }  );
        }
	else
	{
                $(obj).removeClass("votedown");
                $(obj).addClass("voteddown");
	        $.post('/commons/newvote', { hash: obj.parentNode.id, type: content_type, id: content_id, value: -1 }  );
	}
	$('#' + obj.parentNode.id + ' > .votedup').addClass("voteup").removeClass("votedup");
}
function untag(obj,tagged_type,tagged_id,content_type,content_id) {
        if (tagged_type=="team")
                $(obj).parent().parent().parent().parent().parent().hide('slow');
        else
                $(obj).parent().hide('slow');
        $.post('/commons/newtag', {hash: obj.id, type:content_type, id:content_id, taggedtype:tagged_type, taggedid:tagged_id, untag:1});
}
function togglecontent(a,query)
{
	$(query).toggle();
	if ($(a).hasClass("hidebutton"))
	{
		$(a).addClass("showbutton").removeClass("hidebutton").html("+");
	}
	else
	{
                $(a).addClass("hidebutton").removeClass("showbutton").html("-");
	}
}


