
function map(name,position) { /* Skeleton for the map object */
	this.name=name; // doctoral or masters or what have you
	this.position=position; // the x-position of the map on the big file
	}
/*
bringToFront
Andrew Bain, albain@vcu.edu
October 2006 
*/
function bringToFront(what) {
	document.getElementById("map-overlay").style.backgroundPosition=what.position+"px 0px"; // move the big file into place
	document.getElementById("link-"+activeMap.name).style.display="none"; // hide the old link
	document.getElementById("link-"+what.name).style.display="block"; // bring up the new one
	activeMap=what; // change our placeholder appropriately
	}

// Generate map objects so we have something to work with
mapBlank=new map("blank",7200);
mapAll=new map("all",0);
mapDoctoral=new map("doctoral",5600);
mapMasters=new map("masters",4800);
mapBaccalaureate=new map("baccalaureate",4000);
mapAssociates=new map("associates",3200);
mapLpn=new map("lpn",2400);
mapDiploma=new map("diploma",1600);

var activeMap=mapBlank; // holds value of which map is currently on screen
/*
docStartup
Andrew Bain, albain@vcu.edu
October 2006
*/
function docStartup() { // figure out what we want to show initially
	var startAt=grabFromQueryString("startat"); // function from library.js
	/* We'll get something from the query like "masters," and need to translate 
	   that into the object mapMasters, so I'm gonna smash up the string and
	   put it back together in a format the JS will recognize. */
	if(startAt) { 
		var startAtFirstLetter=startAt.substring(0,1);
		var startAtRestOfString=startAt.substring(1,startAt.length);
		startAtFirstLetter=startAtFirstLetter.toUpperCase();
		var wholeThing="map"+startAtFirstLetter+startAtRestOfString;
		pick(eval(wholeThing));
		}
	else {
		pick(mapAll);
		}
	}

/*
pick
Andrew Bain, albain@vcu.edu
October 2006
*/
function pick(what,whatWasClicked) { // second parameter is way optional and in fact does nothing. haha.
	bringToFront(what);
	if(whatWasClicked&&!(document.all)) { 
		whatWasClicked.blur(); // get rid of the nasty little box around the link
		}
	}
	
window.onload=docStartup;
