function Axis_CLASS (_max, _ymax, _min, _ymin) {
	var m, q;
	var olds = new Array();
	this.getPos = function  (x, height, strict) {
		if (height == null) height = 0;
		if (strict == null) strict = true;
		var pos = x*m+q;
		while (!checkOlds(pos, height)) {
			pos += height;
		}
		if (height > 0) olds.push(pos);
		if (pos>_ymax && strict) return false;
		return pos;
	}
	this.getInvPos = function  (x, height) {
		return this._ymax - this.getPos(x, height);
	}


	function checkOlds (pos, height) {
		if (olds.length == 0 || height == null || height == 0) return true;
		var state = true;
		$.map(olds, function (val, key) {
			if ((val+height) > pos) state = false;
		});
		return state;
	}
	
	this._max=_max; this._min=_min; this._ymax=_ymax; this._ymin=_ymin;
	m = (_ymax-_ymin) / (_max-_min);
	q = _ymax - m*_max;
//	var debug = $("<div>").html("From ("+_min+","+_ymin+"), to ("+_max+","+_ymax+"): m="+m+", q="+q);
//	$("#flightbox_content").append(debug);
}

