/* --------------------------------------------------
	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;
	}

/* --------------------------------------------------
	LOGO LIST
-------------------------------------------------- */
	logoList = new Array;
	var i = 0;
	
//	logoList[i++] = new makeLogo("Florida Int&#39;l", "fiu");

	logoList[i++] = new makeLogo("Home Game 1 vs Jacksonville St.", "jsu");
	logoList[i++] = new makeLogo("Home Game 2 vs. Mississippi St.", "miss_st_");
	logoList[i++] = new makeLogo("Home Game 3 vs. Duke", "duke");
	logoList[i++] = new makeLogo("Home Game 4 vs. Gardner-Webb", "gardner-webb");
	logoList[i++] = new makeLogo("Home Game 5 vs. Virginia", "uva2");
	logoList[i++] = new makeLogo("Home Game 6 vs. Florida State", "fsu");
	logoList[i++] = new makeLogo("Home Game 7 vs. Miami", "miami"); 
	logoList[i++] = new makeLogo("Away Game 1 at Boston College", "bc");
	logoList[i++] = new makeLogo("Away Game 2 at Virginia Tech", "vt");
	logoList[i++] = new makeLogo("Away Game 3 at Clemson", "clemson");
	logoList[i++] = new makeLogo("Away Game 4 at North Carolina", "unc");
	logoList[i++] = new makeLogo("Season Ticket Deposit", "basketball");
	logoList[i++] = new makeLogo("Virginia Tech", "vt");
	logoList[i++] = new makeLogo("Virginia", "uva2");
	logoList[i++] = new makeLogo("Boston College", "bc");
	logoList[i++] = new makeLogo("Maryland", "umd");
	logoList[i++] = new makeLogo("Clemson", "clemson");
	logoList[i++] = new makeLogo("Women's Bball vs. Miss. Valley St.", "mvsu");
	logoList[i++] = new makeLogo("Women's Bball vs. Georgia State", "gsu");
	logoList[i++] = new makeLogo("Women's Bball vs. Michigan St.", "msu");
	logoList[i++] = new makeLogo("Women's BBall vs. Georgia", "uga");
	logoList[i++] = new makeLogo("Women's BBall vs. Florida A&M", "famu");
	logoList[i++] = new makeLogo("Women's Bball vs. Tulane", "tulane");
	logoList[i++] = new makeLogo("Women's Bball vs. Boston College", "bc");
	logoList[i++] = new makeLogo("Women's Bball vs. North Carolina", "unc");
	logoList[i++] = new makeLogo("Women's Bball vs. Miami", "miami");
	logoList[i++] = new makeLogo("Women's Bball vs. Clemson", "clemson");
	logoList[i++] = new makeLogo("Women's BBall vs. NC State", "ncstate");
	logoList[i++] = new makeLogo("Women's Bball vs. Maryland", "umd");
	logoList[i++] = new makeLogo("Women's Bball vs. Virginia", "uva");
	logoList[i++] = new makeLogo("MB vs. Duke", "duke");
	logoList[i++] = new makeLogo("MB vs. Boston College", "bc");
	logoList[i++] = new makeLogo("MB vs. Wake Forest", "wfu");
	logoList[i++] = new makeLogo("MB vs. Maryland", "umd");
	logoList[i++] = new makeLogo("MB vs. NC State", "ncstate");
	logoList[i++] = new makeLogo("MB vs. Clemson", "clemson");
	logoList[i++] = new makeLogo("MB vs. Miami", "miami");
	logoList[i++] = new makeLogo("Jacksonville State", "jsu");
	logoList[i++] = new makeLogo("North Carolina", "unc");
	logoList[i++] = new makeLogo("Wake Forest", "wfu");
	logoList[i++] = new makeLogo("North Carolina State", "ncstate");
	logoList[i++] = new makeLogo("Duke", "duke");
	logoList[i++] = new makeLogo("Miami", "miami");
	logoList[i++] = new makeLogo("Florida State", "fsu");
	logoList[i++] = new makeLogo("Georgia", "uga");
	logoList[i++] = new makeLogo("GT Men's Basketball Poster", "post-mbb");
	logoList[i++] = new makeLogo("GT Football Poster", "post-fb");
	logoList[i++] = new makeLogo("GT Cheerleading Poster", "post-ch");
	logoList[i++] = new makeLogo("GT Women's Basketball Poster", "post-wbb");
	logoList[i++] = new makeLogo("ACC Championship", "accchampionship2");
	logoList[i++] = new makeLogo("2009-10 GT Men's Basketball Poster", "post-mbb");
	logoList[i++] = new makeLogo("2009 GT Football Poster", "post-fb");
	logoList[i++] = new makeLogo("2009-10 GT Cheerleading Poster", "post-ch");
	logoList[i++] = new makeLogo("2009-10 GT Women's Basketball Poster", "post-wbb");
	logoList[i++] = new makeLogo("2010 GT Baseball", "2010gtbaseball");
	logoList[i++] = new makeLogo("2010 GT Softball", "2010gtsoftball");
	logoList[i++] = new makeLogo("Autographed Football", "autographedfootball");
	logoList[i++] = new makeLogo("Autographed Men&#39;s Basketball", "autographedbball");

	logoList[i++] = new makeLogo("South Carolina State", "scsu");
	logoList[i++] = new makeLogo("Middle Tennessee State", "mtsu");
	logoList[i++] = new makeLogo("2010 Football Poster featuring Joshua Nesbitt", "Brace-for-Impact");
	logoList[i++] = new makeLogo("2010 Football Poster featuring ACC Championhip Ring", "ACC-Ring");
	
	logoList[i++] = new makeLogo("2010 Volleyball Poster", "2010-GT-Volleyball-Poster-1");
	logoList[i++] = new makeLogo("2010-11 Cheerleading Poster", "GT-cheer-10");

	logoList[i++] = new makeLogo("South Carolina State - Students", "scsu");
	logoList[i++] = new makeLogo("NC State - Students", "ncstate");
	logoList[i++] = new makeLogo("Virginia - Students", "uva2");
	logoList[i++] = new makeLogo("Middle Tennessee State - Students", "mtsu");
	logoList[i++] = new makeLogo("Miami - Students", "miami");
	logoList[i++] = new makeLogo("Duke - Students", "duke");
	
	logoList[i++] = new makeLogo("Northwestern", "northwestern");
	logoList[i++] = new makeLogo("Georgia State", "gsu");
	logoList[i++] = new makeLogo("Kennesaw State", "kennesaw");
	logoList[i++] = new makeLogo("Prairie View A&M", "Prairie_view2");
	logoList[i++] = new makeLogo("University of Connecticut", "uconn");
	logoList[i++] = new makeLogo("University of Georgia", "uga");
	logoList[i++] = new makeLogo("Mercer", "mercer");
	logoList[i++] = new makeLogo("Tennessee State", "tnstate");
	logoList[i++] = new makeLogo("NC State", "ncstate");
	
	logoList[i++] = new makeLogo("UGA - Student Lottery", "uga");
	
	logoList[i++] = new makeLogo("Chick-fil-a Bowl $80 (No Limit)", "Chick-fil-a-Bowl");
	logoList[i++] = new makeLogo("Advocare V100 Independence Bowl $45 (No Limit)", "Independance-Bowl");
	logoList[i++] = new makeLogo("The Military Bowl Presented by Northrup Grumman $65 (No Limit)", "MilitaryBowllogo");
	logoList[i++] = new makeLogo("Hyundai Sun Bowl $60 Premium (No Limit)", "Sun-Bowl");
	logoList[i++] = new makeLogo("Hyundai Sun Bowl $50 Preferred (No Limit)", "Sun-Bowl");
	logoList[i++] = new makeLogo("Hyundai Sun Bowl $40 Stadium (No Limit)", "Sun-Bowl");
	
	logoList[i++] = new makeLogo("Independence Bowl", "Independance-Bowl");
	logoList[i++] = new makeLogo("Advocare V100 Independence Bowl - DONATE TICKETS TO A CHARITY, DISADVANTAGED YOUTH OR MILITARY PERSONNEL", "Independance-Bowl");
	logoList[i++] = new makeLogo("Military Bowl presented by Northrop Grumman", "militarybowllogo");
	logoList[i++] = new makeLogo("Military Bowl - DONATE TICKETS TO A CHARITY, DISADVANTAGED YOUTH OR MILITARY PERSONNEL", "militarybowllogo");
	logoList[i++] = new makeLogo("Kraft Fight Hunger Bowl", "kraft_fight_hunger_bowl");
	logoList[i++] = new makeLogo("Kraft Fight Hunger Bowl - DONATE TICKETS TO A CHARITY, DISADVANTAGED YOUTH OR MILITARY PERSONNEL", "kraft_fight_hunger_bowl");
	logoList[i++] = new makeLogo("CLICK HERE to donate tickets to a charity, disadvantaged youth or military personnel.", "Independance-Bowl");
  
  logoList[i++] = new makeLogo("East Tennessee State", "etsu");
  logoList[i++] = new makeLogo("Georgia Southern", "gasou");
  logoList[i++] = new makeLogo("Kent State", "kent");
  logoList[i++] = new makeLogo("Rutgers", "rutgers2");
  logoList[i++] = new makeLogo("Savannah State", "savstate");
  logoList[i++] = new makeLogo("St. John&#39;s", "stjohns");
  
  logoList[i++] = new makeLogo("Kansas", "ku");
  logoList[i++] = new makeLogo("Maryland", "umd");
  logoList[i++] = new makeLogo("Western Carolina", "western_carolina");	
  logoList[i++] = new makeLogo("REQUEST for extra Georgia tickets", "uga");
  
  logoList[i++] = new makeLogo("Men&#39;s Basketball Season Tickets", "PA");
  logoList[i++] = new makeLogo("Gwinnett Buzz Book", "GC");
  logoList[i++] = new makeLogo("Florida A&M", "famu");
  logoList[i++] = new makeLogo("Delaware State", "dsc");
  logoList[i++] = new makeLogo("Siena", "siena");
  logoList[i++] = new makeLogo("Alabama A&M", "aamu");
  
  logoList[i++] = new makeLogo("Western Carolina STUDENT", "western_carolina");
  logoList[i++] = new makeLogo("Kansas STUDENT", "ku");
  logoList[i++] = new makeLogo("North Carolina STUDENT", "unc2");
  logoList[i++] = new makeLogo("Maryland STUDENT", "umd");
  logoList[i++] = new makeLogo("Clemson STUDENT", "clemson");
  logoList[i++] = new makeLogo("Virginia Tech STUDENT", "vt");
  logoList[i++] = new makeLogo("Georgia STUDENT", "uga");
  
  logoList[i++] = new makeLogo("2011 Football Poster", "11 Football Poster");
  
  logoList[i++] = new makeLogo("2011-12 Cheerleading Poster", "cheer");
	
	logoList[i++] = new makeLogo("Alabama State", "alasu");
	logoList[i++] = new makeLogo("Old Dominion", "odu");
	logoList[i++] = new makeLogo("North Carolina A&T", "ncat");
	logoList[i++] = new makeLogo("Nebraska", "unl2");
	logoList[i++] = new makeLogo("Clemson (This game will be played at Forbes Arena on the campus of Morehouse College)", "clemson");

	logoList[i++] = new makeLogo("2011-12 Women&#39;s Basketball Poster", "womens_bball_poster");
	logoList[i++] = new makeLogo("2011-12 Men&#39;s Basketball Poster", "mens_bball_poster");
	
	logoList[i++] = new makeLogo("Discover Orange Bowl", "orange_bowl");
	logoList[i++] = new makeLogo("Champs Sports Bowl", "ChampsSportsBowl");
	logoList[i++] = new makeLogo("Hyundai Sun Bowl", "sun_bowl");
	logoList[i++] = new makeLogo("Belk Bowl", "BelkBowl");
	logoList[i++] = new makeLogo("Franklin American Mortgage Music City Bowl", "music_city_bowl");
	logoList[i++] = new makeLogo("Advocare V100 Independence Bowl", "IndependenceBowl");
	logoList[i++] = new makeLogo("Military Bowl Presented by Northrup Grumman", "militarybowllogo");
	logoList[i++] = new makeLogo("ACC Football Championship Game", "acclogo");

	logoList[i++] = new makeLogo("Alabama", "ua");
	
	logoList[i++] = new makeLogo("Donate a Ticket to Fort Bliss", "sun_bowl");
	
	logoList[i++] = new makeLogo("Ohio State", "osu");
	logoList[i++] = new makeLogo("Wagner", "wagner2");
	logoList[i++] = new makeLogo("Charlotte", "uncc");


/* --------------------------------------------------
	EXTRA LIST
-------------------------------------------------- */
	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) {
		// custom code
			var str = name
			if (str.match("CHICK-FIL-A BOWL")) {
				logo[0] = "chickfila-bowl";
			} else if(name.indexOf("xxxxx") > -1) {
				logo[0] = "xxxxx";
			}
		// end custom code
		}	

		if(logo.length==0) {
			if(typeof(fullGroupList)!="undefined" && group!="") {
				while(logo.length==0 && group!="") {
					switch(group) {
						case "F": case "FBS": case "FBI": case "SD": // football
  						logo.push("football"); break;
  					case "BB": case "BS": // baseball
  						logo.push("baseball"); break;
  					case "SB": // softball
  						logo.push("softball"); break;
  					case "MB": case "MBS": case "MBI":  // basketball
  						logo.push("bball"); break;
  					case "WB": case "WBS": case "WBI":  // basketball
  						logo.push("wbball"); 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 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": case "SD": // football
						logo.push("football"); break;
					case "BB": case "BS": // baseball
						logo.push("baseball"); break;
					case "SB": // softball
						logo.push("softball"); break;
					case "MB": case "MBS": case "MBI":  // basketball
						logo.push("bball"); break;
					case "WB": case "WBS": case "WBI":  // basketball
						logo.push("wbball"); 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);
	}
	
	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);
	}
	
