			var intImageTimer;
			var intTimer;

			function getObj(name) {
				if (document.getElementById) {
					this.obj = document.getElementById(name);
					this.style = document.getElementById(name).style;
				} else if (document.all) {
					this.obj = document.all[name];
					this.style = document.all[name].style;
				} else if (document.layers) {
					this.obj = document.layers[name];
					this.style = document.layers[name];
				}
			}
		
			function imageSwap(layerID,ImageName,newImage) {
				if (document.getElementById) {
					document.images[ImageName].src = newImage;
				}else if (document.all) {
					if (layerID != '') {
						document.all[layerID].document.images[ImageName].src = newImage;
					}
				} else if (document.layers) {
					if (layerID != '') {
						document.layers[layerID].document.images[ImageName].src = newImage;
					}
				}
			}
		
			function accessForms(layerID,formID) {
			
				// ***IF USER IS ON IE5+ OR NS6+***
				if (document.getElementById) {
					return document.forms[formID]
				
				// ***IF USER IS ON IE4+***
				}else if (document.all) {
					return document.forms[formID]
				
				// ***IF USER IS ON NS4+***
				}else if (document.layers) {
					return document.layers[layerID].document.forms[formID]
				}
			
			}

			function returnWindowWidth(windowRef) {
				var width = 0;
				if (!windowRef) {
					windowRef = window;
				}
				if (typeof(windowRef.innerWidth) == 'number') {
					width = parseInt((windowRef.innerWidth - 1) - (windowRef.outerWidth - windowRef.innerWidth));
				}
				if (windowRef.document.body && typeof(windowRef.document.body.clientWidth) == 'number') {
					width = windowRef.document.body.clientWidth;
				}

				if (width == 0) {
					width = 640;
				}

				return width;
			}



			// *** FUNCTION: returnWindowHeight *** //

			function returnWindowHeight(windowRef) {
				var height = 0;
				if (!windowRef) {
					windowRef = window;
				}
				if (typeof(windowRef.innerWidth) == 'number') {
					height = windowRef.innerHeight;
				}
				if (windowRef.document.body && typeof(windowRef.document.body.clientWidth) == 'number') {
					height = windowRef.document.body.clientHeight;
				}

				if (height == 0) {
					height = 520;
				}
				return height;
			}

			var intWindowWidth;
			var intWindowHeight;
			var intPopupLeft;
			var intPopupTop;

			var strImageURL;
			var objPopup = -1;

			function ShowPage(strURL, intWidth, intHeight) {

				if ( strURL != '') {

					if ( objPopup == -1 ) {

						// GET WINDOW PROPERTIES
						intWindowWidth = returnWindowWidth();
						intWindowHeight = returnWindowHeight();

						// WORK OUT THE POSITION OF THE POP-UP
						intPopupLeft = ( intWindowWidth / 2) - ( intWidth / 2 );
						intPopupTop = ( intWindowHeight / 2) - ( intHeight / 2 );

						// OPEN NEW WINDOW AND POSITION
						objPopup = window.open(strURL,'','left='+intPopupLeft+'; top='+intPopupTop+'; width='+intWidth+'; height='+intHeight+'; directories=no; location=no; menubar=no; resizable=yes; scrollbars=auto; status=no; toolbar=no;',1);

					} else {

						// CHANGE THE IMAGE SRC IN THE NEW WINDOW
						// THEN BRING IT TO THE FRONT
						// objPopup.document.images[0].src = strImageURL;
						objPopup.location.href = strURL;
						objPopup.focus();

					}
					
				}

			}

			function redirect_to_state(strURL) {
				
				//alert(strURL);
				clearTimeout(intTimer);
				
				if ( strURL != "" ) {
					location.href = strURL;
				}
			}
			
			
			/*
			BrowserDetector()
			Parses User-Agent string into useful info.

			Source: Webmonkey Code Library
			(http://www.hotwired.com/webmonkey/javascript/code_library/)

			Author: Richard Blaylock
			Author Email: blaylock@wired.com

			Usage: var bd = new BrowserDetector(navigator.userAgent);
			*/


			// Utility function to trim spaces from both ends of a string
			function Trim(inString) {
			  var retVal = "";
			  var start = 0;
			  while ((start < inString.length) && (inString.charAt(start) == ' ')) {
			    ++start;
			  }
			  var end = inString.length;
			  while ((end > 0) && (inString.charAt(end - 1) == ' ')) {
			    --end;
			  }
			  retVal = inString.substring(start, end);
			  return retVal;
			}

			function BrowserDetector(ua) {

			// Defaults
			  this.browser = "Unknown";
			  this.platform = "Unknown";
			  this.version = "";
			  this.majorver = "";
			  this.minorver = "";

			  uaLen = ua.length;

			// ##### Split into stuff before parens and stuff in parens
			  var preparens = "";
			  var parenthesized = "";

			  i = ua.indexOf("(");
			  if (i >= 0) {
			    preparens = Trim(ua.substring(0,i));
				parenthesized = ua.substring(i+1, uaLen);
				j = parenthesized.indexOf(")");
				if (j >= 0) {
				  parenthesized = parenthesized.substring(0, j);
				}
			  }
			  else {
			    preparens = ua;
			  }

			// ##### First assume browser and version are in preparens
			// ##### override later if we find them in the parenthesized stuff
			  var browVer = preparens;

			  var tokens = parenthesized.split(";");
			  var token = "";
			// # Now go through parenthesized tokens
			  for (var i=0; i < tokens.length; i++) {
			    token = Trim(tokens[i]);
				//## compatible - might want to reset from Netscape
				if (token == "compatible") {
				  //## One might want to reset browVer to a null string
				  //## here, but instead, we'll assume that if we don't
				  //## find out otherwise, then it really is Mozilla
				  //## (or whatever showed up before the parens).
				//## browser - try for Opera or IE
			    }
				else if (token.indexOf("MSIE") >= 0) {
			      browVer = token;
			    }
			    else if (token.indexOf("Opera") >= 0) {
			      browVer = token;
			    }
				//'## platform - try for X11, SunOS, Win, Mac, PPC
			    else if ((token.indexOf("X11") >= 0) || (token.indexOf("SunOS") >= 0) ||
			(token.indexOf("Linux") >= 0)) {
			      this.platform = "Unix";
				}
			    else if (token.indexOf("Win") >= 0) {
			      this.platform = token;
				}
			    else if ((token.indexOf("Mac") >= 0) || (token.indexOf("PPC") >= 0)) {
			      this.platform = token;
				}
			  }

			  var msieIndex = browVer.indexOf("MSIE");
			  if (msieIndex >= 0) {
			    browVer = browVer.substring(msieIndex, browVer.length);
			  }

			  var leftover = "";
			  if (browVer.substring(0, "Mozilla".length) == "Mozilla") {
			    this.browser = "Netscape";
				leftover = browVer.substring("Mozilla".length+1, browVer.length);
			  }
			  else if (browVer.substring(0, "Lynx".length) == "Lynx") {
			    this.browser = "Lynx";
				leftover = browVer.substring("Lynx".length+1, browVer.length);
			  }
			  else if (browVer.substring(0, "MSIE".length) == "MSIE") {
			    this.browser = "IE";
			    leftover = browVer.substring("MSIE".length+1, browVer.length);
			  }
			  else if (browVer.substring(0, "Microsoft Internet Explorer".length) ==
			"Microsoft Internet Explorer") {
			    this.browser = "IE"
				leftover = browVer.substring("Microsoft Internet Explorer".length+1,
			browVer.length);
			  }
			  else if (browVer.substring(0, "Opera".length) == "Opera") {
			    this.browser = "Opera"
			    leftover = browVer.substring("Opera".length+1, browVer.length);
			  }

			  leftover = Trim(leftover);

			  // # Try to get version info out of leftover stuff
			  i = leftover.indexOf(" ");
			  if (i >= 0) {
			    this.version = leftover.substring(0, i);
			  }
			  else
			  {
			    this.version = leftover;
			  }
			  j = this.version.indexOf(".");
			  if (j >= 0) {
			    this.majorver = this.version.substring(0,j);
			    this.minorver = this.version.substring(j+1, this.version.length);
			  }
			  else {
			    this.majorver = this.version;
			  }


			} // function BrowserCap



		var intFlag = 0;

		function ShowNext(intLayerID,intFieldIDa,intFieldIDb) {

			var ObjDiv;
			var strFieldNameA = 'field00';
			if ( intFieldIDa > 9 ) { strFieldNameA = 'field0'; }

			var strFieldNameB = 'field00';
			if ( intFieldIDb > 9 ) { strFieldNameB = 'field0'; }

			if ( document.forms['teamform'].elements[strFieldNameA+intFieldIDa].value != "" && document.forms['teamform'].elements[strFieldNameB+intFieldIDb].selectedIndex != "0" ) {

				// Display the next member name and size fields
				intLayerID = intLayerID + 1;
				ObjDiv = new getObj("member" + intLayerID);
				ObjDiv.style.display = "block";

				//alert("Layer: "+intLayerID+"\nStatus: "+ObjDiv.style.display);

				// Make the cursor jump to the next field
				intFieldIDb = intFieldIDb + 1;
				var strFieldNameB = 'field00';
				if ( intFieldIDb > 9 ) { strFieldNameB = 'field0'; }
				document.forms['teamform'].elements[strFieldNameB+intFieldIDb].focus();

			} else {

				intFlag = 1;

			}

		}

		function ShowNext2(intLayerID,intFieldIDa) {

			var ObjDiv;
			var strFieldNameA = 'field00';
			if ( intFieldIDa > 9 ) { strFieldNameA = 'field0'; }

			//var strFieldNameB = 'field00';
			//if ( intFieldIDb > 9 ) { strFieldNameB = 'field0'; }

			//if ( document.forms['teamform'].elements[strFieldNameA+intFieldIDa].value != "" && document.forms['teamform'].elements[strFieldNameB+intFieldIDa].selectedIndex != "0" ) {
			if ( document.forms['teamform'].elements[strFieldNameA+intFieldIDa].value != "" ) {

				if ( document.forms['teamform'].elements['field004'].value != "" ) {
					document.forms['teamform'].elements['field004'].value = eval(document.forms['teamform'].elements['field004'].value) + 1;
				} else {
					document.forms['teamform'].elements['field004'].value = 1;
				}
				
				// Display the next member name and size fields
				intLayerID = intLayerID + 1;
				ObjDiv = new getObj("member" + intLayerID);
				ObjDiv.style.display = "block";

				//alert("Layer: "+intLayerID+"\nStatus: "+ObjDiv.style.display);

				// Make the cursor jump to the next field
				//intFieldIDb = intFieldIDb + 1;
				//var strFieldNameB = 'field00';
				//if ( intFieldIDb > 9 ) { strFieldNameB = 'field0'; }
				//document.forms['teamform'].elements[strFieldNamea+intFieldIDb].focus();

			} else {

				intFlag = 1;

			}

		}

		function ShowPopulated() {

			var intCounter = 4;
			var intCounterPlusOne = intCounter + 1;

			for ( i = 1; i < 20; i++ ) {

					//alert(i+","+intCounter+","+intCounterPlusOne);

					ShowNext(i,intCounter,intCounterPlusOne);
					intCounter = intCounter + 2;
					intCounterPlusOne = intCounterPlusOne + 2;
			}
		}
		
		function RevealFields() {
		
			// Set a variable for later use
			var ObjDiv;
			
			// Get the number of members
			var strNumberOfMembers = document.forms['teamform'].elements['field004'].value;
			
			// Reveal the correct number of table rows
			if ( strNumberOfMembers != '' ) {
			
				if ( eval(strNumberOfMembers) ) {
			
					for ( i = 2; i < eval(strNumberOfMembers) + 1; i++ ) {
						ObjDiv = new getObj("member" + i);
						ObjDiv.style.display = "block";
					}
					
				} else {
				
					alert("Please enter a number, the current entry is not valid.");
				
				}
			}
		}

		function submitVolunteer() {
			document.forms['frmVolunteer'].submit();
		}


/* END OF FILE */

