new Namespace("at.steiermark.popup.popup");
at.steiermark.popup.popup = Class.create({
	
	initialize : function (button, container) {
		this.button = button;
		this.container = container;
		this.button.my_class = this;
		this.container.my_class = this;
		this.container.out_interval = null;
		
		this.button.observe('mouseover', this.over);
		this.container.observe('mouseover', this.over);
		this.container.observe('mouseout', this.out);
	},

	over : function () {
		this.my_class.show();
		clearInterval(this.my_class.out_interval);
		this.my_class.out_interval = null;
	},
	
	out : function () {
		this.my_class.setout_interval();
	},
	
	hide : function () {
		clearInterval(this.out_interval);
		this.out_interval = null;
		this.container.style.display = 'none';
	},
	
	show: function () {
		this.container.style.display = 'block';
	},
	
	setout_interval : function () {
		if(this.out_interval == null) {
			this.out_interval = window.setInterval(this.hide.bind(this),200);
		}
	}
	
});



