/* --------------------------------------------------
	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("Appalachian State", "appstate");
	logoList[i++] = new makeLogo("Army", "usma");
	logoList[i++] = new makeLogo("Campbell", "campbell");
	logoList[i++] = new makeLogo("Charleston Southern", "csuniv");
	logoList[i++] = new makeLogo("Charlotte", "uncc");
	logoList[i++] = new makeLogo("Cincinnati", "uc");
	logoList[i++] = new makeLogo("Coastal Carolina", "coastal");
	logoList[i++] = new makeLogo("Delaware", "udel");
	logoList[i++] = new makeLogo("Depaul", "depaul");
	logoList[i++] = new makeLogo("Duke", "duke");
	logoList[i++] = new makeLogo("Fall Music Festival", "wrns");
	logoList[i++] = new makeLogo("Gardner-Webb", "gardner-webb");
	logoList[i++] = new makeLogo("George Mason", "gmu");
	logoList[i++] = new makeLogo("Hampton University", "hamptonu");
	logoList[i++] = new makeLogo("Houston", "uh");
	logoList[i++] = new makeLogo("Louisville", "louisville");
	logoList[i++] = new makeLogo("Marquette", "marquette");
	logoList[i++] = new makeLogo("Marshall", "marshall");
	logoList[i++] = new makeLogo("Memphis", "memphis");
	logoList[i++] = new makeLogo("Miami", "miami");
	logoList[i++] = new makeLogo("Mount Olive", "moc");
	logoList[i++] = new makeLogo("NC A & T", "ncat");
	logoList[i++] = new makeLogo("North Carolina A & T", "ncat");
	logoList[i++] = new makeLogo("North Carolina A&T", "ncat");
	logoList[i++] = new makeLogo("North Carolina", "unc");
	logoList[i++] = new makeLogo("Pirate Package 1", "pp1");
	logoList[i++] = new makeLogo("Pirate Package 2", "pp2");
	logoList[i++] = new makeLogo("Pirate Package 3", "pp3");
	logoList[i++] = new makeLogo("Radford University", "runet");
	logoList[i++] = new makeLogo("Saint Louis", "slu");
	logoList[i++] = new makeLogo("Savannah State", "savstate");
	logoList[i++] = new makeLogo("South Florida", "usf");
	logoList[i++] = new makeLogo("Southern Miss", "usm");
	logoList[i++] = new makeLogo("Southern Mississippi", "usm");
	logoList[i++] = new makeLogo("TCU", "tcu");
	logoList[i++] = new makeLogo("Texas Christian", "tcu");
	logoList[i++] = new makeLogo("Tulane", "tulane");
	logoList[i++] = new makeLogo("UAB", "uab");
	logoList[i++] = new makeLogo("UNC-Charlotte", "uncc");
	logoList[i++] = new makeLogo("UNC Pembroke", "uncp");
	logoList[i++] = new makeLogo("UNC-Pembroke", "uncp");
	logoList[i++] = new makeLogo("UNC Wilmington", "uncwil");
	logoList[i++] = new makeLogo("UNC-Wilmington", "uncwil");
	logoList[i++] = new makeLogo("Wake Forest", "wfu");
	logoList[i++] = new makeLogo("West Virginia University", "wvu");
	logoList[i++] = new makeLogo("Wrestling", "wwe");
	logoList[i++] = new makeLogo("NC STATE vs. ECU", "ncstate");
	logoList[i++] = new makeLogo("Men&#39;s Basketball Season Tickets", "ecu");
	logoList[i++] = new makeLogo("West Virginia", "wvu");
	logoList[i++] = new makeLogo("Tulsa", "utulsa");
	logoList[i++] = new makeLogo("SMU", "smu");
	logoList[i++] = new makeLogo("P06 Subscriptions", "na");
	logoList[i++] = new makeLogo("Pajama Game", "na");
	logoList[i++] = new makeLogo("The Importance of Being Earnest", "na");
	logoList[i++] = new makeLogo("Dance 2006", "na");
	logoList[i++] = new makeLogo("Godspell", "na");
	logoList[i++] = new makeLogo("The Time of Your Life", "na");
	logoList[i++] = new makeLogo("Limestone", "limestone");
	logoList[i++] = new makeLogo("St. Paul#&39;s", "stpauls");
	logoList[i++] = new makeLogo("UNC Greensboro", "uncg");
	logoList[i++] = new makeLogo("Western Carolina", "wcarolina");
	logoList[i++] = new makeLogo("Wofford", "wofford");
	logoList[i++] = new makeLogo("UCF", "ucf3");
	logoList[i++] = new makeLogo("Virginia", "virginia");
	logoList[i++] = new makeLogo("2006 PAPAJOHNS.COM BOWL TICKETS", "papa-johns");
	logoList[i++] = new makeLogo("PAPAJOHNS.COM BOWL", "papa-johns");
	logoList[i++] = new makeLogo("<B>2006 PAPAJOHNS.COM BOWL TICKETS</B>", "papa-johns");
	logoList[i++] = new makeLogo("Chowan University", "chowan");
	logoList[i++] = new makeLogo("Rice", "rice");
	logoList[i++] = new makeLogo("USM", "usm");
	logoList[i++] = new makeLogo("UTEP", "utep");
	logoList[i++] = new makeLogo("Liberty", "liberty");
	logoList[i++] = new makeLogo("ECU Invitational (Feb. 23rd-25th)", "ecuInvitational");
	logoList[i++] = new makeLogo("Keith LeClair Classic (March 2nd-4th)", "leClairClassic");
	logoList[i++] = new makeLogo("N.C. A&T", "ncat");
	logoList[i++] = new makeLogo("Cal State Fullerton", "fullerton");
	logoList[i++] = new makeLogo("Radford", "runet");
	logoList[i++] = new makeLogo("Michigan", "umich");
	logoList[i++] = new makeLogo("High Point", "highpoint");
	logoList[i++] = new makeLogo("Rice", "rice");
	logoList[i++] = new makeLogo("Old Dominion", "odu");
	//logoList[i++] = new makeLogo("Keith LeClair Classic Day 1", "leClairClassic");
	//logoList[i++] = new makeLogo("Keith LeClair Classic Day 2", "leClairClassic");
	//logoList[i++] = new makeLogo("Keith LeClair Classic Day 3", "leClairClassic");
	logoList[i++] = new makeLogo("<B>C-USA All-Session Tournament Tickets</B>", "cusa_baseball");
	logoList[i++] = new makeLogo("<B>C-USA Individual Session Tickets</B>", "cusa_baseball");
	logoList[i++] = new makeLogo("Houston", "uh");
	logoList[i++] = new makeLogo("UTEP", "utep");
	logoList[i++] = new makeLogo("Memphis", "memphis");
	logoList[i++] = new makeLogo("Marshall", "marshall");
	logoList[i++] = new makeLogo("<B>SKIP &#39;N LUNCH</B>", "rbc_bank");
	logoList[i++] = new makeLogo("<B>TICKETS FOR TROOPS</B>", "ticketsForTroops");
	logoList[i++] = new makeLogo("Richmond", "richmond");
	logoList[i++] = new makeLogo("North Carolina Wesleyan", "nc-wesleyan");
	logoList[i++] = new makeLogo("Winthrop", "winthrop");
	logoList[i++] = new makeLogo("Lee University", "lee");
	logoList[i++] = new makeLogo("North Carolina Central", "nccu");
	logoList[i++] = new makeLogo("Clemson", "clemson");
	logoList[i++] = new makeLogo("NC State", "ncstate");
	logoList[i++] = new makeLogo("VCU", "vcu");
	logoList[i++] = new makeLogo("North Carolina State", "ncstate"); 	
	logoList[i++] = new makeLogo("Monmouth", "monmouth");
	logoList[i++] = new makeLogo("LeClair Classic Pass", "leclair");
	logoList[i++] = new makeLogo("Keith LeClair Classic Day 1", "leclair");
	logoList[i++] = new makeLogo("Keith LeClair Classic Day 2", "leclair");
	logoList[i++] = new makeLogo("Keith LeClair Classic Day 3", "leclair");
	logoList[i++] = new makeLogo("Virginia Commonwealth", "vcu");
	logoList[i++] = new makeLogo("Quinnipiac", "quinnipiac");
	logoList[i++] = new makeLogo("Rhode Island", "rhode_i");
	logoList[i++] = new makeLogo("Elon", "elon");
	logoList[i++] = new makeLogo("The Citadel", "citadel");
	logoList[i++] = new makeLogo("Presbyterian", "presby"); 	
	logoList[i++] = new makeLogo("<B>PEPSI FAMILY PACKAGES</B>", "pepsi"); 	
	logoList[i++] = new makeLogo("<B>ECU at Tulane</B>", "tulane");
	logoList[i++] = new makeLogo("<B>ECU at UCF</B>", "ucf");
	logoList[i++] = new makeLogo("<B>ECU at Southern Miss</B>", "usm");
	logoList[i++] = new makeLogo("<B>ECU at UAB</B>", "uab");

	logoList[i++] = new makeLogo("<B>BUD LIGHT PRESENTS DIERKS BENTLEY</B>", "dierks");
	logoList[i++] = new makeLogo("Liberty Bowl", "50thLogo");
	logoList[i++] = new makeLogo("<B>50TH AUTOZONE LIBERTY BOWL</B>", "50thLogo");
	logoList[i++] = new makeLogo("WALK FOR WOMEN", "walk-pic2"); 	
	logoList[i++] = new makeLogo("<B>PLIES and BOBBY V.</B>", "plies-bobby");
	logoList[i++] = new makeLogo("Plies Concert", "plies-bobby"); 	
	logoList[i++] = new makeLogo("<B>THE HARLEM GLOBETROTTERS", "HGT_Ball_hand");	
	logoList[i++] = new makeLogo("Harlem Globtrotters", "HGT_Ball_hand");
	
	logoList[i++] = new makeLogo("N.C. State", "ncstate");
	logoList[i++] = new makeLogo("Navy", "usna");
	
	logoList[i++] = new makeLogo("Military Bowl", "militarybowllogo");
	logoList[i++] = new makeLogo("<B>Military Bowl Tickets for Troops Donation</B>", "militarybowllogo");
	logoList[i++] = new makeLogo("Military Bowl Tailgate Party", "militarybowllogo");
	logoList[i++] = new makeLogo("Military Bowl Pirate Party", "militarybowllogo");
	
	logoList[i++] = new makeLogo("Buffalo", "buffalo");
	logoList[i++] = new makeLogo("Delaware State", "dsc");
	logoList[i++] = new makeLogo("Pepperdine", "pepperdine");
	logoList[i++] = new makeLogo("Rutgers", "rutgers2");
	logoList[i++] = new makeLogo("Youngstown State", "ysu");
	logoList[i++] = new makeLogo("Virginia Tech", "vt");

	logoList[i++] = new makeLogo("<B>ECU at UTEP</B>", "UTEP2");
	logoList[i++] = new makeLogo("<B>ECU at Marshall</B>", "marshall");	
	logoList[i++] = new makeLogo("MASSACHUSETTS", "umass");
	logoList[i++] = new makeLogo("N.C. CENTRAL", "nccu");

	logoList[i++] = new makeLogo("Milligan", "milligan");
	logoList[i++] = new makeLogo("Coker", "coker");
	logoList[i++] = new makeLogo("Chowan", "chowan");
	logoList[i++] = new makeLogo("UVA-Wise", "uva_wise");
	
	logoList[i++] = new makeLogo("UW-Milwaukee", "uwm");
	logoList[i++] = new makeLogo("Stony Brook", "sunysb");
	logoList[i++] = new makeLogo("Penn State", "penn_state");


	extraList = new Array;
	var i = 0;
	
	extraList[i++] = "";
	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";
	
	// NEW (accomodates more than one logo)
	
	// 6/6/08  - changed parameter name from group to mgroup so it will not be in conflict with DOM group variable. 
	
	
	function printLogo(name, mgroup) {
		var logo = new Array();
		name = 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);
				}
			}
		}
		
		// custom code # 179139  - to display logo by group.code
		if (common.pageName == "DisplayGroupList.html") {
			if(logo.length==0){		
				if(group.code=='FB') {
					logo.push("ecu");		
				}			
				if(group.code=='FBH' || group.code=='FB2' ) {
					logo.push("ecu-helmet");		
				}
				if(group.code=='WW') {
					logo.push("walk-pic2");
				}				

			}		
		}	
		// end of custom code

		if(logo.length==0) {
		// custom code
			var str = name
			if (str.match("BENTLEY")) {
				logo[0] = "dierks";
			} else if(name.indexOf("AUTOZONE") > -1) {
				logo[0] = "liberty2";
			} else if(name.indexOf("PRE-GAME BBQ BUFFET") > -1) {
				logo[0] = "liberty2";
			}
		// end custom code
		}			

		if(logo.length==0) {
			if(typeof(fullGroupList)!="undefined" && mgroup!="") {
				while(logo.length==0 && mgroup!="") {
					switch(mgroup) {
						case "FB": case "FB3": case "STFB": // football
							logo.push("football"); break;
 					    case "FB": case "FBH": case "FB2": 
							logo.push("ecu-helmet"); break;							
						/*
						case "BB": case "MB": case "WB":// basketball
							logo.push("basketball"); break;
						*/
						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;
						case "CUSA": // cusa_baseball
							logo.push("fbch-08"); break;	
						case "SNL": // skip n lunch 
							logo.push("rbc_bank"); break;	
						case "CUS": // cusa_baseball
							logo.push("cusa_baseball"); break;
						case "TT":
							logo.push("ticketsForTroops"); break;
						case "PFP": // Pepsi Family Packages
							logo.push("pepsi"); break;							    							
						case "WW": 
							logo.push("walk-pic2"); break;							    							
								
								
					}
					var parent = "";
					for(var i=0; i<fullGroupList.length; i++) {
						if(fullGroupList[i].code==mgroup) {
							parent = fullGroupList[i].parent;
						}
					}
					mgroup = parent;
				}
				if(logo.length==0) logo.push("ecu"); // default
			} else {
				switch(mgroup) {
					case "FB": case "F": case "FB3": case "STFB": // football
						logo.push("football"); break;
					case "B": // baseball
						logo.push("baseball"); break;
					case "SB": // softball
						logo.push("softball"); break;
					/*
					case "BB": 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;
					case "CUSA": // cusa_baseball
						logo.push("cusa_baseball"); break;	
					case "SNL": // skip n lunch 
						logo.push("rbc_bank"); break;	
					case "CUS": // cusa_baseball
						logo.push("cusa_baseball"); break;
					case "TT":
						logo.push("walk-pic2"); break;
					case "WW":
						logo.push("ticketsForTroops"); break;
						
//					case "FB": case "FBH": case "FB2": 
//						logo.push("ecu-helmet"); break;						
					default: // not avail
						logo.push("ecu"); 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);
	}
	
