﻿// CallWebServiceMethods.js

// This function calls the Web service method without 
// passing the callback function. 
function SendComments(name, emailFrom, comment, cestriaEmailTo) {
    Cestria.Ratings.Comments.RatingsAndCommentsService.SendComments(name, emailFrom, comment, cestriaEmailTo);
}

// This function calls the Web service method without 
// passing the callback function.
function SendContact(name, emailFrom, comment, cestriaEmailTo) {
    Cestria.Ratings.Comments.RatingsAndCommentsService.SendContact(name, emailFrom, comment, cestriaEmailTo);
}

// This function calls the Web service method without 
// passing the callback function.
function TellAFriend(emailFrom, emailTo, message, cc, url, title) {
    Cestria.Ratings.Comments.RatingsAndCommentsService.TellAFriend(emailFrom, emailTo, message, cc, url, title);
}

// This is the callback function invoked if the Web service
// succeeded.
// It accepts the result object as a parameter.
function SucceededCallback(result, eventArgs)
{
    alert(result);
}


// This is the callback function invoked if the Web service
// failed.
// It accepts the error object as a parameter.
function FailedCallback(error)
{
    // Display the error.    
    var RsltElem = 
        document.getElementById("ResultId");
    RsltElem.innerHTML = 
    "Service Error: " + error.get_message();
}