

function AdaptiveLine(from, to, drawTo){
	this.from = from;
	this.to = to;
	this.drawTo = $(drawTo);
	this.create();
	this.initEvents();
}

AdaptiveLine.prototype = {
	
	create: function(){
		this.line = $(document.createElement('div')).addClass("line").appendTo(this.drawTo);
		this.draw();
	},
	
	draw: function(){
		var _my = this;
		var _from = this.from();
		var _to = this.to();
		this.line.css({ left: _from.x, top: _to.y, width: _to.x-_from.x });
	},
	
	initEvents: function(){
		var _my = this;
		$(window).resize(function(){
			_my.draw();
		})
		
		this.body = jQuery('#layout').height();
		setInterval(function(){
			_my.checkFontSize();
		}, 50)
		
	},

	checkFontSize: function() {
		var b = document.getElementById('layout').offsetHeight;
		if(b != this.body){
			this.draw();
			this.body = b;
		}
	},
	
	hide: function(){
		this.line.fadeOut("fast");
	},
	
	hideFast: function(){
		this.line.hide();
	},

	show: function(){
		this.line.show().fadeIn("fast", function(){
		});
		this.draw();
	}
	
}