change_cities = function(province) {
	new Ajax.Updater('city', './cities.php', {
	  parameters: { p: province  }
	});
}

up_vote = function(listing_id) {
	new Ajax.Updater('votes_'+listing_id, './upvote.php', {
	  parameters: { id: listing_id  },
	  onSuccess: function() {
			if($('votenow')) {
				/*Element.update($('votenow'), '<span class="alreadyvoted">Voted!</span>')*/
			}
		}
	});
}

login = function(returnto) {
	Effect.Appear('loginpop', { duration: 0.6 });
	Form.Element.setValue($('returntohere'), returnto)
}

closelogin = function() {
	Effect.Fade('loginpop', { duration: 0.3 });
}

ratem = function(id, rate)
{
	var container = 'rateem-'+id;
	/*$(container).update('<img style="text-align:center;" src="/style/loading.gif" alt="Loading">');*/
	new Ajax.Updater($(container), '/rate.php', {
	 parameters: { rateOption: rate, rateID: id },
	 onSuccess: function() { }
	});
}
