// BUTTON OBJECT PROTOTYPE AND INSTANCES
//---------------------------------------------------------------------------------------

/* NavButton is an object with a few properties and a few methods defined for it. */

function NavButton(pId, pButton, pAction, pExt)
{
this.id = pId;
this.buttonName = pButton;
this.action = pAction;
this.extension = pExt;
}

var manCycle = new NavButton("littleMan", "littleMan", "mainCycle", ".jpg");
var snowCycle = new NavButton("subCycleButton", "snowButton", "subCycle", ".jpg");
var walkCycle = new NavButton("walkMe", "walkMe", "mainCycle", ".jpg");
var homeEye = new NavButton("home", "home", "changePage", ".jpg");
var contactEye = new NavButton("contact", "contact", "changePage", ".jpg");
var bioEye = new NavButton("bio", "bio", "changePage", ".jpg");
var digitalEye = new NavButton("digital", "digital", "changePage", ".jpg");
var penInkEye = new NavButton("penInk", "digital", "changePage", ".jpg");
var kidsEye = new NavButton("kids", "kids", "changePage", ".jpg");
var lightPortEye = new NavButton("lightPort", "lightPort", "changePage", ".jpg");
var darkPortEye = new NavButton("darkPort", "darkPort", "changePage", ".jpg");
var darkTog = new NavButton("toggleButton", "darkToggle", "togglePage", ".jpg");
var lightTog = new NavButton("toggleButton", "lightToggle", "togglePage", ".jpg");
var dontLick = new NavButton("dontLick", "dontLick", "mainCycle", ".jpg");
var newEye = new NavButton("whatsnew", "whatsNewEye", "changePage", ".jpg");
var whatsNew = new NavButton("whatsNewBig", "whatsNew", "changePage", ".jpg");
var whatsNewHome = new NavButton("whatsNewFlashHome", "whatsNewWWHome", "changePage", ".gif");
var activities = new NavButton("activities", "activities", "changePage", ".png");

//Methods:

NavButton.prototype.switchButton = switchButton;


//---------------------------------------------------------------------------------------


function switchButton(imageState){
var imageFolderAndFile = "../../media/navButtons/" + 	this.buttonName;
	if(G_pageName == this.id)
	{
document.getElementById(this.id).src = imageFolderAndFile + "On.jpg";	}
	else
	{
document.getElementById(this.id).src = imageFolderAndFile + imageState + ".jpg";
	}
}

//---------------------------------------------------------------------------------------
