function Container(xoffset, yoffset, width, height) {
            this.xoffset = xoffset; // offset from the the top left hand corner
            this.yoffset = yoffset; // ditto 
            this.height = height;
            this.width = width;

            this.shortestEdge = function () {
                return Math.min(this.height, this.width);
            };

            // getCoordinates - for a row of boxes which we've placed 
            //                  return an array of their cartesian coordinates
            this.getCoordinates = function (row) {
                var coordinates = [];
                var subxoffset = this.xoffset, subyoffset = this.yoffset; //our offset within the container
                var areawidth = sumArray(row) / this.height;
                var areaheight = sumArray(row) / this.width;
                var i;

                if (this.width >= this.height) {
                    for (i = 0; i < row.length; i++) {
                        coordinates.push([subxoffset, subyoffset, subxoffset + areawidth, subyoffset + row[i] / areawidth]);
                        subyoffset = subyoffset + row[i] / areawidth;
                    }
                } else {
                    for (i = 0; i < row.length; i++) {
                        coordinates.push([subxoffset, subyoffset, subxoffset + row[i] / areaheight, subyoffset + areaheight]);
                        subxoffset = subxoffset + row[i] / areaheight;
                    }
                }
                return coordinates;
            };

            // cutArea - once we've placed some boxes into an row we then need to identify the remaining area, 
            //           this function takes the area of the boxes we've placed and calculates the location and
            //           dimensions of the remaining space and returns a container box defined by the remaining area
            this.cutArea = function (area) {
                var newcontainer;

                if (this.width >= this.height) {
                    var areawidth = area / this.height;
                    var newwidth = this.width - areawidth;
                    newcontainer = new Container(this.xoffset + areawidth, this.yoffset, newwidth, this.height);
                } else {
                    var areaheight = area / this.width;
                    var newheight = this.height - areaheight;
                    newcontainer = new Container(this.xoffset, this.yoffset + areaheight, this.width, newheight);
                }
                return newcontainer;
            };
        }
Adds a time input control. In some browsers this will just render as a text input field, but should still retain all other functionality.
@param title {String} The title of the control.
@param date {String|Date} A string in the format "HH:MM", "HH:MM:SS" or a Date object.
@param object {Object} Object the control is bound to. When the value of the control changes, a property on this object, with the name of the title of this control, will be set to the current value of this control.
@returns {*}