﻿var Button = {
    GetHeight : function(elem) {
        if (!elem) return null;
        var height = elem.style.height; if (!height) return null;
        return Number(height.replace('px',''));
    },
    Over : function(elem) {
        var height = this.GetHeight(elem); if (!height) return;
        elem.style.backgroundPosition = '0px -' + height + 'px';
    },
    Out : function(elem) {
        var height = this.GetHeight(elem); if (!height) return;
        elem.style.backgroundPosition = '0px 0px';
    },
    Down : function(elem) {
        var height = this.GetHeight(elem); if (!height) return;
        elem.style.backgroundPosition = '0px -' + (2 * height) + 'px';
    },
    Up : function(elem) {
        var height = this.GetHeight(elem); if (!height) return;
        elem.style.backgroundPosition = '0px -' + height + 'px';
    }
}