/* --------------------------------------------------
	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", "gbt10_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");
	logoList[i++] = new makeLogo("Big Chill at the Big House", "bigchill");
	logoList[i++] = new makeLogo("Braylon Edwards Foundation Celebrity Basketball Game", "braylon_edwards");
	logoList[i++] = new makeLogo("Massachusetts", "umass");
	logoList[i++] = new makeLogo("at Indiana (away)", "indiana");
	logoList[i++] = new makeLogo("at Purdue (away)", "purdue");	
	logoList[i++] = new makeLogo("UM vs. Connecticut Commemorative Program", "Mich-Cov-2010_5");	
	logoList[i++] = new makeLogo("Connecticut", "uconn");	
	logoList[i++] = new makeLogo("Saginaw Valley", "svsu");
	logoList[i++] = new makeLogo("USC-Upstate", "uscUpstate");
	logoList[i++] = new makeLogo("Gardner Webb", "gardner-webb");
	logoList[i++] = new makeLogo("Harvard", "harvard");
	logoList[i++] = new makeLogo("Concordia", "concordia");
	logoList[i++] = new makeLogo("N Carolina Central", "nccu");
	logoList[i++] = new makeLogo("Bryant", "Bryant_University");	
	logoList[i++] = new makeLogo("The Big Chill at the Big House Commemorative Game Program", "big_chill2");
	logoList[i++] = new makeLogo("Gator Bowl", "gator-bowl");
	logoList[i++] = new makeLogo("Insight Bowl", "insight-bowl");	
	logoList[i++] = new makeLogo("Kansas", "ku");
	logoList[i++] = new makeLogo("Penn State/Illinois", new Array("penn_state","uiuc"));
	logoList[i++] = new makeLogo("Nebraska/Stanford", new Array("unl2","stanford"));
	logoList[i++] = new makeLogo("Oklahoma", "ou");
	logoList[i++] = new makeLogo("Alabama", "ua");
	logoList[i++] = new makeLogo("Maryland/Kent St/UIC", new Array("umd","kent"));	
	logoList[i++] = new makeLogo("NCAA Women&#39;s Water Polo All Session Ticket", "11_WWP_CHAMP_HOST_VP");
	logoList[i++] = new makeLogo("NCAA Women&#39;s Water Polo Session 1", "11_WWP_CHAMP_HOST_VP");
	logoList[i++] = new makeLogo("NCAA Women&#39;s Water Polo Session 2", "11_WWP_CHAMP_HOST_VP");
	logoList[i++] = new makeLogo("NCAA Women&#39;s Water Polo Session 3", "11_WWP_CHAMP_HOST_VP");
	logoList[i++] = new makeLogo("Mott Spring Game presented by PNC Bank", "mott_spring");
	logoList[i++] = new makeLogo("Nebraska", "unl2");
	logoList[i++] = new makeLogo("Notre Dame Pack", new Array("na","nd"));
	logoList[i++] = new makeLogo("Nebraska Pack", new Array("na","unl2"));
	logoList[i++] = new makeLogo("Ohio State Pack", new Array("na","osu"));
	logoList[i++] = new makeLogo("UM vs. Notre Dame Commemorative Program", "ND-Cover_FINAL");

	logoList[i++] = new makeLogo("I Wore 21: The Legend of Desmond Howard", "desmond_howard");
	
	logoList[i++] = new makeLogo("Wayne State", "wsc");
	logoList[i++] = new makeLogo("Towson", "towson");
	logoList[i++] = new makeLogo("Western Illinois", "wiu");
	logoList[i++] = new makeLogo("Iowa State", "iastate2");
	logoList[i++] = new makeLogo("Arkansas-Pine Bluff", "uapb");
	logoList[i++] = new makeLogo("Alabama A&M", "aamu");
	logoList[i++] = new makeLogo("Bradley", "bradley");
	logoList[i++] = new makeLogo("Northeastern", "northeastern");
	logoList[i++] = new makeLogo("Union College", "union-ny");
	logoList[i++] = new makeLogo("Akron", "uakron");
	
  logoList[i++] = new makeLogo("Wayne State", "wayne");
  
  logoList[i++] = new makeLogo("2012 Football Ticket Interest List", "UMICH_GROUPS_WAITINGLIST");
  
  logoList[i++] = new makeLogo("Florida Atlantic", "FAU2");
  logoList[i++] = new makeLogo("Illinois State", "ilstu");
  logoList[i++] = new makeLogo("Indiana State", "indstate");
  
  logoList[i++] = new makeLogo("Capital One Bowl", "capitalone");
  logoList[i++] = new makeLogo("Fiesta Bowl", "fiesta2");
  logoList[i++] = new makeLogo("Sugar Bowl", "AllstateSugarBowl");
  
  logoList[i++] = new makeLogo("West Virginia", "WVU2");
  
  logoList[i++] = new makeLogo("Cowboys Classic", "2012_Cowboys_Classic");
  
  logoList[i++] = new makeLogo("Bellarmine", "bellarmine");
  logoList[i++] = new makeLogo("Mount St. Mary&#39;s", "msm");
  logoList[i++] = new makeLogo("Delaware", "delaware_GIF");


	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)
				) {
				  if(logoList[i].ologo.constructor.toString().indexOf("Array") > -1 && logoList[i].ologo.length > 1)
				  {
				    for(var k = 0; k < logoList[i].ologo.length; k++)
				    {
				      logo[k] = logoList[i].ologo[k];
            }
          }
          else
          {
            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("UMICH_GROUPS_FOOTBALL"); break;
						case "BB": // baseball
							logo.push("baseball"); break;
						case "SB": // softball
							logo.push("softball"); break;
						case "MB": case "WB": case "B": // basketball
							logo.push("UMICH_GROUPS_BBALL"); break;
						case "V": case "VB": case "MVB": case "WVB": // volleyball
							logo.push("UMICH_GROUPS_VOLLEYBALL"); break;
						case "H": // hockey
							logo.push("UMICH_GROUPS_HOCKEY"); break;
						case "SOC": case "MS": // soccer
							logo.push("UMICH_GROUPS_MSOCCER"); break;
						case "WS": // women's soccer
						  logo.push("UMICH_GROUPS_WSOCCER"); break;
						case "W": // women's soccer
						  logo.push("UMICH_WRESTLING_GROUPIMG"); break;
						case "WG": // women's gymnastics
						  logo.push("UMICH_GROUPS_WGYMNASTICS"); break;
						case "MG": // men's gymnastics
						  logo.push("UMICH_GROUPS_MGYMNASTICS"); 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;
					/* custom code - hide
					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);
	}
	
	function toggleFullSize(thumb) {
		if(thumb.className=="thumbHide") {
			thumb.className = 'thumbShow';
		} else if(thumb.className=="thumbShow") {
			thumb.className = 'thumbHide';
		}
	}
	
	// print smaller logo for calendar
	function printCalLogo(name, group) {
		var imgSrc = printLogo(name, group);
		if(imgSrc!="") {
		imgSrc = imgSrc.replace(/width="60" height="60"/ig, 'width="40" height="40"');
			
			//remove full size code
			imgSrc = imgSrc.replace(/((<a href[^>]+>){1}|(<br>(<([^>]+)>)+ view large(<([^>]+)>)+ click to close(<([^>]+)>)+))/ig, "");
		}
		return(imgSrc);
	}
	
	// print very small logo
	function printSmallLogo(name, group) {
		var imgSrc = printLogo(name, group);
		if(imgSrc!="") {
			imgSrc = imgSrc.replace(/width="60" height="60"/ig, 'width="30" height="30" align="absmiddle"');
			
			//remove full size code
			imgSrc = imgSrc.replace(/((<a href[^>]+>){1}|(<br>(<([^>]+)>)+ view large(<([^>]+)>)+ click to close(<([^>]+)>)+))/ig, "");
		}
		return(imgSrc);
	}
	
