﻿/// <reference name="MicrosoftAjax.js"/>
Type.registerNamespace("aorta.playmeweb.webcontrols");

aorta.playmeweb.webcontrols.BaixaHits = function() {
    aorta.playmeweb.webcontrols.BaixaHits.initializeBase(this);

    this._player = null;

    this._player_onShowMusicInfoDelegate = null;
}

aorta.playmeweb.webcontrols.BaixaHits.prototype = {
    initialize: function() {
        aorta.playmeweb.webcontrols.BaixaHits.callBaseMethod(this, 'initialize');

        this._player_onShowMusicInfoDelegate = Function.createDelegate(this, this._player_onShowMusicInfoHandler);
        this._player.add_showMusicInfo(this._player_onShowMusicInfoDelegate);
    },

    dispose: function() {
        aorta.playmeweb.webcontrols.BaixaHits.callBaseMethod(this, 'dispose');

        this._player.remove_showMusicInfo(this._player_onShowMusicInfoDelegate);
    },

    _player_onShowMusicInfoHandler: function(sender, args) {
        this.get_divCarregando().style.display = 'block';
        eval(this.get_funcaoPost());
    },

    get_player: function() {
        /// <value type="Sys.Component" locid="P:J#aorta.playmeweb.webcontrols.BaixaHits.player"></value>
        if (arguments.length !== 0) throw Error.parameterCount();
        return this._player;
    },
    set_player: function(value) {
        var e = Function._validateParams(arguments, [{ name: "value", type: Sys.Component}]);
        if (e) throw e;
        this._player = value;
    },

    get_funcaoPost: function() {
        /// <value type="String" locid="P:J#aorta.playmeweb.webcontrols.BaixaHits.funcaoPost"></value>
        if (arguments.length !== 0) throw Error.parameterCount();
        return this._funcaoPost;
    },
    set_funcaoPost: function(value) {
        var e = Function._validateParams(arguments, [{ name: "value", type: String}]);
        if (e) throw e;
        this._funcaoPost = value;
    },

    get_divCarregando: function() {
        /// <value type="Object" locid="P:J#aorta.playmeweb.webcontrols.BaixaHits.divCarregando"></value>
        if (arguments.length !== 0) throw Error.parameterCount();
        return this._divCarregando;
    },
    set_divCarregando: function(value) {
        var e = Function._validateParams(arguments, [{ name: "value", type: Object}]);
        if (e) throw e;
        this._divCarregando = value;
    },

    setCursor: function(object, value) {
        var e = Function._validateParams(arguments, [{ name: "object", type: Object }, { name: "value", type: String}]);
        if (e) throw e;
        object.style.cursor = value;
    }
}

aorta.playmeweb.webcontrols.BaixaHits.registerClass('aorta.playmeweb.webcontrols.BaixaHits', Sys.Component);

if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();