
function MoveToPage($OrderBy, $NumberPerPage, $PageNo, $DisplayType)
{
  $.get("XMLReader.php", { OrderBy: $OrderBy, NumberPerPage: $NumberPerPage, Page: $PageNo, DisplayType: $DisplayType },
    function(data){
      if (data == '') { data = 'Error reading XML' }
      $("#gallery").html(data);
      Ajax();
    });
}


function vote(id, vote) {
  $.post("/rolando-creator/vote.php", {id: id, thumb: vote}, 
		function(data) {
			if(data.status == "success") {
				$("#rolando-"+id+" .VoteDown").attr("href", "javascript:void(0);");
        $("#rolando-"+id+" .VoteUp").attr("href", "javascript:void(0);");

				// SET BUTTON STATUS STYLES
				if(vote == 1) {
          $("#rolando-"+id+" .VoteDown").addClass('red');
          $("#rolando-"+id+" .VoteUp").addClass('green');
          }
				else {
          $("#rolando-"+id+" .VoteDown").addClass('green');
          $("#rolando-"+id+" .VoteUp").addClass('red');
          }


				// HANDLE CHANGING VOTE INFO
				if(data.votes == 0) {
					$("#rolando-"+id+" .votes").removeClass('positive negative');
				} else if(data.votes > 0) {
					$("#rolando-"+id+" .votes").addClass('positive');
					$("#rolando-"+id+" .votes").removeClass('negative');
				} else {
					$("#rolando-"+id+" .votes").addClass('negative');
					$("#rolando-"+id+" .votes").removeClass('positive');
				}
				$("#rolando-"+id+" .votes").text(data.votes);
			}
		},
	"json");
}
