﻿Type.registerNamespace('AjaxControlToolkit');

AjaxControlToolkit.LCRatingBehavior = function(element) {
    AjaxControlToolkit.LCRatingBehavior.initializeBase(this, [element]);
    //alert("here");
}

AjaxControlToolkit.LCRatingBehavior.prototype = {
    _onStarClick : function(e) //this is the function we're overriding
    {
        if (this._readOnly) {
            return;
        }
        //if (this._ratingValue != this._currentRating) {
            this.set_Rating(this._currentRating);
        //}
    },
    set_Rating: function(value) {
        //if (this._ratingValue != value) {
            this._ratingValue = value;
            this._currentRating = value;
            if (this.get_isInitialized()) {
                if ((value < 0) || (value > this._maxRatingValue)) {
                    return;
                }

                this._update();

                AjaxControlToolkit.RatingBehavior.callBaseMethod(this, 'set_ClientState', [this._ratingValue]);
                this.raisePropertyChanged('Rating');
                this.raiseRated(this._currentRating);
                this._waitingMode(true);

                var args = this._currentRating + ";" + this._tag;
                var id = this._callbackID;

                if (this._autoPostBack) {
                    __doPostBack(id, args);
                }
                else {
                    WebForm_DoCallback(id, args, this._receiveServerData, this, this._onError, true)
                }

            }
        //}
    }
}

AjaxControlToolkit.LCRatingBehavior.inheritsFrom(AjaxControlToolkit.RatingBehavior);

AjaxControlToolkit.LCRatingBehavior.registerClass('AjaxControlToolkit.LCRatingBehavior', AjaxControlToolkit.RatingBehavior);  // second parameter is the class you're "inheriting" from
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();