		var defaultEmptyOK = false;
		var whitespace = " \t\n\r";
		function validateUserForm(infrm) {
    		var errors = 'The form was not submitted due to the following problems: \n\n';
	        var numErrors = 0;
			frm = infrm;
			if (!(isAlphanumeric(frm.FName.value))) {
				numErrors += 1;
				errors = errors + numErrors + ') First Name is empty or contains special characters.\n\n';
			}
			if (!(isAlphanumeric(frm.LName.value))) {
				numErrors += 1;
				errors = errors + numErrors + ') Last Name is empty or contains special characters.\n\n';
			}
			if (frm.ADDRESS1.value == "") {
				numErrors += 1;
				errors = errors + numErrors + ') Address is empty.\n\n';
			}
			if (frm.city.value == "") {
				numErrors += 1;
				errors = errors + numErrors + ') City is empty.\n\n';
			}
			if (frm.State.selectedIndex == 0) {
				numErrors += 1;
				errors = errors + numErrors + ') State is empty.\n\n';
			}
			if (!(isZIPCode(frm.zip.value))) {
				numErrors += 1;
				errors = errors + numErrors + ') Zip Code is empty or not valid.\n\n';
			}
			phone = frm.Phone1.value + frm.Phone2.value + frm.Phone3.value;
			if (!(isUSPhoneNumber(phone))) {
				numErrors += 1;
				errors = errors + numErrors + ') Phone Number is empty or not valid.\n\n';
			}
			if (!(isEmail(frm.Email.value))) {
				numErrors += 1;
				errors = errors + numErrors + ') Email is empty or not in the form a@b.c.\n\n';
			}
			locPassword = frm.password.value;
			if (locPassword.length<6) {
				numErrors += 1;
				errors = errors + numErrors + ') Password must be at least 6 characters.\n\n';
			}
			if (frm.password.value != frm.password1.value) {
				numErrors += 1;
				errors = errors + numErrors + ') Passwords do not match.\n\n';
			}
			if (numErrors>0) {
				alert(errors);
				return false;
			}
			//frm.action = "procesUserAccount.cfm";
			frm.submit();
		}
		function validateDivisionForm(infrm) {
    		var errors = 'The form was not submitted due to the following problems: \n\n';
	        var numErrors = 0;
			frm = infrm;
			if (!(isAlphanumeric(frm.FName.value))) {
				numErrors += 1;
				errors = errors + numErrors + ') First Name is empty or contains special characters.\n\n';
			}
			if (!(isAlphanumeric(frm.LName.value))) {
				numErrors += 1;
				errors = errors + numErrors + ') Last Name is empty or contains special characters.\n\n';
			}
			phone = frm.Phone1.value + frm.Phone2.value + frm.Phone3.value;
			if (!(isUSPhoneNumber(phone))) {
				numErrors += 1;
				errors = errors + numErrors + ') Phone Number is empty or not valid.\n\n';
			}
			if (!(isEmail(frm.Email.value))) {
				numErrors += 1;
				errors = errors + numErrors + ') Email is empty or not in the form a@b.c.\n\n';
			}
			locPassword = frm.password.value;
			if (locPassword.length<6) {
				numErrors += 1;
				errors = errors + numErrors + ') Password must be at least 6 characters.\n\n';
			}
			if (frm.password.value != frm.password1.value) {
				numErrors += 1;
				errors = errors + numErrors + ') Passwords do not match.\n\n';
			}
			if (numErrors>0) {
				alert(errors);
				return false;
			}
			//frm.action = "procesUserAccount.cfm";
			frm.submit();
		}
		function validateContactForm(infrm) {
			var errors = 'The form was not submitted due to the following problems: \n\n';
	        var numErrors = 0;
			frm = infrm;
			if (!(isAlphanumeric(frm.FName.value))) {
				numErrors += 1;
				errors = errors + numErrors + ') First Name is empty or contains special characters.\n\n';
			}
			if (!(isAlphanumeric(frm.LName.value))) {
				numErrors += 1;
				errors = errors + numErrors + ') Last Name is empty or contains special characters.\n\n';
			}
			if (frm.ADDRESS1.value == "") {
				numErrors += 1;
				errors = errors + numErrors + ') Address is empty.\n\n';
			}
			if (frm.city.value == "") {
				numErrors += 1;
				errors = errors + numErrors + ') City is empty.\n\n';
			}
			if (!(isZIPCode(frm.zip.value))) {
				numErrors += 1;
				errors = errors + numErrors + ') Zip Code is empty or not valid.\n\n';
			}
			phone = frm.Phone1.value + frm.Phone2.value + frm.Phone3.value;
			if (!(isUSPhoneNumber(phone))) {
				numErrors += 1;
				errors = errors + numErrors + ') Phone Number is empty or not valid.\n\n';
			}
			if (frm.Phone4.value!="") {
				if (!(isInteger(frm.Phone4.value))) {
					numErrors += 1;
					errors = errors + numErrors + ') Phone Number Ext is not valid.\n\n';
				}
			}
			fax = frm.Fax1.value + frm.Fax2.value + frm.Fax3.value;
			if (fax!="") {
				if (!(isUSPhoneNumber(fax))) {
					numErrors += 1;
					errors = errors + numErrors + ') Fax Number is not valid.\n\n';
				}
			}
			if (!(isEmail(frm.Email.value))) {
				numErrors += 1;
				errors = errors + numErrors + ') Email is empty or not in the form a@b.c.\n\n';
			}
			if (numErrors>0) {
				alert(errors);
				return false;
			}
			frm.submit();
		}
		function isAlphanumeric(s) {
			var i;
    		if (isEmpty(s)) 
       		if (isAlphanumeric.arguments.length == 1) return defaultEmptyOK;
       		else return (isAlphanumeric.arguments[1] == true);

    		// Search through string's characters one by one
		    // until we find a non-alphanumeric character.
		    // When we do, return false; if we don't, return true.

		    for (i = 0; i < s.length; i++) {
	        	// Check that current character is number or letter.
		        var c = s.charAt(i);
        		if (! (isLetter(c) || isDigit(c) ) )
        		return false;
    		}

   			// All characters are numbers or letters.
   		 	return true;
		}
		function isEmpty(s) {
   			return ((s == null) || (s.length == 0))
		}
	
		function isLetter (c) {
			return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) )
		}
	
		function isDigit (c) {
			return ((c >= "0") && (c <= "9"))
		}
		function isSpecialChar (c,i,l) {
			if ((c!=",") && (c!="-")) return false;
			else {
				if (c=="-") {
					if (i!=0) return false;
				}
				else {
					//must be ,
					if ( ((l-i) % 4) != 0) return false;
				}
			}
			return true;
		}
		function isZIPCode (s) {
			if (isEmpty(s)) 
       		if (isZIPCode.arguments.length == 1) return defaultEmptyOK;
       		else return (isZIPCode.arguments[1] == true);
   			return (isInteger(s) && ((s.length == 5) || (s.length == 9)))
		}
		function isInteger (s) {
			var i;
    		if (isEmpty(s)) 
       			if (isInteger.arguments.length == 1) return defaultEmptyOK;
       			else return (isInteger.arguments[1] == true);
			// Search through string's characters one by one
    		// until we find a non-numeric character.
    		// When we do, return false; if we don't, return true.
    		for (i = 0; i < s.length; i++) {   
        		// Check that current character is number.
        		var c = s.charAt(i);
        		if (!isDigit(c)) return false;
    		}
    		// All characters are numbers.
    		return true;
		}
		
		function isUSPhoneNumber (s) {
  	 		if (isEmpty(s)) 
       			if (isUSPhoneNumber.arguments.length == 1) return defaultEmptyOK;
       			else return (isUSPhoneNumber.arguments[1] == true);
    		return (isInteger(s) && s.length == 10)
		}
		function isEmail (s) {
   			if (isEmpty(s)) 
       			if (isEmail.arguments.length == 1) return defaultEmptyOK;
       			else return (isEmail.arguments[1] == true);
    		// is s whitespace?
    		if (isWhitespace(s)) return false;
   			// there must be >= 1 character before @, so we
		    // start looking at character position 1 
		    // (i.e. second character)
		    var i = 1;
    		var sLength = s.length;
		    // look for @
		    while ((i < sLength) && (s.charAt(i) != "@")) {
				i++
    		}
    		if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    		else i += 2;
		    // look for .
    		while ((i < sLength) && (s.charAt(i) != ".")) { 
				i++
    		}
    		// there must be at least one character after the .
    		if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    		else return true;
		}
		function isWhitespace (s) {
			var i;
		    // Is s empty?
    		if (isEmpty(s)) return true;
			// Search through string's characters one by one
			// until we find a non-whitespace character.
			// When we do, return false; if we don't, return true.
		    for (i = 0; i < s.length; i++) {
 		       // Check that current character isn't whitespace.
        		var c = s.charAt(i);
		        if (whitespace.indexOf(c) == -1) return false;
    		}
		    // All characters are whitespace.
    		return true;
		}
		
		var digitCounter;
		function isDollar (s) {
			var i;
    		if (isEmpty(s)) 
       			if (isDollar.arguments.length == 1) return defaultEmptyOK;
       			else return (isDollar.arguments[1] == true);
			// Search through string's characters one by one
    		// until we find a non-numeric character.
    		// When we do, return false; if we don't, return true.
			//Allow , and -
			digitCounter = 0;
    		for (i = 0; i < s.length; i++) {   
        		// Check that current character is number.
        		var c = s.charAt(i);
        		if ((!isDigit(c)) && (!isSpecialChar(c,i,s.length))) return false;
				if (isDigit(c)) {
					digitCounter = digitCounter + 1;
				}
    		}
			if (digitCounter > 12) {
				return false;
			}
    		// All characters are numbers or , or -.
    		return true;
		}
		function validateDollar(inField) {
			inValue = inField.value;
			if (inValue=="") {
				inField.value = 0;
				inValue = 0;
			}
			if (isDollar(inValue)) {
				//alert("Value is correct format.");
			}
			else {
				if (digitCounter > 12) {
					alert("The value you typed must not exceed 12 numbers.");
					inField.focus();
				}
				else {
					alert("The value you typed is not a valid currency format.  Please do not use $ or .");
					inField.focus();
				}
			}
		}
		
		function isDate(field){
			var checkstr = "0123456789";
			var DateField = field;
			var Datevalue = "";
			var DateTemp = "";
			var seperator = "/";
			var day;
			var month;
			var year;
			var leap = 0;
			var err = 0;
			var i;
			err = 0;
			DateValue = DateField.value;
			if (DateValue.length!=10) err=1;
			if (!(isDigit(DateValue.charAt(0)))) err=2;
			if (!(isDigit(DateValue.charAt(1)))) err=2;
			if (DateValue.charAt(2)!='/') err=2;
			if (!(isDigit(DateValue.charAt(3)))) err=2;
			if (!(isDigit(DateValue.charAt(4)))) err=2;
			if (DateValue.charAt(5)!='/') err=2;
			if (!(isDigit(DateValue.charAt(6)))) err=2;
			if (!(isDigit(DateValue.charAt(7)))) err=2;
			if (!(isDigit(DateValue.charAt(8)))) err=2;
			if (!(isDigit(DateValue.charAt(9)))) err=2;
			
	   		/* year is wrong if year = 0000 */
	   		year = DateValue.substr(6,4);
	   		if (year == 0) {
	      		err = 20;
	   		}
	   		/* Validation of month*/
	   		month = DateValue.substr(0,2);
	   		if ((month < 1) || (month > 12)) {
	    	  	err = 21;
	   		}
	   		/* Validation of day*/
	   		day = DateValue.substr(3,2);
	   		if (day < 1) {
	    		err = 22;
	   		}
	   		/* Validation leap-year / february / day */
	   		if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {
	      		leap = 1;
	   		}
	   		if ((month == 2) && (leap == 1) && (day > 29)) {
	      		err = 23;
	   		}
	   		if ((month == 2) && (leap != 1) && (day > 28)) {
	      		err = 24;
	   		}
	   		/* Validation of other months */
	   		if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {
	      		err = 25;
	   		}
	   		if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {
	      		err = 26;
	   		}
	   		/* if 00 ist entered, no error, deleting the entry */
	   		if ((day == 0) && (month == 0) && (year == 00)) {
	      		err = 0; day = ""; month = ""; year = ""; seperator = "";
	   		}
			/* if no error, write the completed date to Input-Field (e.g. 13.12.2001) */
   			if (err == 0) {
      			DateField.value = month + seperator + day + seperator + year;
   			}
			else {
	   		/* Error-message if err != 0 */
	      		return false;
	      		DateField.select();
		  		DateField.focus();
	   		}
			return true;
		}

		
function _isInteger(val) {
	var digits="1234567890";
	for (var i=0; i < val.length; i++) {
		if (digits.indexOf(val.charAt(i))==-1) { return false; }
		}
	return true;
	}
function _getInt(str,i,minlength,maxlength) {
	for (var x=maxlength; x>=minlength; x--) {
		var token=str.substring(i,i+x);
		if (token.length < minlength) { return null; }
		if (_isInteger(token)) { return token; }
		}
	return null;
	}

function processAirportForm()
{

	//short cut for the form
	win = window.document.airportDetails;
	
	//assign the checkbox values to the hidden fields
	if( win.isGrandFathered.checked )
		 win.GrandFathered.value=1;
	else
		 win.GrandFathered.value=0;

	if( win.isReqdToFileAFRs.checked )
		win.required.value=1;
	else
		win.required.value=0;
	return true;

}

function processContactForm()
{
	//create a shortcut for the form
	win = window.document.contactDetails;

	//assign the checkbox values to the hidden fields
	
	win.isFAA.checked ? win.FAA.value=1 : win.FAA.value=0;
	win.isSponsorContact.checked ? win.sponsorContact.value=1 : win.sponsorContact.value=0;
	win.manager.checked ? win.manager.value=1 : win.manager.value=0;
	win.isOther.checked ? win.other.value=1 : win.other.value=0;
	

	//exit function and return to calling programme
	return;
}



function total_127_A()
{
	//set a shortcut for the form
	//win = window.document.window.127;
	//win.A_Total = (win.landing_fees_127.value + win.terminal_127.value + win.apron_127.value + win.FBO_127.value + win.cargo_127.value + win.fuel_tax_127.value + win.fuel_flowage_127.value + win.misc_aero_127.value + other_A_127.value);

	//Exit programme
	return;
}

function openWindow( page,section, history_id, airport_id, loc_id, year, sectionTitle)
{
	//Convert the section letter to a number
	newSection = letterToNumber( section );
		
	newPage = (page + '?section=' + newSection + '&history_id=' + history_id + '&airport_id=' + airport_id + '&loc_id=' + loc_id + '&year=' + year + '&sectionTitle=' + sectionTitle);
	//alert(newPage);
	newWindow = window.open(newPage, 'newWindow', 'width=425,height=450,scrollbars=yes');
	newWindow.focus();
}

function openContactWindow(page)
{
	window.open(page, 'newWindow', 'width=575,height=450,scrollbars=yes');
}

function openInstWindow(page)
{
	newWindow = window.open(page, 'newWindow', 'width=400,height=300,scrollbars=yes');
	newWindow.focus();
}

function letterToNumber(section)
{
	/**convert section letter to section number
	* Used for other_126 and other_127 forms
	**/
	switch(section)
	{
		case('A'):
			section = 1;
			break;
		case('B'):
			section = 2;
			break;
		case('C'):
			section = 3;
			break;
		case('D'):
			section = 4;
			break;
		case('E'):
			section = 5;
			break;
		case('F'):
			section = 6;
			break;
		case('G'):
			section = 7;
			break;
		case('H'):
			section = 8;
			break;
		case('I'):
			section = 9;
			break;
		case('J'):
			section = 10;
			break;
		case('K'):
			section = 11;
			break;
		case('L'):
			section = 12;
			break;
	}
		//exit programme
		return section;
}

function processOther_127(obj)
{
	//create a shortcut
	win = window.document.other_127;

	//window.document.other_127.submit();
	
	//place the name of the button that was clicked into the hidden form
	win.buttonClicked.value = obj;
	
	//submit the form
	win.submit();
	
}

function processOther_126(obj)
{
	//create a shortcut
	win = window.document.other_126;

	//window.document.other_127.submit();
	
	//place the name of the button that was clicked into the hidden form
	win.buttonClicked.value = obj;
	
	//submit the form
	win.submit();
	
}
	
	var fullWidth;
	
	function init() {
	
	  // Get width of window, need to account for scrollbar width in Netscape.
	
	  fullWidth = getWindowWidth() 
	    - (isMinNS4 && getWindowHeight() < getPageHeight() ? 16 : 0);
	
	  myNavBar1.resize(fullWidth);
	  myNavBar1.create();
	  myNavBar1.setzIndex(2);
	  //UNCOMMENT BELOW LINE TO MOVE MENU DOWN 50 pixels
	  //myNavBar1.moveTo(0, 50);
	}
