function vote_article() {
    
	id = $('articleid').value;
	
	if ($('rating1').checked) {
		rating = 1;
	} else if ($('rating2').checked) {
		rating = 2;
	} else if ($('rating3').checked) {
		rating = 3;
	} else if ($('rating4').checked) {
		rating = 4;
	} else if ($('rating5').checked) {
		rating = 5;
	}
	
	new Ajax(base_url+'articles/vote', {postBody: 'rating='+ rating +'&article='+ id, update: $('vote_result')}).request();
	
	return false;	
}

function vote_photo() {
    
	id = $('photoid').value;
	
	if ($('rating1').checked) {
		rating = 1;
	} else if ($('rating2').checked) {
		rating = 2;
	} else if ($('rating3').checked) {
		rating = 3;
	} else if ($('rating4').checked) {
		rating = 4;
	} else if ($('rating5').checked) {
		rating = 5;
	}
	
	new Ajax(base_url+'photos/vote', {postBody: 'rating='+ rating +'&photo='+ id, update: $('vote_result')}).request();

	return false;	
}