var imgPath = "menu/";
var pExt = ".html";
var over = "_over.gif";
var out = "_out.gif";

var none = "_none.gif";
var top = "_top.gif";
var low = "_low.gif";
var both = "_both.gif";

var OUT = 0;
var OVER = 1;
var ON = 2;

var NONE = 0;
var TOP = 1;
var LOW = 2;
var BOTH = 3;

// object for storing an image switch object
function ImgButton(img) {
	this.name = img;
	this.status = OUT;
	
	this.out = new Image();
	this.out.src = imgPath + img + out;
	this.over = new Image();
	this.over.src = imgPath + img + over;
}

// object for storing an image switch object
function SepImg(img) {
	this.name = img;
	this.status = NONE;
	
	this.none = new Image();
	this.none.src = imgPath + img + none;
    	this.top = new Image();
	this.top.src = imgPath + img + top;
    	this.low = new Image();
	this.low.src = imgPath + img + low;
	this.both = new Image();
	this.both.src = imgPath + img + both;
}

function PicBanner(img, def) {
	this.name = img;
	this.status = NONE;
	this.def = def;

	this.accom = new Image();
	this.accom.src = imgPath + img + "_accom.gif";
	this.book = new Image();
	this.book.src = imgPath + img + "_book.gif";
	this.entert = new Image();
	this.entert.src = imgPath + img + "_entert.gif";
	this.home = new Image();
	this.home.src = imgPath + img + "_home.gif";
	this.loc = new Image();
	this.loc.src = imgPath + img + "_loc.gif";
	this.tours = new Image();
	this.tours.src = imgPath + img + "_tour.gif";
}

ImgButton.prototype.swap = function() {
	if (this.status != ON) {
		docObj = eval('document.' + this.name);
		if (this.status == OVER) {
			docObj.src = this.out.src;
			this.status = OUT;
		}
		else {
			docObj.src = this.over.src;
			this.status = OVER;
		}
	}
}

SepImg.prototype.setState = function(state) {
  docObj = eval('document.' + this.name);
  switch(state) {
    case NONE: docObj.src = this.none.src;
      break;
    case TOP: docObj.src = this.top.src;
      break;
    case LOW: docObj.src = this.low.src;
      break;
    case BOTH: docObj.src = this.both.src;
  }
}

PicBanner.prototype.setState = function(state) {
	docObj = eval('document.' + this.name);
	docObj.src = eval('this.' + state + '.src');
}

ImgButton.prototype.select = function() {
	if (this.status != ON) {
		window.location = this.name + '.html'
	}
}

Array.prototype.loadImgButtons = function() {
	for(i=0; i < arguments.length; i+=2) {
		this[arguments[i]] = new ImgButton(arguments[i]);
		this[arguments[i]].status = arguments[i+1];
	}
}

Array.prototype.loadSepImgs = function() {
	for(i=0; i < arguments.length; i+=2) {
		this[arguments[i]] = new SepImg(arguments[i]);
		this[arguments[i]].status = arguments[i+1];
	}
}

butArr = new Array();
sepArr = new Array();
