/***************************************
 * Voting Animations
 ***************************************/

if(typeof Effect == 'undefined')
    throw("vote.js requires including script.aculo.us' effects.js library");

function voteDoNothing() {
    return false;
}

function setVoteStatusMsg(msg) {
    window.status = (msg == null ? '' : msg);
    return true;
}

function animateVoteButton(buttonElementIds, floaterId, voteButtonId, voteAbsValue, voteType)
{
	var voteValue = (voteType == 'Up' ? '+' : '-') + voteAbsValue;
	
    var floater = $(floaterId);
    floater.update(voteValue);
    floater.style.visibility='';

    window.status = '';

    // run the animation effect
    var durationSeconds = 2.5;
    new Effect.Fade(floaterId, {duration: durationSeconds});

    // convert to "voted" button
    if (voteType == 'Up') {
        new Effect.Move(floaterId, { x:  0, y: -45, duration: durationSeconds, mode: 'relative'});
    } else {
        new Effect.Move(floaterId, { x:  0, y: +25, duration: durationSeconds, mode: 'relative'});
    }
}

