/* --------------------------------------------------
	Author:		Donna Latto
	Email:		dlatto@paciolan.com
	Created:	March 6, 2007
	Purpose:	Functions to create and print logos. 
				Used primarily on:
				- displaySimpleEventList
				- displayGroupList 
	Version Notes:
				3/29/07 - Added printStaticThumb 
				function to add clickable static 
				map thumbnails in places such as 
				cartdisplay.
				
				4/4/07 - Fixed formatting of 
				clickable thumbnail (in cartdisplay).
				
				8/30/07 - printStaticThumb -> printStaticLink
				to eliminate trouble of creating
				thumbnails.
-------------------------------------------------- */

	function makeMap(desc, mapfile) {
		this.desc = desc;
		this.mapfile = mapfile;
	}

	/* ----- Map list by event ---------- */
	smapList = new Array;
	var smli = 0;
//	smapList[smli++] = new makeMap("Nana Mouskouri", "nanaMouskouri.jpg");
//	smapList[smli++] = new makeMap("Allen Theatre", "AllenTheatre.gif");
//	smapList[smli++] = new makeMap("Ohio Theatre", "OhioTheatre.gif");
//	smapList[smli++] = new makeMap("Palace Theatre", "PalaceTheatre.gif");
//	smapList[smli++] = new makeMap("State Theatre", "StateTheatre.gif");
//	smapList[smli++] = new makeMap("Hanna Theatre", "hannaTheatre.gif");

	/* ----- Map list by facility ---------- */
	fmapList = new Array;
	var fmli = 0;
//	fmapList[fmli++] = new makeMap("HUSKY STADIUM", "sample.gif");
	/*
	fmapList[fmli++] = new makeMap("Allen Theatre", "AllenTheatre.gif");
	fmapList[fmli++] = new makeMap("Ohio Theatre", "OhioTheatre.gif");
	fmapList[fmli++] = new makeMap("Palace Theatre", "PalaceTheatre.gif");
	fmapList[fmli++] = new makeMap("State Theatre", "StateTheatre.gif");
	fmapList[fmli++] = new makeMap("Hanna Theatre", "hannaTheatre.gif");
	*/

	fmapList[fmli++] = new makeMap("14th Street Theatre", "tupperware_party.gif");

	fmapList = smapList;

	function getStaticMap(desc, fac) {
		var theMap = "";
		
		if(typeof(desc)!="undefined" && theMap=="") {
			for(var a=0; a<smapList.length; a++) {
				if(typeof(smapList[a].desc)=="string") {
					smapList[a].desc = [smapList[a].desc];
				}
				if(inArray(desc, smapList[a].desc)) {
					theMap = smapList[a].mapfile;
					break;
				}
			}
		}
		
		if(typeof(fac)!="undefined" && theMap=="") {
			for(var a=0; a<fmapList.length; a++) {
				if(fmapList[a].desc.toUpperCase()==fac.toUpperCase()) {
					theMap = fmapList[a].mapfile;
					break;
				}
			}
		}
		
		return theMap;
	}

	function printStaticMap(desc, fac) {
		var theMap = getStaticMap(desc, fac);
		var smapSrc = "";
		if(theMap!="") {
			smapSrc = '<p title="'+ desc +'">&nbsp;</p><a name="map"></a><p align="center"><img src="'+imageWWWPath+'/maps/'+theMap+'" border="0"></p><p>&nbsp;</p>';
		}
		return(smapSrc);
	}
	
	function printStaticLink(desc, fac) {
		var theMap = getStaticMap(desc, fac);
		var smapSrc = fac;
		if(theMap != "") {
			smapSrc = '<a href="javascript:showBox(\''+imageWWWPath+'/maps/'+theMap+'\', \'evenue\', 640, 480)">'+fac+'</a>';
		}
		return(smapSrc);
	}

	function printStaticLinkThumb(desc, fac) {
		var theMap = getStaticMap(desc, fac);
		var smapSrc = "";
		if(theMap != "") {
			var mapThumb = theMap.replace(/\./, "_thumb.");
			smapContent = '<div align="center"><img src="'+imageWWWPath+'/maps/'+theMap+'" /></div>'
			smapSrc = '<a href="javascript:showBox(\''+ escape(smapContent) +'\', \'\', 650, 450);" class="small" style="text-decoration: none;">'+
				'<img src="'+imageWWWPath+'/maps/'+mapThumb+'" />'+
				'<br>Click Here for a Larger Image'+
				'</a>';
		}
		return(smapSrc);
	}
