Prado.WebUI.TRatingList = Base.extend( { selectedIndex : -1, rating: -1, enabled : true, readOnly : false, constructor : function(options) { var cap = $(options.CaptionID); this.options = Object.extend( { caption : cap ? cap.innerHTML : '' }, options || {}); Prado.WebUI.TRatingList.register(this); this._init(); this.selectedIndex = options.SelectedIndex; this.rating = options.Rating; if(options.Rating <= 0 && options.SelectedIndex >= 0) this.rating = options.SelectedIndex+1; this.showRating(this.rating); }, _init: function(options) { Element.addClassName($(this.options.ListID),this.options.Style); this.radios = new Array(); var index=0; for(var i = 0; i halfMax ? base+1 : base; for(var i = 0; i halfMax ? base+1 : base; var hasHalf = remainder >= halfMin && remainder <= halfMax; for(var i = 0; i index ? 'removeClassName' : 'addClassName'; Element[action](node, "rating_selected"); if(i==index+1 && hasHalf) Element.addClassName(node, "rating_half"); else Element.removeClassName(node, "rating_half"); Element.removeClassName(node,"rating_hover"); } }, getIndexCaption : function(index) { return index > -1 ? this.radios[index].value : this.options.caption; }, showCaption : function(value) { var caption = $(this.options.CaptionID); if(caption) caption.innerHTML = value; $(this.options.ListID).title = value; }, setCaption : function(value) { this.options.caption = value; this.showCaption(value); }, setEnabled : function(value) { this.enabled = value; for(var i = 0; i