 function addRating(id, isCache, starImg) {
    var rating = 3;
    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;
    }
    
    var ajaxMethodName = isCache ? "rateCache" : "rateTrip";
    
    new Ajax.Request(
        "/dyn/AjaxHandlers/TripRatings.ashx",
        {
          method: "get",
          parameters: "ajaxMethodName=" + ajaxMethodName + "&rating=" + rating + "&id=" + id + "&starImg=" + starImg,
          onSuccess: addRatingSuccess,
          onCreate: addRatingRequestCreated,
          onFailure: addRatingFailure
        }
    );
    return false;
 }
 
 function addRatingSuccess(request) {
    var params = request.responseText.toQueryParams();
    var ratingHtml = params["ratingHtml"];

    $("ratingDiv").innerHTML = ratingHtml;
    document.getElementById("newRatingContainer").style.display = "none";
 }
 
 function addRatingFailure(request) {
    alert(request.responseText);
 }
 
 function addRatingRequestCreated() {
 }

