var Floaty = (function () {
	
	return {
		"CONSTANTS": {
			"mainWindowHeight": 480
		},
		"Utils": {
			clone : function(object) {
			    function F() {}
			    F.prototype = object;
			    return new F;
			},
			map: function (value, min1, max1, min2, max2) { // returns a new value relative to a new range
				var unitratio = (value - min1) / (max1 - min1);
				return (unitratio * (max2 - min2)) + min2;
			},
			PVectorSub: function (v1, v2) {
				return PVector.create(v1.x - v2.x, v1.y - v2.y);
			},
			PVectorAdd: function (v1, v2) {
				return PVector.create(v1.x + v2.x, v1.y + v2.y);
			}
		},
		"Collection": [],
		"Container": {
			configure: function (params) {
				this.id = params.id;
				this.el = params.el;
				this.width = params.width;
				this.height = params.height;
				this.center = params.center;
				this.scrollMaxDistance = params.scrollMaxDistance;
			},
			position: function () {

				if (this.center) {
					if (this.id === "page") {
						$(this.el).css({
							"left": $(window).width()/2 - this.width/2,
							"top": $(window).height()/2 - this.height/2 - this.scrollMaxDistance/2
						});
					} else {
						$(this.el).css({
							"left": $(window).width()/2 - this.width/2 - this.width,
							"top": $(window).height()/2 - this.height/2 - this.scrollMaxDistance/2
						});
					}
				}
			}
		}
	};
	
}());


