
	function adv_slider(container) {
		this.container = container;
		this.pos = null;
		this.pos_max = 50;
		this.timeout = null;
		
		this.exp_base = 2;
		this.exp_top = null;
		this.exp_foot = null;
		
		this.direction = 0;
	}
	
	adv_slider.prototype.construct = function(ref) {
		var self = this;
		
		this.exp_top = Math.log(430) / Math.log(this.exp_base);
		this.exp_foot = Math.log(40) / Math.log(this.exp_base);
		
		this.container.onmouseover = function(trgEvent) {
			var evt = trgEvent == null ? document.event : trgEvent;
			if (evt != null) {
				if (this.timeout != null) {
					clearTimeout(this.timeout);
					this.timeout = null;
				}
				self.open();
			}
		}
		this.container.onmouseout = function(trgEvent) {
			var evt = trgEvent == null ? document.event : trgEvent;
			
			if (evt != null) {
				var target = evt.toElement == null ? evt.relatedTarget : evt.toElement;
				
				while (target != null && target != self.container) target = target.parentNode;
				
				if (target == null) self.timer_close();
			}
		}
	}
	
	adv_slider.prototype.timer_close = function() {
		if (this.timeout != null) clearTimeout(this.timeout);
		
		this.timeout = setTimeout("ref_close()", 5000);
	}
	
	adv_slider.prototype.open = function() { this.direction = 1; }
	adv_slider.prototype.close = function() { this.direction = -1; }
	
	adv_slider.prototype.motion = function() {
		if (this.direction != 0) {
			if (this.direction == 1) this.pos += 1;
			else if (this.direction == -1) this.pos += -1;
			
			if (this.pos < 0) {
				this.pos = 0;
				this.direction = 0;
			}
			if (this.pos > this.pos_max) {
				this.pos = this.pos_max;
				this.direction = 0;
				this.timer_close();
			}
			
			var nexp = this.exp_foot + (((this.pos_max - this.pos) / this.pos_max) * (this.exp_top - this.exp_foot));
			var point = - Math.round(Math.pow(this.exp_base, nexp)) + 40;
			this.container.style.left = point + "px";
		}
	}

