// Preload wait animation for displayeventinfo, etc...
	image1 = new Image();
	image1.src = (typeof(imageWWWPath)!=undefined ? '/evenue/linkID=uga/images' : imageWWWPath) + '/waitani.gif';
	image2 = new Image();
	image2.src = (typeof(styleWWWPath)!=undefined ? '/evenue/linkID=uga/stylesheets' : styleWWWPath) + '/style.css';

// Configuration Variables

// there are generally two header types, images and text...
// set to images if your headers are images
// set to text if your headers are text
	var headType = "text";

// set to whatever you want the text for 00:00 to display, eg, midnight, 00:00 or time TBD
	var zerotimetext = "time TBD";

// set to 1 to turn on, 0 to off
	var showRenewalLinks = 1;
	var showStudentLinks = 1;
	var showDonationLinks = 1;
	
// parent group code
	var bypassGroup = (typeof(linkID)!="undefined" && linkID!="uga" ? "TIX" : "UGA");

// hidden group codes 
	var hiddenGroups = new Array();
	var hgi = 0
	hiddenGroups[hgi++] = "HIDDEN";
	hiddenGroups[hgi++] = "PACMON";

	function isHiddenGroup(groupCode) {
		if(groupCode.indexOf("HIDDEN")==0 || groupCode.indexOf("PR:")==0)
				return true;
		
		if(typeof(fullGroupList)!="undefined") {
			t_groupCode = groupCode;
			while(t_groupCode!="" && t_groupCode!=bypassGroup) {
				if(inArray(t_groupCode, hiddenGroups)) {
					return true;
					break;
				}
				
				for(var gi=0; gi<fullGroupList.length; gi++) {
					if(fullGroupList[gi].code==t_groupCode) {
						t_groupCode = fullGroupList[gi].parent;
						break;
					}
			}
		}
		} else if(inArray(groupCode, hiddenGroups)) {
			return true;
		}
		
		return false;
	}

// hidden events by group
	function isEventInHiddenGroup(groupCode) {
		var parentGroup = groupCode;
		while(parentGroup!="" && !isHiddenGroup(parentGroup)) {
			for(var i=0; i<fullGroupList.length; i++) {
				if(parentGroup == fullGroupList[i].code) {
					parentGroup = fullGroupList[i].parent;
					break;
				}
			}
		}
		return (isHiddenGroup(parentGroup) ? true : false);
	}

// set to 1 to include Canadian provinces
	var useCanadianProvince = 0;

// order of address lines
	function makeAddrOrder(number, type, req) {
		this.number = number;
		this.type = type;
		this.req = req;
	}
	var addrOrder = new Array();
	addrOrder[0] = new makeAddrOrder(2, "text", 1);
	addrOrder[1] = new makeAddrOrder(1, "text", 0);
	addrOrder[2] = new makeAddrOrder(3, "hidden", 0);

// array of days of the week (abbreviated & full)
	var dowa =  new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
	var dowf =  new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");

// array of months of the year (abbreviated & full)
	var moya = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
	var moyf = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

// array of credit cards used -- put the name of the cc in the array below to add it to the site.
// remove it from the array to remove it from the site
//	var ccUsed = new Array("Visa", "MasterCard", "Discover", "Amex");
	var ccUsed = new Array("Visa", "MasterCard", "Discover");

// ticket office phone number... used throughout the site in "helper" text... ie (for more information call the ticket office at XXXXXX)
	var phoneNumber = "877-542-1231";

// trim leading and trailing spaces;
	function trim(field){
		var badName = field.value;
		var goodName = badName.replace(/^\s+|\s+$/ig, "");
		field.value = goodName;
	}
	
// changes all letters to uppercase
	function allCaps(field) {
		var theString = field.value.toUpperCase();
		field.value = theString;
	}

// strip non numerics
	function numbersOnly(field){
		var badName = field.value;
		var goodName = badName.replace(/[^0-9]/ig, "");
		field.value = goodName;
		}

// strip non alphabetics
	function alphaOnly(field){
		var badName = field.value;
		var goodName = badName.replace(/[^a-zA-Z -]/ig, "");
		field.value = goodName;
	}

// strip html coding from strings
	function stripHTML(string) {
		string = string.replace(/<br>/ig, " ");
		return string.replace(/(<([^>]+)>)/ig, "");
	}

// string cleaner
	function cleaner(string) {
		// fix break tags
		string = string.replace(/<br>/ig, " ");
		
		// remove html tags
		string = stripHTML(string);
		
		// fix apostrophes
		string = string.replace(/\'/ig, "&#39;");
		string = string.replace(/"/ig, "&quot;");  //'
		
		// trim leading/trailing spaces
		string = string.replace(/^\s+|\s+$/ig, "");
		
		// remove extra spaces
		while(string.indexOf("  ")>-1) {
			string = string.replace(/  /g, " ");
		}
		
		return string;
	}

// generic rollover function
	function flip(image, type) {
		document[image].src = imageWWWPath + "/" + image + type + ".gif";
	}

// generic pop up window function
	function pop(url, w, h) {
		window.open(url, '', 'scrollbars=yes,resizable=yes,width='+w+',height='+h+'');
	}

// function to print the header on each page
// if your headers are images, the image parameter is the filename and the text parameter is the alt text
// if your headers are text, the image parameter is ignored and the text parameter is the text printed
	function printHead(image, text) {
		if(headType == "image") {
			document.write(
				'<table cellpadding="0" cellspacing="0" border="0" width="100%">',
				'	<tr>',
				'		<td width="34"><img src="', imageWWWPath, '/head-l.gif" width="34" height="19"  border="0"></td>',
				'		<td width="100%"><img src="', imageWWWPath, '/head-',image,'.gif" height="19" alt="',text,'" border="0"></td>',
				'	</tr>',
				'</table>'
			);
		} else if(headType == "text") {
			document.write(
				'<h1>',text,'</h1>'
			);
		}
		return true;
	}

// supporting function to printBreadCrumbs
	function printParent(group) {
		var match = -1;
		for(var i=0; i < fullGroupList.length; i++) {
			if(group == fullGroupList[i].code) {
				match = i;
				if(fullGroupList[i].parent != "") {
					printParent(fullGroupList[i].parent);
				}
			}
		}
		if(match >= 0) {
			//org: document.write('<span>', cleaner(fullGroupList[match].description) ,' &gt; </span>');
			//brainstorm #27, clickable breadcrumbs link 1 of 2
			document.write('<span class="printparent"><a href="/cgi-bin/ncommerce3/SEGetGroupList?groupCode=',fullGroupList[match].code,'&linkID=', linkID, '&shopperContext=&caller=&appCode=">', cleaner(fullGroupList[match].description) ,'</a> &gt; </span>');			
		}
	}

// function to print "Bread Crumb" type navigation
	function printBreadCrumbs(group) {
		if(group.code.indexOf("RSF:")==0) return;
		if(group.code.indexOf("PR:PR:")==0) return; //fix #21 case 271983
		
		document.write('<div id="breadcrumbs">');
		if(group.code != "") {
			for(var i=0; i < fullGroupList.length; i++) {
				if(group.code == fullGroupList[i].code && fullGroupList[i].parent != "") {
					printParent(fullGroupList[i].parent);
				}
			}
			//org: document.write('<strong>', cleaner(group.description) ,'</strong>'); 
			//brainstorm #27, clickable breadcrumbs link 2 of 2 
			//org: document.write('<span class="printbread"><a href="/cgi-bin/ncommerce3/SEGetGroupList?groupCode=', group.code,'&linkID=', linkID, '&shopperContext=&caller=&appCode=">', cleaner(group.description) ,'</a></span>');	
			//fix #46, case 271983
			document.write('<span class="printbread"><a href="/cgi-bin/ncommerce3/SEGetGroupList?groupCode=', group.code,'&linkID=', linkID, '&shopperContext=',(common.loggedIn&&common.isStudent? 'ST' : ''), '&caller=&appCode=">', cleaner(group.description) ,'</a></span>');			
		}
		document.write('</div>');
		return;
	}

// function to get the group name	
	function getGroupName(group) {
		var name="";
		for(var i=0; i < fullGroupList.length; i++) {
			if(group == fullGroupList[i].code) {
				name = fullGroupList[i].description;
				break;
			}
		}
		return name;
	}

// helper function eg turns 3 into 03
	function twoForm(n) { return (n < 10 ? "0"+n : n); }

// calculate amount of days in a given month (0-11) and return number.
	function daysInMonth(month,year) {
		var dd = new Date((month==11 ? year+1 : year), (month==11 ? 0 : month+1), 0);
		return dd.getDate();
	}

// return date object at the start of incremented month
	function incDateByMonth(initDate, incAmount) {
		initMonth = initDate.getMonth();
		initYear = initDate.getFullYear();
		var incDate = new Date((initMonth+incAmount<12 ? initYear : initYear+1), (initMonth+incAmount<12 ? initMonth+incAmount : initMonth+incAmount-12), 1);
		return incDate;
	}
	
// return date object at the start of decremented month
	function decDateByMonth(initDate, decAmount) {
		initMonth = initDate.getMonth();
		initYear = initDate.getFullYear();
		var decDate = new Date((initMonth-decAmount>0 ? initYear : initYear-1), (initMonth-decAmount>0 ? initMonth-decAmount : initMonth-decAmount+12), 1);
		return decDate;
	}
	
// return date object that is the last date of month
	function lastDayOfMonth(initDate) {
		var incAmount = 1;
		initMonth = initDate.getMonth();
		initYear = initDate.getFullYear();
		var incDate = new Date((initMonth+incAmount<12 ? initYear : initYear+1), (initMonth+incAmount<12 ? initMonth+incAmount : initMonth+incAmount-12), 0);
		return incDate;
	}
	
// returns date object from string
	function convertDateString(string) {
		if(string.match(/\d{1,2}\/\d{1,2}\/\d{4}/ig) == string) {
			string = string.split("/");
			return (new Date(string[2], (string[0]-1), string[1]));
		} else {
			string = string.split("-");
			return (new Date(string[0], (string[1]-1), string[2]));
		}
	}

// print calendar link
	function printCalendarLink(linkID, groupCode) {
		var date1 = new Date();
		var date2 = new Date(date1.getFullYear()+1, date1.getMonth(), 0);

		var calendarLink = 
			'/cgi-bin/ncommerce3/SEGetEventList?linkID='+ linkID +
			'&groupCode='+ groupCode +
			'&timeDateFrom='+ 	date1.getFullYear() +'-'+ (date1.getMonth()+1) +'-'+ date1.getDate() +'-00.00.00'+
			'&timeDateTo='+ 	date2.getFullYear() +'-'+ (date2.getMonth()+1) +'-'+ date2.getDate() +'-00.00.00';
		return calendarLink;
	}

// function to format an amount eg xxx.xx
	function formatAmt(amount) {
		var fmt_amt = Math.round(amount * 100) / 100;
		fmt_amt = fmt_amt.toString();
		var ipos = fmt_amt.indexOf(".");
		if(ipos == -1)
			fmt_amt += ".00";
		else if(fmt_amt.substr(ipos + 1).length == 1)
			fmt_amt += "0";
		return fmt_amt;
	}

// helper function eg turns 3 into 03
	function twoForm(n) {
		return (n < 10 ? "0"+n : n);
	}

// convert time string (ie: "2008-04-26 14:00:00.000000") to proper date format.
	function convertTimeStamp(str) {
		if(str == "")
			return "";
		
		regExp = /(\d{4})-(\d\d)-(\d\d)\s(\d\d):(\d\d):(\d\d)\.\d{6}/ ;
		if(!regExp.test(str))
			return "Bad Date" ;
		
		arr = str.match(regExp) ;
		return new Date(arr[1], arr[2] - 1, arr[3], arr[4], arr[5], arr[6]) ;
	}

// 6.91
	function formatDate(strD)
	{
		if(strD == "" || strD == "Partial" || strD == "Multiple")
		{
			return strD;
		}
		else
		{
			dateArr = strD.split("-");
			return (dateArr[1] + "-" + dateArr[2] + "-" + dateArr[0]);
		}
	}

// function to make the time a nice format
	function timeFormat(time) {
		if(time == "") {
			var hm = "n/a";
		} else {
			var m = time.getMinutes();
			var h24 = time.getHours();
			var h = h24 > 12 ? h24 - 12 : (h24==0 ? 12 : h24);
			
			if(m == 0 && h24 == 0) {
				hm = zerotimetext;
			} else if(m == 0 && h24 == 12) {
				hm = "Noon";
			} else {
				hm = h + ":" +  twoForm(m) + (h24 < 12 ? "&nbsp;am" : "&nbsp;pm");
			}
		}

		return hm;
	}
	
// function to make the date a nice format
	function dateFormat(time) {
		if(time == "") {
			var formatedTime = "n/a";
		} else {
			var formatedTime = dowf[time.getDay()] + ", " + moyf[time.getMonth()] + " " + time.getDate() + ", " + time.getFullYear();
		}
	
		return formatedTime;
	}

	function shortDateFormat(time, ismultiday, endtime) {
		if(typeof(time)=="undefined" || time == "") {
			var formatedTime = "n/a";
			
		} else if(
			typeof(ismultiday)!="undefined" && ismultiday=="1" && 
			typeof(endtime)!="undefined" && endtime!="" && 
			endtime.toString()!=time.toString()
		) {
			var formatedTime =
				'Begins: '+ dowa[time.getDay()] +', '+ moya[time.getMonth()] +'-'+ time.getDate() +'-'+ time.getFullYear() + '<br>'+
				'Ends: '+ dowa[endtime.getDay()] +', '+ moya[endtime.getMonth()] +'-'+ endtime.getDate() +'-'+ endtime.getFullYear();
			
		} else {
			var formatedTime = dowa[time.getDay()] +', '+ moya[time.getMonth()] +'-'+ time.getDate() +'-'+ time.getFullYear();
		}

		return formatedTime;
	}

	function shortestDateFormat(time) {
		var formatedTime = (time.getMonth()+1) + '/' + time.getDate() + '/' + time.getFullYear();
		return formatedTime;
	}
	
// If left undefined, date format functions below may fail on some pages.
	if(typeof(pageName)=="undefined") var pageName = "";

// function to make the date & time a nice format (with labels)
	function dateTimeFormat(time, ismultiday, endtime, label) {
	
		if(typeof(label)=="undefined" || label == "") { label="Event Date"}
		
		if(typeof(time)=="undefined" || time == "") {
			var formatedTime = "date &amp; time n/a";
			
		} else if(
			typeof(ismultiday)!="undefined" && ismultiday=="1" && 
			typeof(endtime)!="undefined" && endtime!="" && 
			endtime.toString()!=time.toString()
		) {
			var formatedTime =
				'<strong>Event Begins:</strong> '+ dateFormat(time) + ' at ' + timeFormat(time) + '<br>'+
				'<strong>Event Ends:</strong> '+ dateFormat(endtime) + ' at ' + timeFormat(endtime);
			
		} else {
			var formatedTime =
				//OG '<strong>Event Date:</strong>' +(pageName=="DisplayEventList.html" ? '<br>' : '') + dateFormat(time) + (pageName=="DisplayEventList.html" ? '<br>' : ' at ') + timeFormat(time);
				'<table style="margin-left: -2px;"><tr><td nowrap valign="top"><strong>'+ label + ':</strong></td><td>' + dateFormat(time) + ' at ' + timeFormat(time)+'</td></tr></table>';				
		}

		return formatedTime;
	}

// function to make the date & time a nice format (no labels)
	function dateTimeFormat2(time, ismultiday, endtime) {
		if(typeof(time)=="undefined" || time == "") {
			var formatedTime = "date &amp; time n/a";
			
		} else if(
			typeof(ismultiday)!="undefined" && ismultiday=="1" && 
			typeof(endtime)!="undefined" && endtime!="" && 
			endtime.toString()!=time.toString()
		) {
			var formatedTime =
				'Event Begins: '+ dateFormat(time) + ' at ' + timeFormat(time) + '<br>'+
				'Event Ends: '+ dateFormat(endtime) + ' at ' + timeFormat(endtime);
			
		} else {
			var formatedTime = (pageName=="DisplayEventList.html" ? '<br>' : '') + dateFormat(time) + (pageName=="DisplayEventList.html" ? '<br>' : ' at ') + timeFormat(time);
		}

		return formatedTime;
	}

// function to make the date a nice format for pop up boxes (no &nbsp;)
	function popdateFormat(time) {
		var formatedTime = dateTimeFormat2(time)
		formatedTime = formatedTime.replace(/&nbsp;/ig, ' ');
		return formatedTime;
	}

// formats a number to xxx.xx
	function amountFormat(amount) {
		var amtFmt = Math.round(amount * 100) / 100;
		amtFmt = amtFmt.toString();
		var ipos = amtFmt.indexOf(".");
		if(ipos == -1) {
			amtFmt += ".00";
		} else if(amtFmt.substr(ipos + 1).length == 1) {
			amtFmt += "0";
		}
		return amtFmt;
	}

// prints error message, centered and in error style
	function printError(errorMsg) {
		document.write(
			'<br><div align="center" class="error">', errorMsg ,'</div><br>'
		);
	}

// prints the event head in the cart & orderok pages
	function printCartTitle(text, colspan) {
		if(colspan == "") {
			colspan = 10;
		}
		document.write(
			'<tr><td colspan="',colspan,'" class="cartbox">',text,'</td></tr>'
		);
	}

// prints head lines in cart & orderok pages
	function printTypeHead(text, colspan) {
		if(colspan == "") {
			colspan = 10;
		}
		document.write(
			//'<tr><td colspan="',colspan,'">&nbsp;</td></tr>',
			'<tr><td colspan="',colspan,'" class="sectionhead">',text,'</td></tr>'
		);
	}

// Opens search box on SE
	function launch() {
		remote = open(seWWWPath+"/datePicker.html", "child", "resizable,dependent=yes,width=400,height=400");
	}

// Works with launch function	for the datepicker
	function callBack(child, groupCode, timeDateFrom, timeDateTo) {
		document.dateForm.timeDateFrom.value = timeDateFrom;
		document.dateForm.timeDateTo.value = timeDateTo;
		document.dateForm.groupCode.value = groupCode;
		child.close();
		document.dateForm.submit();
	}
	
// Validates email address with the following rules:
// 1. One or more characters before the "@"
// 2. An optional "[", because user@[255.255.255.0] is a valid e-mail
// 3. A sequence of letters, numbers, and periods, which are all valid domain or IP address characters
// 4. A period followed by a 2-3 letter suffix
// 5. An optional "]"

	function emailValidate(email) {

		var str = email.value; // email string
  
		var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
		var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,4})(\]?)$/; // valid

		if (!reg1.test(str) && reg2.test(str)) { // if syntax is valid
			return true;
		}

		window.status = "Please enter a valid Internet e-mail address";

		email.focus();
		email.select();

		return false;
	}

// validates account number
	function accntValidate(account) {
		var pe = /[0-9]/;
		var val = account.value;

		if(!(val.match(pe)) ) {
			window.status = "Please enter a valid e-mail address or account number";
			account.select();
			account.focus();
			return false;
		}
		return true;
	}

// Validates password is not empty and between 4 and 12 characters
	function passwordValidate(password) {
		if(password.value == "") {
			window.status = "Please enter a password";
			password.focus();
			return false;
		}
		if(password.value.length < 4 || password.value.length > 12) {
			window.status = "Your Password must be between 4 and 12 characters in length.";
			password.focus();
			return false;
		}
	}
	
// Centered Pop Up Box
	function popBox(href, name, w, h) {
		if(typeof(name)=="undefined") 	name ="evenue";
		if(typeof(w)=="undefined") 		w=700;
		if(typeof(h)=="undefined") 		h=480;
		
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'width='+w+',height='+h+',top='+wint+',left='+winl+',scrollbars=yes,resizable=yes';
		win = window.open(href, name, winprops);
		if (parseInt(navigator.appVersion) >= 4) {
			win.window.focus();
		}
	}
	
	/* function popBox(loc) {
		window.open(loc, 'evenue', 'scrollbars=yes,resizable=yes,width=640,height=480');
	} */

// Disables enter button in input boxes
	function disableEnter(fld) {
		var key = (window.event) ? event.keyCode : (key == 0);
		if(key == 13) {
			return false;
		}
		return true;
	}

// formats the phone number into the following format: (XXX)XXX-XXXX
	function phoneFormat(field) {
		re  = /[^0-9]/g;
		val = field.value.replace(re, ""); // take out non integers

		if(!val.match(/^[2-9]\d{9}$/)) {
			window.status = "Please enter a valid 10 digit phone number";
			return false;
		}

		field.value = "(" + val.substr(0, 3) + ")" + val.substr(3, 3) + "-" + val.substr(6, 4);  

		return true;
	}

// Changes first letter of all strings in an input field to Uppercase
	function changeCase(field) {
		var fstring;
		var tmpChar;
		var preString;
		var postString;
		var flength;
		fstring = field.value.toLowerCase();
		flength = fstring.length;
		if (flength > 0) {
			for (s = 0; s < flength; s++) {
				if (s == 0)  {
					tmpChar = fstring.substring(0,1).toUpperCase();
					postString = fstring.substring(1,flength);
					fstring = tmpChar + postString;
				} else {
					tmpChar = fstring.substring(s, s+1);
					if (tmpChar == " " && s < (flength-1)) {
						tmpChar = fstring.substring(s+1, s+2).toUpperCase();
						preString = fstring.substring(0, s+1);
						postString = fstring.substring(s+2,flength);
						fstring = preString + tmpChar + postString;
					}
				}
			}
		}
		field.value = fstring;
	}
	
// address labels & states
//Default state code.
	var defaultStCode = "";
//Default country code.
	var defaultCnCode = "";

// Array for State code and state name
	var stCodes = new Array(
		"AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL",
		"GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME",
		"MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH",
		"NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "PR",
		"RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV",
		"WI", "WY",
		"-",
		"AB", "BC", "LB", "MB", "NB", 
		"NF", "NS", "NT", "ON", "PE",
		"QC", "SK", "YT",
		"-", "N/A"
	);

	var stNames = new Array(
		"Alabama", "Alaska", "Arizona", "Arkansas", "California",
		"Colorado", "Connecticut", "Delaware", "District of Columbia", "Florida",
		"Georgia", "Hawaii", "Idaho", "Illinois", "Indiana",
		"Iowa", "Kansas", "Kentucky", "Louisiana", "Maine",
		"Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi",
		"Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire",
		"New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota",
		"Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Puerto Rico",
		"Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas",
		"Utah", "Vermont", "Virginia", "Washington", "West Virginia",
		"Wisconsin", "Wyoming",
		"-------------",
		"Alberta", "British Columbia", "Labrador", "Manitoba", "New Brunswick",
		"Newfoundland", "Nova Scotia", "Northwest Territories", "Ontario", "Prince Edward Island",
		"Quebec", "Saskatchewan", "Yukon Territory",
		"-------------", "NOT APPLICABLE"
	);


// Array for Country code and country name
	var cnCodes = new Array(
		"US", "AL",
		"DZ", "AD", "AO", "AR", "AM", "AW",
		"AU", "AT", "AZ", "PT", "BS", "BH",
		"BD", "BB", "BY", "BE", "BZ", "BJ",
		"BM", "BT", "BO", "BA", "BW", "BR",
		"BN", "BG", "BF", "BI", "KH", "CM",
		"CA", "CV", "KY", "CF", "TS", "CL",
		"CN", "CO", "ZR", "CG", "FR", "CR",
		"CI", "HR", "CY", "CZ", "DK", "DJ",
		"DO", "EC", "EG", "SV", "GQ", "ER",
		"EE", "ET", "DK", "FJ", "FI", "FR",
		"GF", "PF", "GA", "GE", "DE", "GH",
		"GB", "GR", "GD", "GP", "GT",
		"GN", "GW", "GY", "HT", "HN", "HK",
		"HU", "IS", "IN", "ID", "IQ", "IE",
		"IL", "IT", "JM", "JP", "JO", "KG",
		"KE", "KR", "KW", "KG", "LA", "LV",
		"LS", "LR", "LI", "LT", "LU", "MO",
		"MK", "MG", "PT", "MW", "MY", "MV",
		"ML", "MT", "MQ", "MR", "MU", "MX",
		"MD", "MN", "MA", "MZ", "NA", "NR",
		"NP", "NL", "AN", "NC", "NZ", "NI",
		"NE", "NG", "NO", "OM", "PK", "PA",
		"PG", "PY", "PE", "PH", "PL", "PT",
		"QA", "RO", "RU", "RW", "KN", "LC",
		"VC", "SA", "SN", "YU", "SC", "SL",
		"SG", "SK", "SI", "SB", "SO", "ZA",
		"ES", "LK", "SD", "SZ", "SE", "SZ",
		"SY", "TW", "TJ", "TZ", "TH", "TG",
		"TT", "TN", "TR", "TM", "UG",
		"UA", "AE", "UY", "VU", "VE",
		"VN", "WS", "YE"
	);

	var cnNames = new Array(
		"United States of America", "Albania", 
		"Algeria", "Andorra", "Angola", "Argentina", "Armenia", "Aruba", 
		"Australia", "Austria", "Azerbaijan", "Azores", "Bahamas", "Bahrain", 
		"Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", 
		"Bermuda", "Bhutan", "Bolivia", "Bosna-Herzegovina", "Botswana", "Brazil", 
		"Brunei Darussalam", "Bulgaria", "Burkina FASO", "Burundi", "Cambodia", "Cameroon", 
		"Canada", "Cape Verde", "Cayman Islands", "Cntl African Republic", "Chad", "Chile", 
		"China", "Columbia", "Democratic Republic of Congo", "Republic of the Congo (Brazaville)", "Corsica", "Costa Rica", 
		"Cote d&#39;Ivoire (Ivory Coast)", "Croatia", "Cyprus", "Czech Republic", "Denmark", "Djibouti", 
		"Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", 
		"Estonia", "Ethiopia", "Faroe Islands", "Fiji", "Finland", "France", 
		"French Guiana", "French Polynesia (Tahitti)", "Gabon", "Georgia, Republic of", "Germany", "Ghana", 
		"Great Britain & Northern Ireland", "Greece", "Grenada", "Guadeloupe", "Guatemala", 
		"Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hong Kong", 
		"Hungary", "Iceland", "India", "Indonesia", "Iraq", "Ireland (Eire)", 
		"Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", 
		"Kenya", "South Korea, Republic of", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", 
		"Lesotho", "Liberia", "Liechtenstein", "Lithuania", "Luxembourg", "Macao", 
		"Macedonia, Republic of", "Madagascar", "Madeira Islands", "Malawi", "Malaysia", "Maldives ", 
		"Mali", "Malta", "Martinique", "Mauritania", "Mauritius", "Mexico", 
		"Moldova", "Mongolia", "Morocco", "Mozambique", "Namibia", "Nauru", 
		"Nepal", "Netherlands (Holland)", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", 
		"Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Panama", 
		"Papua New Guinea", "Paraguay", "Peru", "Phillipines", "Poland", "Portugal", 
		"Qatar", "Romania", "Russia (Russia Federation)", "Rwanda", "St. Christopher (St. Kitts) and Nevis", "St. Lucia", 
		"St. Vincent and the Grenadines", "Saudi Arabia", "Senegal", "Serbia Montenegro (Yugoslavia)", "Seychelles", "Sierra Leone", 
		"Singapore", "Slovak Republic (Slovakia)", "Slovenia", "Solomon Islands", "Somalia", "South Africa", 
		"Spain", "Sri Lanka ", "Sudan", "Swaziland", "Sweden", "Switzerland", 
		"Syrian Arab Republic", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", 
		"Trinidad & Tobago", "Tunisia", "Turkey", "Turkmenistan", "Uganda", 
		"Ukraine", "United Arab Emirates", "Uruguay", "Vanuatu", "Venezuela", 
		"Vietnam", "Western Samoa", "Yemen"
	);

	if(useCanadianProvince) {
		var stateAddrLabel = "Province/State";
		var zipAddrLabel = "Postal/Zip Code";
	} else {
		var stateAddrLabel = "State";
		var zipAddrLabel = "Zip Code";
	}

	function getStateLabel() {
		return stateAddrLabel;
	}

	function getZipCodeLabel() {
		return zipAddrLabel;
	}

//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
// all site specific functions go here
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
	function imgOn(img) {
		document[img].src = imageWWWPath+"/menu-on.gif";
	}
	function imgOff(img) {
		document[img].src = imageWWWPath+"/menu-off.gif";
	}

// hidden dates
	var hiddenDates = new Array(
	//	"New Jersey Symphony - Marvin Hamlisch At The Movies"
	);

	function isHiddenDate(event, date) {
		if(date!="" && date.getFullYear() == "2099")
			return true;
		
		event = stripHTML(event);
		for(var hdi=0; hdi < hiddenDates.length; hdi++) {
			if(hiddenDates[hdi].toUpperCase() == event.toUpperCase()) {
				return true;
			}
		}
		return false;
	}

// get variables from query string
	function getQueryVariable(variable) {
		var query = window.location.search.substring(1);
		var vars = query.split("&");
		for (var i=0;i<vars.length;i++) {
			var pair = vars[i].split("=");
			if (pair[0] == variable) {
				return pair[1];
			}
		} 
		return "";
	}
	
	
function print_jpg(name, imgDir, mWidth, mHeight ) {
  var img = "";
  name = name.toUpperCase();

// modified to use section name as image name. the file name for the view has to be = the area code
  var imgSrc = "";

  if(name != "") {
   imgSrc =  '<img src="'+imageWWWPath+'/'+imgDir+'/'+name+'.jpg" class="imagelink" width="'+mWidth+'" Height="'+mHeight+'"><br>' ;  
      imgSrc = imgSrc + '<img src="$(imageWWWPath)/blank.gif" border="0" width="13" height="1">View from section <b>'+ name +'</b><br><br>';
  }

  return(imgSrc);
 } 	
 
 
		
// ***************  Lgging message - Debugging purpose ************//

function log(message){
	var console = document.getElementById("debugInfo");
	if (console == null) {
		console = document.createElement("div");
		console.id="debugInfo";
		console.style.background = "#dedede";
		console.style.border = "1px solid silver";
		console.style.padding = "5px";
		console.style.width = "200px";			
		console.style.height = "300px";	
		console.style.position = "absolute";			
		console.style.left = "0px";					
		console.style.top = "0px";							
		console.style.opacity = "0.8";									
		console.style.filter="alpha(opacity=70)";		
		console.style.overflow = "auto";									
		document.body.appendChild(console);
	}
	console.innerHTML += "<p>" + message + "</p>";
}	

/* --------------------------------------------------
	BoxedShadow - custom code
-------------------------------------------------- */
	function printShadowboxHeader() {
		document.write(
			'<table border="0" cellpadding="0" cellspacing="0" style="height: 100%; margin-bottom: 1.5em;">',
			'	<tr valign="bottom">',
			'		<td width="10" height="10"><img src="', imageWWWPath ,'/houston-boxed11.gif" width="10" height="10" alt="" border="0"></td>',
			'		<td style="background: url(\'', imageWWWPath ,'/houston-boxed12.gif\') bottom left repeat-x;"><img src="', imageWWWPath ,'/blank.gif" width="1" height="10" alt="" border="0"></td>',
			'		<td width="10" height="10"><img src="', imageWWWPath ,'/houston-boxed13.gif" width="10" height="10" alt="" border="0"></td>',
			'	</tr>',
			'	<tr valign="top">',
			'		<td width="10" style="background: url(\'', imageWWWPath ,'/houston-boxed21.gif\') top right repeat-y;"><img src="', imageWWWPath ,'/blank.gif" width="10" height="1" alt="" border="0"></td>',
			'		<td>'
		);
	}
	
	function printShadowboxFooter() {
		document.write(
			'		</td>',
			'		<td width="10" style="background: url(\'', imageWWWPath ,'/houston-boxed23.gif\') top left repeat-y;"><img src="', imageWWWPath ,'/blank.gif" width="10" height="1" alt="" border="0"></td>',
			'	</tr>',
			'	<tr valign="top">',
			'		<td width="10" height="10"><img src="', imageWWWPath ,'/houston-boxed31.gif" width="10" height="10" alt="" border="0"></td>',
			'		<td style="background: url(\'', imageWWWPath ,'/houston-boxed32.gif\') top left repeat-x;"><img src="', imageWWWPath ,'/blank.gif" width="1" height="10" alt="" border="0"></td>',
			'		<td width="10" height="10"><img src="', imageWWWPath ,'/houston-boxed33.gif" width="10" height="10" alt="" border="0"></td>',
			'	</tr>',
			'</table>'
		);
	}
		 
// toggle display

	function toggleEl(mcsID){
		var el = document.getElementById(mcsID);
		if(el.style.display=='none')
			el.style.display="block";
		else 	
			el.style.display="none";
	
	}
	
// add functions to window onload
	function addLoadEvent(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
				if (oldonload) {
					oldonload();
				}
				func();
			}
		}
	}
	/* SAMPLES
		addLoadEvent(nameOfSomeFunctionToRunOnPageLoad);
		addLoadEvent(function() {
			// more code to run on page load
		});
	END SAMPLES */


// finds items in a single dimensional array, returns true or false
	function inArray(needle, haystack) {
		if(typeof(needle)=="undefined" || typeof(haystack)!="object") return false;
		for(var hsi=0; hsi<haystack.length; hsi++) {
			if(haystack[hsi] == needle) return true;
	}
	return false;
}
