function top_over(num){
	document.getElementById("vote_"+num).className = "vote_" + num + "_s";
}

function top_out(num){
	document.getElementById("vote_"+num).className = "vote_" + num;
}

function setVote(divNum,series_idx){
	var myApm = new APM();
	if (isVoted == 0){
		new Ajax.Request('/photoseries/vote_pseries.html',{
			parameters:{
				idx:series_idx,
				point:divNum
			}
		}) ;
		$("haveVoted").className = "show";
		$("haveVoted").update("Thanks~!");
		myApm.setAlpha("haveVoted",0);
		myApm.onEnd = function(){
			var backApm = new APM();
			setTimeout(function(){backApm.changeAlpha('haveVoted', 0,3);}.bind(this),300);
			$("votedNum").innerHTML = parseInt($("votedNum").innerHTML) + divNum;
			top_out(divNum);
			backApm.onEnd = function(){
				$("haveVoted").className = "";
			};
		}
		myApm.changeAlpha('haveVoted', 100,3);
		isVoted = 1;
	}else{
		$("haveVoted").className = "show";
		$("haveVoted").update("You have already voted!");
		myApm.setAlpha("haveVoted",0);
		myApm.onEnd = function(){
			var backApm = new APM();
			setTimeout(function(){backApm.changeAlpha('haveVoted', 0,3);}.bind(this),300);
			top_out(divNum);
			backApm.onEnd = function(){
				$("haveVoted").className = "";
			};
		}
		myApm.changeAlpha('haveVoted', 100,3);
	}
}