/**
 * Copyright 2006 Jeffrey Palm.
 */

Jeff = {};

Jeff.Main = Class.create();
Jeff.Main.prototype = {

	initialize: function() {
		//
		// This has the one function viewBand(String[band])
		//
		this.view = 0;
		
	},

	viewBand: function(band) {
		this.setBand(band);
		if (!this.getView()) {
			this.showView('schedule',true);
			this.setView(new Jeff.Schedule());
		} else {
			this.showView(this.getView().viewName(),true);
			//this.getView().viewBand(band);
		}
	},
	
	setView: function(view) {
		this.view = view;
		var band = this.getBand();
		if (band) this.view.viewBand(band);
	},

	getView: function() {
		return this.view;
	},

	setBand: function(band) {
		this.band = band;
	},

	getBand: function() {
		return this.band;
	},

	showView: function(page,force) {
		//
		// Only change the page if the current view is different from page
		//
		if (!force && this.getView()) {
			//if (this.getView().viewName() == page) return;
		}
		this.showPage(page + ".php");
	},

	showPage: function(page) {
		$("contentsFrame").src = page;
	},

	reloadMain: function() {
		$("contentsFrame").src = $("contentsFrame").src;
	},

	reloadMenu: function() {
		$("menuFrame").src = $("menuFrame").src;
	},

	reloadTop: function() {
		$("topFrame").src = $("topFrame").src;
	},

	reloadAll: function(page) {
		this.reloadMenu();
		this.reloadTop();
		if (page) {
			this.showPage(page);
		} else {
			this.reloadMain();
		}
	},

	debug: function(msg) {
		if (top._top) top._top.debug(msg);
	},

	toString: function() {
		return "Schedule";
	}

};

// --------------------------------------------------
// Constants
// --------------------------------------------------

/*
 * The different types of feeds
 */
TYPES = ["rss","ical","poi","ov2"];

