function ContestVote() {
  this.vote = vote;

  function vote(id) {
    //If anyone figures out what goes in the honeypot they will get
    //a $100 dollar prize.
    var url = "/contest/dirtiest_apartment/" + id + "/vote/?honeypot=" + honeypot;
    $.ajax({
      method: "get",
      url: url,
      dataType: ($.browser.msie) ? "xml" : "text/xml",
      cache: false,
      beforeSend: function(){
        //Hide the vote button
        $("#vote_show").hide("slow");
      },
      complete: function(){ return;}, //stop showing loading when the process is complete
      success: function(html){
        //Get the vote count
        $(html).find('vote').each(function() {
          var vote = $(this);
          v_count = vote.attr("vote_count");
          v_success = vote.attr("vote_success");
        });

        if(v_success == "True") {
          //Update the vote count
          $("#vote_count").html(v_count);

          //Update the check
          $('#vote_uncheck').css("display","None");
          $('#vote_check').css("display","Block");

          //Display success mesg
          $("#vote_success").show("slow");
        } else {
          $("#vote_fail").show("slow");
        }
        //Show the right message
        //if(vote_success == "True") { $("#vote_success").css("display","Block"); }
        //else {$("#vote_fail").css("display","Block"); }
        //if(vote_success == "True") { $("#vote_success").show("slow"); }
        //else {$("#vote_fail").show("slow"); }

      }
    });
  }
}

