﻿var CategoryWindow = Class.create();
CategoryWindow.prototype = {
	initialize : function(button, win) {
		this.button = $(button);
        this.win = $(win);

        var w = this.win.getDimensions();
        this.win.setStyle({
            //width: w.width+'px',
            //height: w.height+'px',
            marginTop: '-7px',
            zIndex: 10001
            });

		Event.observe(this.button, 'mouseover', this.showWindow.bind(this), false);
        Event.observe(this.button, 'mouseout', this.hideWindow.bind(this), false);
	},
    showWindow : function() {
        if (!this.win.visible()) {
            this.win.show();
            setVisiblityWhichOffenseCateDiv(false);
        }
    },
    hideWindow : function() {
        this.win.hide();
        setVisiblityWhichOffenseCateDiv(true);
    }
}

function setVisiblityWhichOffenseCateDiv(isVisible) {
	var obj = $("selProductType");
	var obj2 = $("noUseObject");
	if(isVisible) {
		obj2.hide();
		obj.show();
	}
	else {
		obj.hide();
		obj2.show();
	}
}