﻿/// <reference name="MicrosoftAjax.js"/>
// var tabsObject = $create(Soft202.Tabs, { titleCSS: "title", titleHoverCSS: "titleHover", titleCheckedCSS: "titleChecked", contentShowCSS: "Conten", contentHideCSS: "ContenHide" }, null, null, $get(tabs[i]));
Type.registerNamespace("Soft202");

Soft202.Hovers = function (element) {
    Soft202.Hovers.initializeBase(this, [element]);
    this._hoverCss = "hover";
    this._outCss = "out";
    this._eHoverDelegate = null;
    this._eOutDelegate = null;

}

Soft202.Hovers.prototype = {
    initialize: function () {
        Soft202.Hovers.callBaseMethod(this, 'initialize');


        this.initDelegate();

        // 在此处添加自定义初始化
    },
    //初始化委托
    initDelegate: function () {

        if (this._eHoverDelegate === null) {
            this._eHoverDelegate = Function.createDelegate(this, this.eHoverHandler);
        }
        if (this._eOutDelegate === null) {
            this._eOutDelegate = Function.createDelegate(this, this.eOutHandler);
        }
        $addHandler(this._element, "mouseover", this._eHoverDelegate);
        $addHandler(this._element, "mouseout", this._eOutDelegate);
    }
    ,
    set_HoverCss: function (value) {
        this._hoverCss = value;
    },
    set_OutCss: function (value) {
        this._outCss = value;
    },


    eHoverHandler: function (e) {
        Sys.UI.DomElement.addCssClass(this._element, this._hoverCss);
    },

    eOutHandler: function (e) {
        Sys.UI.DomElement.removeCssClass(this._element, this._hoverCss);

    },
    dispose: function () {
        //在此处添加自定义释放操作
        Soft202.Hovers.callBaseMethod(this, 'dispose');
    }
}
Soft202.Hovers.registerClass('Soft202.Hovers', Sys.UI.Behavior);

if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
