var Page = Class.create();

Page.getInstance = function() {
    if (typeof (Page.instance) == 'undefined') {
        Page.instance = new Page();
    }
    return Page.instance;
};

Object.extend(Page.prototype, {
    initialize: function() {
    },
    start: function() {
        this.flights = new Flights();
        this.matrix  = new Matrix();
        if ($('post')) {
            holdingPage = new Page.HoldingPage();
            $("page").setStyle({opacity: 1});
            holdingPage.show();
            setTimeout(function() {
                $("flights_form").show();
            }, 30000);
        }
        this.form    = new PForm();
        this.holdingPage = false;
    },
    getMatrix: function() {
        return this.matrix;
    },
    getFlights: function() {
        return (this.flights) ? this.flights : new Flights();
    },
    getForm: function() {
        return this.form;
    },
    autoSearch: function() {
        if ($("post")) {
            this.form.setAutostartParameters();
            this.flights.search();
        }
    }
});