/* --------------------------------------------------
	Created:	March 6, 2007
	Purpose:	Functions to create and print logos. 
				Used primarily on:
				- displaySimpleEventList
				- displayGroupList 
-------------------------------------------------- */

	function makeLogo(name, logo) {
		this.oname = name;
		this.ologo = logo;
	}

	logoList = new Array;
	var i = 0;
	
//	logoList[i++] = new makeLogo("Florida Int&#39;l", "fiu");
	logoList[i++] = new makeLogo("Alaska Fairbanks", "uaf");
	logoList[i++] = new makeLogo("Alaska-Fairbanks", "uaf");
	logoList[i++] = new makeLogo("Boston University", "bu");
	logoList[i++] = new makeLogo("Ball State", "bsu");
	logoList[i++] = new makeLogo("Bowling Green", "bgsu");
	logoList[i++] = new makeLogo("Cal", "berkeley");
	logoList[i++] = new makeLogo("Central Michigan", "cmich");
	logoList[i++] = new makeLogo("Charleston Southern", "csuniv");
	logoList[i++] = new makeLogo("Delaware State", "dsc");
	logoList[i++] = new makeLogo("Eastern Michigan", "emich");
	logoList[i++] = new makeLogo("Ferris State", "ferris");
	logoList[i++] = new makeLogo("High Point", "highpoint");
	logoList[i++] = new makeLogo("Houston", "uh");
	logoList[i++] = new makeLogo("Illinois", "uiuc");
	logoList[i++] = new makeLogo("Indiana", "indiana");
	logoList[i++] = new makeLogo("Iowa", "uiowa");
	logoList[i++] = new makeLogo("IUPUI", "iupui");
	logoList[i++] = new makeLogo("Lake Superior State", "lssu");
	logoList[i++] = new makeLogo("Lake Superior", "lssu");
	logoList[i++] = new makeLogo("Mercyhurst", "mercyhurst");
	logoList[i++] = new makeLogo("Merrimack", "merrimack");
	logoList[i++] = new makeLogo("Miami OH", "muohio");
	logoList[i++] = new makeLogo("Miami", "muohio");
	logoList[i++] = new makeLogo("Michigan - Ohio State 100th Game Program", "mich-osu-100thgame");
	logoList[i++] = new makeLogo("Michigan Game Day Traditions", "TS");
	logoList[i++] = new makeLogo("Michigan State", "msu");
	logoList[i++] = new makeLogo("Michigan Tech", "mtu");
	logoList[i++] = new makeLogo("Midwest Regional", "ncaa-hockey");
	logoList[i++] = new makeLogo("Minnesota", "umn");
	logoList[i++] = new makeLogo("NC State", "ncstate");
	logoList[i++] = new makeLogo("Nebraska-Omaha", "unomaha");
	logoList[i++] = new makeLogo("Niagara", "niagara");
	logoList[i++] = new makeLogo("Northern Michigan", "nmu");
	logoList[i++] = new makeLogo("Northwestern", "northwestern");
	logoList[i++] = new makeLogo("Notre Dame", "nd");
	logoList[i++] = new makeLogo("Oakland", "oakland");
	logoList[i++] = new makeLogo("Ohio State", "osu");
	logoList[i++] = new makeLogo("Oregon State", "oregonstate");
	logoList[i++] = new makeLogo("Oregon", "uoregon");
	logoList[i++] = new makeLogo("Outback Bowl", "bowl-outback");
	logoList[i++] = new makeLogo("Penn State", "psu");
	logoList[i++] = new makeLogo("Purdue", "purdue");
	logoList[i++] = new makeLogo("Quinnipiac", "quinnipiac");
	logoList[i++] = new makeLogo("San Diego State", "sdsu");
	logoList[i++] = new makeLogo("San Francisco", "usfca");
	logoList[i++] = new makeLogo("Souvenir Ticket Sheet", "TS03");
	logoList[i++] = new makeLogo("UCLA", "ucla");
	logoList[i++] = new makeLogo("US NDTP", "hockey");
	logoList[i++] = new makeLogo("USC", "usc");
	logoList[i++] = new makeLogo("Vanderbilt", "vanderbilt");
	logoList[i++] = new makeLogo("Washington", "washington");
	logoList[i++] = new makeLogo("Western Michigan", "wmich");
	logoList[i++] = new makeLogo("Wisconsin", "wisc");
	logoList[i++] = new makeLogo("York", "york");
	logoList[i++] = new makeLogo("New Hampshire", "unh");
	logoList[i++] = new makeLogo("St Lawrence", "stlawrence");
	logoList[i++] = new makeLogo("Rose Bowl", "rosebowl");
	logoList[i++] = new makeLogo("Pharmacy Homecoming/Lecture - click here", "pharmacy");
	logoList[i++] = new makeLogo("Homecoming - click here to order", "homecoming");
	logoList[i++] = new makeLogo("Grand Valley State", "gvsu");
	logoList[i++] = new makeLogo("Butler", "butler");
	logoList[i++] = new makeLogo("Miami, FL", "miami");
	logoList[i++] = new makeLogo("Miami, OH", "muohio");
	logoList[i++] = new makeLogo("Coppin State", "coppin");
	logoList[i++] = new makeLogo("Chicago State", "csu");
	logoList[i++] = new makeLogo("University of Minnesota", "umn");
	logoList[i++] = new makeLogo("University of Nebraska-Omaha", "unomaha");
	logoList[i++] = new makeLogo("University of Fairbanks Alaska", "uaf");
	logoList[i++] = new makeLogo("Bowling Green State University", "bgsu");
	logoList[i++] = new makeLogo("Western Michigan University", "wmich");
	logoList[i++] = new makeLogo("Ohio State University", "osu");
	logoList[i++] = new makeLogo("Lake Superior State University", "lssu");
	logoList[i++] = new makeLogo("Ferris State University", "ferris");
	logoList[i++] = new makeLogo("Outback Bowl", "outback_bowl");
	logoList[i++] = new makeLogo("Alamo Bowl", "alamo_bowl");
	logoList[i++] = new makeLogo("Sun Bowl", "sun_bowl");
	logoList[i++] = new makeLogo("Pharmacy Homecoming/Science Symposium", "pharmacy_homecoming");
	logoList[i++] = new makeLogo("Go Blue Tailgate", "goblue-30logo");
	logoList[i++] = new makeLogo("Pharmacy Homecoming Events", "pharmacy_homecoming");	
	logoList[i++] = new makeLogo("Appalachian State", "appstate");
	logoList[i++] = new makeLogo("University of Alaska-Fairbanks", "uaf");
	logoList[i++] = new makeLogo("University of Wisconsin", "wisc");
	logoList[i++] = new makeLogo("University of Notre Dame", "nd");
	logoList[i++] = new makeLogo("Northern Michigan University", "nmu");
	logoList[i++] = new makeLogo("Go Blue Tailgate", "tailgate");
	logoList[i++] = new makeLogo("Utah", "utah");
	logoList[i++] = new makeLogo("Toledo", "utoledo");
	logoList[i++] = new makeLogo("at Purdue Tailgate", "purdue");
	logoList[i++] = new makeLogo("at Minn Tailgate", "umn");
	logoList[i++] = new makeLogo("Pharmacy Homecoming Events", "pharmacy_homecoming");
	logoList[i++] = new makeLogo("Niagara University", "niagara");
	logoList[i++] = new makeLogo("Miami University", "miami");
	logoList[i++] = new makeLogo("Bowling Green University", "bgsu");
	logoList[i++] = new makeLogo("Norfolk State", "nsu");
	logoList[i++] = new makeLogo("Savannah State", "savstate");
	logoList[i++] = new makeLogo("Duke", "duke");
	logoList[i++] = new makeLogo("Florida Gulf Coast", "floridaGulfCoast");
	logoList[i++] = new makeLogo("North Carolina Central", "nccu");
	logoList[i++] = new makeLogo("Miami University", "muohio");
	logoList[i++] = new makeLogo("Pharmacy Homecoming", "pharmacy_homecoming");

	logoList[i++] = new makeLogo("Houston Baptist", "houstonbaptist");
	logoList[i++] = new makeLogo("Boston College", "bc");
	logoList[i++] = new makeLogo("Arkansas Pine-Bluff", "uapb");
	logoList[i++] = new makeLogo("Univ. of Detroit", "udetroit");


	extraList = new Array;
	var i = 0;
	
	extraList[i++] = "";
	extraList[i++] = "The ";
	extraList[i++] = "THE ";
	extraList[i++] = "at ";
	extraList[i++] = "@ ";
	extraList[i++] = "<center>";
	extraList[i++] = "<center>at ";
	extraList[i++] = "vs ";
	extraList[i++] = "vs. ";
	extraList[i++] = "<a>";
	extraList[i++] = "</a>";
	extraList[i++] = " FAMILY 4 PACK";
	extraList[i++] = " - Family Four Packs";
	extraList[i++] = " - Group Tickets";
	
	// NEW (accomodates more than one logo)
	function printLogo(name, group) {
		var logo = new Array();
		name = stripHTML(name.toUpperCase());
		
		while(name.indexOf("  ")>-1) {
			name = name.replace(/  /g, " ");
		}

		for(var i=0; i < logoList.length; i++) {
			var listName = logoList[i].oname.toUpperCase();
			listName = listName.replace(/'/,"&#39;"); // fix apostrophes
			for(var j=0; j < extraList.length; j++) {
				var listExtra = extraList[j].toUpperCase();
				if(
					(listName + listExtra == name || listExtra + listName == name) && 
					!(logo.length>0 && logo[logo.length-1]==logoList[i].ologo)
				) {
					//logo.push(logoList[i].ologo);
					logo[0] = logoList[i].ologo;
				}
			}
		}

		if(logo.length==0) {
			if(typeof(fullGroupList)!="undefined" && group!="") {
				while(logo.length==0 && group!="") {
					switch(group) {
						case "F": case "FB": // football
							logo.push("football"); break;
						case "BB": // baseball
							logo.push("baseball"); break;
						case "SB": // softball
							logo.push("softball"); break;
						case "MB": case "WB": // basketball
							logo.push("basketball"); break;
						case "VB": case "MVB": case "WVB": // volleyball
							logo.push("volleyball"); break;
						case "H": // hockey
							logo.push("hockey"); break;
						case "SOC": case "MS": case "WS": // soccer
							logo.push("soccer"); break;
					}
					var parent = "";
					for(var i=0; i<fullGroupList.length; i++) {
						if(fullGroupList[i].code==group) {
							parent = fullGroupList[i].parent;
						}
					}
					group = parent;
				}
				if(logo.length==0) logo.push("na"); // default
			} else {
				switch(group) {
					case "F": case "FBS": case "FBI": // football
						logo.push("football"); break;
					case "BB": // baseball
						logo.push("baseball"); break;
					case "SB": // softball
						logo.push("softball"); break;
					case "MB": case "MBS": case "MBI":  // basketball
						logo.push("basketball"); break;
					case "WB": case "WBS": case "WBI":  // basketball
						logo.push("basketball"); break;
					case "VB": case "MVB": case "WVB": // volleyball
						logo.push("volleyball"); break;
					case "H": // hockey
						logo.push("hockey"); break;
					case "SOC": case "MS": case "WS": // soccer
						logo.push("soccer"); break;
					default: // not avail
						logo.push("na"); break;
				}
			}
		}
		var imgSrc = "";

		if(logo.length>0) {
			for(var k=0; k<logo.length; k++) {
				imgSrc += '<img src="'+imageWWWPath+'/logos/'+logo[k]+'.gif" border="0" width="60" height="60" alt="'+name+'">';
			}
		}
		return(imgSrc);
	}
	
	// print smaller logo for calendar
	function printCalLogo(name, group) {
		var imgSrc = printLogo(name, group);
		imgSrc = imgSrc.replace(/width="60" height="60"/ig, 'width="40" height="40"');
		return(imgSrc);
	}