       
        var commentResult = new Array();
       
        function RateCallback(msg)
        {
            
           var idAbstractContent = $(msg).find('idAbstractContent').text();
           commentResult[idAbstractContent] = true;
           var  newRate = $(msg).find('rate').text();
           var  newraters = $(msg).find('raters').text();
           var  newwidth = $(msg).find('ratewidth').text();
            
            if (newRate != null && newraters != null)
            {
                var objdivResponse = $("#divResponse_" + idAbstractContent);
                var objRateDiv = $("#rater");
                if (objRateDiv == null)
                {
                    objRateDiv = $("#rate" + idAbstractContent);
                }
                
                var objRatersDiv = $("#raters");    //votanti
                    if (objRatersDiv == null)
                    {
                        objRatersDiv   = $("lblRaters");
                    }
                var objCurrentRating = $("#current-rating" + idAbstractContent);
                if (objCurrentRating == null)
                {
                    objCurrentRating = $("current-rating" + idAbstractContent);
                }          
               
               newwidth = eval(newwidth);
               newwidth = newwidth*20;
                if (objdivResponse != null)
                {
                    objdivResponse.show();
                }
                
                if (objRateDiv != null)
                    objRateDiv.text(newRate);

                if (objRatersDiv != null)          
                {      
                    objRatersDiv.text(newraters);
                     if (objCurrentRating != null)
                     {
                        objCurrentRating.width(parseInt(newwidth));                      
                    }
                }
            }
        }
        function rateContent(idcontent, rateValue)
        {        
           
                if (commentResult[idcontent] == null)
                {               
                    AjaxCall('RateService.asmx','Rate', 'onlinecontentid=' + idcontent + '&rate=' + rateValue ,RateCallback);
                }
                else
                {
                    if (AlreadyRate)
                        AlreadyRate();
                    else
                        alert("Hai gia' votato questo contenuto");
                }
        }
        
