/* --------------------------------------------------
	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("T07:TOUR:TOUR", "chaseFieldPhoto.jpg");
	
	/* ----- Map list by facility ---------- */
	fmapList = new Array;
	var fmli = 0;
//	fmapList[fmli++] = new makeMap("HUSKY STADIUM", "sample.gif");

	function printStaticMap(desc) {
		var theMap = "";
		var smapSrc = "";
		
		for(var a=0; a<smapList.length; a++) {
			if(desc.toUpperCase()==smapList[a].desc.toUpperCase()) {
				theMap = smapList[a].mapfile;
			}
		}
		if(desc=="SOC10:BP:SOC")theMap = "chivasMap.gif";// custom code (default map for 10stp)						
		if(desc=="WMT")theMap = "WM-Stage.gif";// 	Jewel with special guest Colbie Caillat								
		if(desc=="ADA")theMap = "ada_2011.jpg";// 	ADA seating
		if(desc=="12:FF:FF") theMap = "diDinner.gif"; // custom code 
		if(desc=="CT12:BP:BP") theMap = "LHSM.gif"; // custom code 		
		if(desc.indexOf("TOUR")>-1)theMap = "maptour.jpg"; // custom code (default map for all tours)		
		if(desc=="12:PK:PK") theMap = "parking2012.gif";// 	parking
				
		if(theMap=="") theMap = "2012MS.gif"; // custom code 

		if(theMap != "") {
			// mlb code below (add link to larger view of map)
			var theMapLarge = theMap.slice(0, theMap.indexOf(".")) + '_large' + theMap.slice(theMap.indexOf("."), theMap.length);

			if (desc.indexOf("TOUR")>-1) {
				smapSrc = '<p align="center"><img src="'+imageWWWPath+'/maps/'+theMap+'" border="0"></p>' +
					'<p align="center"><b><a href="javascript:popBox(\''+ imageWWWPath +'/maps/'+theMapLarge+'\', \'map\', 850, 820);">Click here to see a larger image</a><br>'
			}else{
				smapSrc = '<p align="center"><img src="'+imageWWWPath+'/maps/'+theMap+'" border="0"></p>' +
					'<p align="center"><b><a href="javascript:popBox(\''+ imageWWWPath +'/maps/'+theMapLarge+'\', \'map\', 850, 820);">Click here to see a larger image</a><br>' +			
				    // custom code : hide the link to interact map
					//'<br><a href=http://sandiego.padres.mlb.com/sd/ticketing/seating_pricing.jsp target=_blank>Click here to view the Padres Interactive<br>Seat Map in a new window.</a></b></p>'
					''
			}


		}
		return(smapSrc);
	}
	
	function printStaticLink(desc, fac) {
		var theMap = "";
		var smapSrc = fac;
		
		for(var a=0; a<smapList.length; a++) {
			if(desc.toUpperCase()==smapList[a].desc.toUpperCase()) {
				theMap = smapList[a].mapfile;
			}
		}
		
		for(var a=0; a<fmapList.length; a++) {
			if(fac.toUpperCase()==fmapList[a].desc.toUpperCase()) {
				theMap = fmapList[a].mapfile;
			}
		}

		if(theMap != "") {
			smapSrc = '<a href="javascript:popBox(\''+imageWWWPath+'/maps/'+theMap+'\', \'evenue\', 640, 480)">'+fac+'</a>';
		}
		return(smapSrc);
	}
	
	// mlb code below
	function printThumbLink(desc) {
		var theMap = "";
		var smapSrc = "";
		
		for(var a=0; a<smapList.length; a++) {
			if(desc.toUpperCase()==smapList[a].desc.toUpperCase()) {
				theMap = smapList[a].mapfile;
			}
		}

		if(desc.indexOf("TOUR")>-1)theMap = "maptour.jpg"; // custom code (default map for all tours)
		if(desc=="SOC10:BP:SOC")theMap = "chivasMap.gif";// custom code (default map for 10stp)						
		if(desc=="WMT")theMap = "WM-Stage.gif";// 	Jewel with special guest Colbie Caillat								

		if(desc=="ADA")theMap = "ada_2011.jpg";// 	ADA seating
		if(desc=="12:FF:FF") theMap = "diDinner.gif"; // custom code 
		if(desc=="CT12:BP:BP") theMap = "LHSM.gif"; // custom code 		
		if(desc=="12:PK:PK") theMap = "parking2012.gif";// 	parking		
		
					
		if(theMap=="") theMap = "2012MS.gif"; // custom code (dbacks default map)

		if(theMap != "") {
			// mlb code below (add link to larger view of map)
			var theMapLarge = theMap.slice(0, theMap.indexOf(".")) + '_large' + theMap.slice(theMap.indexOf("."), theMap.length);
			var theMapThumb = theMap.slice(0, theMap.indexOf(".")) + '_thumb' + theMap.slice(theMap.indexOf("."), theMap.length);
			smapSrc = '<table border="0" cellpadding="5" cellspacing="0"><tr><td align="center"><a href="javascript:popBox(\''+ imageWWWPath +'/maps/'+theMapLarge+'\', \'map\', 850, 700);"><img src="'+imageWWWPath+'/maps/'+theMapThumb+'" width="100" border="0"><br><small>click for larger image</small></a></td></tr></table>'
		}
		return(smapSrc);
	}
