dlRating.prototype.submitRating = function (rating) {

    var that = Object.clone (this);

    var req = new dlAjax ();

    var postBody = ({
        'assetId'     : commentConfig.asset,
        'appId'       : 'RF',
        'contentType' : 'recipe',
        'rating'      : rating
    });

    req.generate (postBody, "RateAsset");

    req.send (function (transport) {
        that.updateContent (transport);
    });
}

dlRating.prototype.updateContent = function (transport)
{
    var xml = transport.responseXML; 
    var avgRating = xml.getElementsByTagName ("averagerating") [0].firstChild.nodeValue;

    req = new dlAjax ();

    postBody = ({
        'assetId'     : commentConfig.asset,
        'apppId'      : 'RF',
        'contentType' : 'recipe',
        'rating'      : avgRating
    });

    req.generate (postBody, "RateRecipe");

    req.send ();
}
