
var calculator = Class.create({
	
	watchlist: null,
	searchform: null,
	mainframe: null,

    ticketing : {
        contractor : null,
        seasonstart : null,
        locationURL : null
    },

	
	initialize: function(contractor, seasonstart, ticketingURL ) {

        this.ticketing.contractor = contractor;
        this.ticketing.seasonstart = seasonstart;
        this.ticketing.locationURL = ticketingURL;

		// this is the mainframe html element
		this.mainframe = $("ticketing");
				
		if(contractor) {
			if(typeof window[contractor + "_calculator_watchlist"] == "function") {
				this.watchlist = new window[contractor + "_calculator_watchlist"](this);
			}
			
			if(typeof window[contractor + "_calculator_searchform"] == "function") {
				this.searchform = new window[contractor + "_calculator_searchform"](this);
			}
		}
		
		
		if(!this.watchlist) {
			this.watchlist = new calculator_watchlist(this);
		}
		if(!this.searchform) {
			this.searchform = new calculator_searchform(this);
		}
	}
	
	
	
});


var calculator_translate = function (key) {
	if(calculator_translations[key]) {
		return calculator_translations[key];
	}
	return key;
};



