/* ==================================================
	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;
//	smapList.push( new makeMap("Nana Mouskouri", "nanaMouskouri.jpg") );

	/* ===== Map list by facility ========== */
	fmapList = new Array;
//	fmapList.push( new makeMap("HUSKY STADIUM", "sample.gif") );

	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 = '<a name="map"></a><img src="'+imageWWWPath+'/maps/'+theMap+'" />';
		}
		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);
	}
