/**include
//_javascript/load-wrapper.js;
*/

/**
 * Modal window control
 *
 */


var enterOpen = newObject({
	div : null,

	init : function () {
        //alert("enterOpen.init")
	},

    onready : function () {
        //alert("enterOpen.onready");
		// !!! link = this.$("a#enter_link"); -- without var link ... - Error in ie!!!
        // link = [object HTMLHeadingElement]
        // alert(link);
        
        var link = this.$("a#enter_link");
        this.div = this.$("#model_enter");
        if (link) {
        	link.addListener(this, "onclick");
        }
        this.close = this.$("#model_enter a#close");
        this.close.addListener(this, "onclick", "click_close");
        
        error = this.$("#model_enter .errorForm");
        if (error) {
        	this.div.show();
        }
    },

	onclick : function(evtWr, dt)
    {
    	evtWr.eventDrop();
        evtWr.elmWr.elm.blur();

        this.div.show();
    },

    click_close : function(evtWr, dt)
    {
    	if(evtWr.elmW){
	        evtWr.eventDrop();
	        evtWr.elmW.elm.blur();
    	}
        this.div.hide();
    }
});