			function addExpense() {
				// error checking
				if (!document.getElementById('subcat_id') || document.getElementById('subcat_id').value == "none") { 
					alert("Please choose the category for this expense."); 
					document.getElementById('subcat_id').focus();
					return;
				}
				if (document.getElementById('amount').value === "" || !isNumeric(document.getElementById('amount').value)) {
					alert("Please enter a valid amount."); 
					document.getElementById('amount').focus();
					return;				
				}
				// swap out the submit button
				submitButtonDiv = document.getElementById('formsubmit').innerHTML;
				document.getElementById('reply').innerHTML = '<img border=0 src="images/loading.gif">';
				var formVars = ajaxObj.getForm('expenseForm');
				// call the ajax function
				ajaxObj.call("action=ajaxFunctions&do=addExpense"+formVars, addExpense2);
			}
			
			function addExpense2(resp) {
				if (resp) {
					// replace the button
					document.getElementById('reply').innerHTML = document.getElementById('income').value ? "Your income was added." : "Your expense was added." ;
					// replace the form field values
					//document.getElementById('subcat_id').value='none';
					document.getElementById('amount').value='';
					document.getElementById('notes').value='';
				} else {
					document.getElementById('reply').innerHTML = "We're sorry. There was an error and your expense was not added.";
				}
			}
			
			function addMileage() {
				// error checking
				if (document.getElementById('vehicle_id').value == "none") { 
					alert("Please enter the vehicle in which this mileage was traveled."); 
					document.getElementById('vehicle_id').focus();
					return;
				}
				if (!isNumeric(document.getElementById('total_miles').value)) { 
					alert("Please enter a valid mileage. Only numbers are allowed."); 
					document.getElementById('total_miles').focus();
					return;
				}
				if (document.getElementById('reason') == "") { 
					alert("Please enter the business reason for this mileage."); 
					document.getElementById('reason').focus();
					return;
				}
				// swap out the submit button
				submitButtonDiv = document.getElementById('formsubmit').innerHTML;
				document.getElementById('formsubmit').innerHTML = '<img border=0 src="images/loading.gif">';
				var formVars = ajaxObj.getForm('addMileageForm');
				// call the ajax function
				ajaxObj.call("action=ajaxFunctions&do=addMileage"+formVars, addMileage2);
			}
			
			function addMileage2(resp) {
				if (resp) {
					 //window.location.href='?p=myVehicles';
				} else {
					alert("We're sorry. There was an error and your vehicle was not added.");
				}
				document.getElementById('formsubmit').innerHTML = submitButtonDiv;
			}
			
			function addNightsAway() {
				// error checking
				if (document.getElementById('month').value=='none') {
					alert("Please choose the month.");
					document.getElementById('month').focus();
					return;
				}
				// swap out the submit button
				//submitButtonDiv = document.getElementById('formsubmit').innerHTML;
				document.getElementById('reply').innerHTML = '<img border=0 src="images/loading.gif">';
				var formVars = ajaxObj.getForm('addNightsAwayForm');
				// call the ajax function
				ajaxObj.call("action=ajaxFunctions&do=addNightsAway"+formVars, addNightsAway2);

			}

			function addNightsAway2(resp) {
				if (resp.doSQL) {
					// replace the button
					document.getElementById('reply').innerHTML = 'Your nights away were added.';
				} else {
					alert("We're sorry. There was an error and your nights away were not recorded.");
					document.getElementById('reply').innerHTML = '';
				}
			}

			function addNoReceipt() {
				// error checking
				if (document.getElementById('city').value == "") { 
					alert("Please enter the city that this expense was incurred."); 
					document.getElementById('city').focus();
					return;
				}
				if (document.getElementById('amount').value === "" || !isNumeric(document.getElementById('amount').value)) {
					alert("Please enter a valid amount."); 
					document.getElementById('amount').focus();
					return;				
				}
				if (document.getElementById('description').value == "") { 
					alert("Please enter a description of this expense."); 
					document.getElementById('description').focus();
					return;
				}
				// swap out the submit button
				submitButtonDiv = document.getElementById('formsubmit').innerHTML;
				document.getElementById('reply').innerHTML = '<img border=0 src="images/loading.gif">';
				var formVars = ajaxObj.getForm('addNoReceiptForm');
				// call the ajax function
				ajaxObj.call("action=ajaxFunctions&do=addNoReceipt"+formVars, addNoReceipt2);
			}
			
			function addNoReceipt2(resp) {
				if (resp) {
					// replace the button
					document.getElementById('reply').innerHTML = "Your receipt was added.<br /><a href=\"?p=noReceiptLog\">Click here</a> to go back to the No Receipt Log.";
					// replace the form field values
					document.getElementById('city').value='';
					document.getElementById('amount').value='';
					document.getElementById('description').value='';
				} else {
					document.getElementById('formsubmit').innerHTML = "We're sorry. There was an error and your receipt was not added.";
				}
			}
			
			function addTruckMileage() {
				// error checking
				if (document.getElementById('miles').value === "" || !isNumeric(document.getElementById('miles').value)) {
					alert("Please enter a valid mileage."); 
					document.getElementById('miles').focus();
					return;				
				}
				// swap out the submit button
				//submitButtonDiv = document.getElementById('formsubmit').innerHTML;
				document.getElementById('reply').innerHTML = '<img border=0 src="images/loading.gif">';
				var formVars = ajaxObj.getForm('addTruckMileageForm');
				// call the ajax function
				ajaxObj.call("action=ajaxFunctions&do=addTruckMileage"+formVars, addTruckMileage2);
			}
			
			function addTruckMileage2(resp) {
				if (resp) {
					// replace the button
					document.getElementById('reply').innerHTML = "Your mileage was added.<br /><a href=\"?p=truckMileage\">Click here</a> to go back to the mileage list.";
					// replace the form field values
					document.getElementById('miles').value='';
				} else {
					alert("We're sorry. There was an error and your mileage was not added.");
					document.getElementById('reply').innerHTML = '';
				}
			}

			function addVehicle() {
				// error checking
				if (document.getElementById('year').value == "") { 
					alert("Please enter the year the vehicle was made."); 
					document.getElementById('year').focus();
					return;
				}
				if (!isNumeric(document.getElementById('year').value) && document.getElementById('year').value.length != 4) { 
					alert("Please enter a valid year for the vehicle."); 
					document.getElementById('year').focus();
					return;
				}
				if (!document.getElementById('make_model') || document.getElementById('make_model').value == "") { 
					alert("Please enter the make and model of this vehicle."); 
					document.getElementById('make_model').focus();
					return;
				}
				if (getRadioValue('leased') == 1 && !isNumeric(document.getElementById('lease_payment').value)) {
					alert("Please enter amount of your lease payment for this vehicle."); 
					document.getElementById('lease_amount').focus();
					return;				
				}
				document.getElementById('reply').innerHTML = '<img border=0 src="images/loading.gif">';
				var formVars = ajaxObj.getForm('addVehicleForm');
				// call the ajax function
				ajaxObj.call("action=ajaxFunctions&do=addVehicle"+formVars, addVehicle2);
			}
			
			function addVehicle2(resp) {
				if (resp) {
					 window.location.href='?p=myVehicles';
				} else {
					alert("We're sorry. There was an error and your vehicle was not added.");
					document.getElementById('reply').innerHTML = '';
				}
			}
			function changePassword() {
				curPass = document.getElementById('curPass').value;
				newPass = document.getElementById('newPass').value;
				newPass1 = document.getElementById('newPass1').value;
				// new passwords match?
				if (newPass != newPass1) {
					alert("Your new passwords do not match. Please correct and try again.");
					return;
				}
				document.getElementById('reply').innerHTML="<img border='0' src='images/loading.gif'>";
				// check current password
				ajaxObj.call("action=ajaxFunctions&do=checkCurPassword&curPass="+curPass, changePassword2);				
			}
			
			function changePassword2(resp) {
				if (resp.passwordMatches) {
					newPass = document.getElementById('newPass').value;
					ajaxObj.call("action=ajaxFunctions&do=changePassword&newPass="+newPass, changePassword3);
				} else {
					document.getElementById('reply').innerHTML="Your current password is not accurate. Please try again.";
				}
			}
			
			function changePassword3(resp) {
				if (resp.doSQL) {
					document.getElementById('curPass').value = '';
					document.getElementById('newPass').value = '';
					document.getElementById('newPass1').value = '';
					document.getElementById('reply').innerHTML="Your password has been changed.";					
				} else {
					document.getElementById('reply').innerHTML="<strong>Sorry!</strong> There was an error and your password was not changed.";
				}
			}
			
			function delExpense(lid) {
				if (confirm("Are you sure you want to delete this expense?")) {
					document.getElementById('expenseHistory').innerHTML='<img border=0 src=\"images/loading.gif\">';
					ajaxObj.call("action=ajaxFunctions&do=delExpense&lid="+lid, delExpense2);
				}
			}
			
			function delExpense2(resp) {
				if (resp) {
					getExpenseHistory(document.getElementById('expenseMonth').value);
				} else {
					alert("Sorry. There was an error and your expense was not deleted.");
				}
			}
			
			function delMileage(mid) {
				if (confirm("Are you sure you want to delete this mileage?")) {
					document.getElementById('mileageHistory').innerHTML='<img border=0 src=\"images/loading.gif\">';
					ajaxObj.call("action=ajaxFunctions&do=delMileage&mid="+mid, delMileage2);
				}
			}
			
			function delMileage2(resp) {
				if (resp) {
					getMileageHistory(document.getElementById('mileageMonth').value);
				} else {
					alert("Sorry. There was an error and your mileage was not deleted.");
				}
			}

			function delNightsAway(m,y,s,c) {
				if (confirm("Are you sure you want to delete this item from your nights away list?")) {
					document.getElementById('nightsAwayHistory').innerHTML='<img border="0" src="images/loading.gif">';
					// call the ajax function
					ajaxObj.call("action=ajaxFunctions&do=delNightsAway&m="+m+"&y="+y+"&s="+s+"&c="+c, delNightsAway2);
				}
			}

			function delNightsAway2(resp) {
				if (!resp) { alert("Sorry. There was an error and your nights away were not removed."); }
				y = document.getElementById('nightsAwayYear').value;
				getNightsAway(y);
			}

			function delReceipt(rid) {
				if (confirm("Are you sure you want to delete this receipt?")) {
					document.getElementById('noReceiptHistory').innerHTML='<img border=0 src=\"images/loading.gif\">';
					ajaxObj.call("action=ajaxFunctions&do=delReceipt&rid="+rid, delReceipt2);
				}
			}
			
			function delReceipt2(resp) {
				if (resp) {
					getReceiptHistory(document.getElementById('noReceiptMonth').value);
				} else {
					alert("Sorry. There was an error and your receipt was not deleted.");
				}
			}
			
			function delTruckMileage(mid) {
				if (confirm("Are you sure you want to delete this truck mileage?")) {
					document.getElementById('truckMileageDiv').innerHTML='<img border=0 src=\"images/loading.gif\">';
					ajaxObj.call("action=ajaxFunctions&do=delTruckMileage&mid="+mid, delTruckMileage2);
				}
			}
			
			function delTruckMileage2(resp) {
				if (resp) {
					getTruckMileage(document.getElementById('truckMileageMonth').value);
				} else {
					alert("Sorry. There was an error and your mileage was not deleted.");
				}
			}
			
			function delVehicle(vid) {
				if (confirm("Are you sure you want to remove this vehicle from your list?")) {
					ajaxObj.call("action=ajaxFunctions&do=delVehicle&vid="+vid, delVehicle2);
				}
			}
			
			function delVehicle2(resp) {
				alert(resp); return;
				if (resp) {
					window.location.reload();
				} else {
					alert("Sorry. There was an error and your vehicle was not deleted.");
				}			
			}
			
			function editHealthInsurancePayment(id,amount) {
				newAmount = prompt("Please enter the new amount for this health insurance payment.",amount);
				if(newAmount != null && newAmount != amount) {
					ajaxObj.call("action=ajaxFunctions&do=editHealthInsurancePayment&id="+id+"&newAmount="+newAmount, editHealthInsurancePayment2);
				}
			}
			
			function editHealthInsurancePayment2(resp) {
				if (resp.doSQL) {
					getHealthInsuranceHistory(document.getElementById('healthInsuranceYear').value);
				} else {
					alert("Sorry. There was an error and your payment was not updated.");
				}
			}

			function editPayment(id,amount,item) {
				newAmount = prompt("Please enter the new amount for this " + item + " payment.",amount);
				if(newAmount != null && newAmount != amount) {
					ajaxObj.call("action=ajaxFunctions&do=editPayment&id="+id+"&item="+item+"&newAmount="+newAmount, editPayment2);
				}
			}
			
			function editPayment2(resp) {
				if (resp.doSQL) {
					getPaymentHistory(document.getElementById('paymentHistoryYear').value);
				} else {
					alert("Sorry. There was an error and your payment was not updated.");
				}
			}
			
			function getCostPerMile(q) {
				if (q != 'none') {
  				document.getElementById('costPerMileSummary').innerHTML='<img border="0" src="images/loading.gif">';
  				// call the ajax function
  				ajaxObj.call("action=ajaxFunctions&do=getCostPerMileSummary&q="+q, "costPerMileSummary");
				}
			}

			function getExpenseHistory(month) {
				if (month != 'none') {
  				document.getElementById('expenseHistory').innerHTML='<img border="0" src="images/loading.gif">';
  				// call the ajax function
  				ajaxObj.call("action=ajaxFunctions&do=getExpenseHistory&m="+month, "expenseHistory");
				}
			}
			
			function getHealthInsuranceHistory(year) {
				if (year != 'none') {
  				document.getElementById('healthInsuranceHistoryDiv').innerHTML='<img border="0" src="images/loading.gif">';
  				// call the ajax function
  				ajaxObj.call("action=ajaxFunctions&do=getHealthInsuranceHistory&y="+year, "healthInsuranceHistoryDiv");
				}
			}

			function getMileageHistory(month) {
				if (month != 'none') {
  				document.getElementById('mileageHistory').innerHTML='<img border="0" src="images/loading.gif">';
  				// call the ajax function
  				ajaxObj.call("action=ajaxFunctions&do=getMileageHistory&m="+month, "mileageHistory");
				}
			}

			function getNightsAway(year) {
				if (year != 'none') {
  				document.getElementById('nightsAwayHistory').innerHTML='<img border="0" src="images/loading.gif">';
  				// call the ajax function
  				ajaxObj.call("action=ajaxFunctions&do=getNightsAway&y="+year, "nightsAwayHistory");
				}
			}

			function getNoReceiptLog(month) {
				if (month != 'none') {
  				document.getElementById('noReceiptHistory').innerHTML='<img border="0" src="images/loading.gif">';
  				// call the ajax function
  				ajaxObj.call("action=ajaxFunctions&do=getNoReceiptHistory&m="+month, "noReceiptHistory");
				}
			}
			
			function getPaymentHistory(year) {
				if (year != 'none') {
  				document.getElementById('paymentHistoryDiv').innerHTML='<img border="0" src="images/loading.gif">';
  				// call the ajax function
  				ajaxObj.call("action=ajaxFunctions&do=getPaymentHistory&y="+year, "paymentHistoryDiv");
				}
			}

			function getPercentTotalExpenses(q) {
				if (q != 'none') {
  				document.getElementById('percentTotalExpensesSummary').innerHTML='<img border="0" src="images/loading.gif">';
  				// call the ajax function
  				ajaxObj.call("action=ajaxFunctions&do=getPercentTotalExpenses&q="+q, "percentTotalExpensesSummary");
				}
			}
			
			function getQuarterlyExpenseSummary(q) {
				if (q != 'none') {
  				document.getElementById('expenseSummary').innerHTML='<img border="0" src="images/loading.gif">';
  				// call the ajax function
  				ajaxObj.call("action=ajaxFunctions&do=getQuarterlyExpenseSummary&q="+q, "expenseSummary");
				}
			}

			function getReminder(scid) {
  				//document.getElementById('reminder').innerHTML='<img border="0" src="images/loading.gif">';
  				// call the ajax function
  				ajaxObj.call("action=ajaxFunctions&do=getReminder&scid="+scid, "reminder");
			}

			function getRevenuePerMile(q) {
				if (q != 'none') {
  				document.getElementById('revenuePerMileSummary').innerHTML='<img border="0" src="images/loading.gif">';
  				// call the ajax function
  				ajaxObj.call("action=ajaxFunctions&do=getRevenuePerMileSummary&q="+q, "revenuePerMileSummary");
				}
			}

			function getTruckMileage(y) {
  				// call the ajax function
				if (y != 'none') {
					ajaxObj.call("action=ajaxFunctions&do=getTruckMileage&y="+y, "truckMileageDiv");
				}
			}

			function getTruckMileagePageLoad() {
				var d = new Date();
				// if january, subract 1 from the year
				y = d.getMonth() == 0 ? d.getFullYear()-1 : d.getFullYear() ;
				getTruckMileage(y);
			}
			
			function getYearlyExpenseSummary(y) {
				if (y != 'none') {
  				document.getElementById('expenseSummary').innerHTML='<img border="0" src="images/loading.gif">';
  				// call the ajax function
  				ajaxObj.call("action=ajaxFunctions&do=getYearlyExpenseSummary&year="+y, "expenseSummary");
				}
			}

			function getSubcat(cid) {
      	// put loading.gif in
				document.getElementById('subcat').innerHTML = '<img border="0" src="images/loading.gif">';
				// call the subcat
				ajaxObj.call("action=ajaxFunctions&do=getSubcatDropdown&cid="+cid, "subcat");
			}
			
			function logIn() {
				// swap out the submit button
				submitButtonDiv = document.getElementById('formsubmit').innerHTML;
				document.getElementById('formsubmit').innerHTML = '<img border=0 src="images/loading.gif">';
				var formVars = ajaxObj.getForm('logInForm');
				// call the ajax function
				ajaxObj.call("action=ajaxFunctions&do=logIn"+formVars, logIn2);
			}

			function logIn2(resp) {
				if (resp) {
					window.location='?p=addExpense';
				} else {
					alert("We're sorry. We could not find your login information. Please try again.");
					document.getElementById('formsubmit').innerHTML = submitButtonDiv;
				}
			}
			function resetPassword() {
				pw1 = document.getElementById('pw1').value;
				pw2 = document.getElementById('pw2').value;
				if (pw1 != pw2) {
					alert("Your passwords do not match. Please try again.");
					document.getElementById('pw1').focus();
					return;
				}
				c = document.getElementById('c').value;
				submitButtonDiv = document.getElementById('formsubmit').innerHTML;
				document.getElementById('formsubmit').innerHTML = '<img border=0 src="images/loading.gif">';
				ajaxObj.call("action=ajaxFunctions&do=resetPassword&p="+pw1+"&c="+c, "formsubmit");
			}
			function sendPassword() {
				e = document.getElementById('email').value;
				if (!validEmail(e)) { alert("Please enter a valid email address."); return; }
				submitButtonDiv = document.getElementById('formsubmit').innerHTML;
				document.getElementById('formsubmit').innerHTML = '<img border=0 src="images/loading.gif">';
				ajaxObj.call("action=ajaxFunctions&do=sendPassword&e="+e, "formsubmit");
			}
			function updateAccountInfo() {
				// fname
				if (document.getElementById('fname').value == '') {
					alert("Please enter your first name.");
					document.getElementById('fname').focus();
					return;
				}
				// lname
				if (document.getElementById('lname').value == '') {
					alert("Please enter your last name.");
					document.getElementById('lname').focus();
					return;
				}
				// address
				if (document.getElementById('address').value == '') {
					alert("Please enter your address.");
					document.getElementById('address').focus();
					return;
				}
				// city
				if (document.getElementById('city').value == '') {
					alert("Please enter your city.");
					document.getElementById('city').focus();
					return;
				}
				// state
				if (document.getElementById('state').value.length != 2) {
					alert("Please enter a valid state.");
					return;
				}
				// zip
				if (document.getElementById('zip').value.length != 5 || !isNumeric(document.getElementById('zip').value)) {
					alert("Please enter a valid zip code.");
					document.getElementById('zip').focus();
					return;
				}
				// email
				if (!validEmail(document.getElementById('email').value)) { alert("Please enter a valid email address."); return; }
				// phone
				if (document.getElementById('phonearea').value.length != 3 || !isNumeric(document.getElementById('phonearea').value) ||
					document.getElementById('phone3').value.length != 3 || !isNumeric(document.getElementById('phone3').value) ||
					document.getElementById('phone4').value.length != 4 || !isNumeric(document.getElementById('phone4').value)) {
					alert("Please enter a valid phone number.");
					document.getElementById('phonearea').focus();
					return;
				}
				submitButtonDiv = document.getElementById('formsubmit').innerHTML;
				document.getElementById('formsubmit').innerHTML = '<img border=0 src="images/loading.gif">';
				var formVars = ajaxObj.getForm('updateAccountForm');				
				ajaxObj.call("action=ajaxFunctions&do=updateAccountInfo"+formVars, updateAccountInfo2);				
			}
			function updateAccountInfo2(resp) {
				if (!resp) {
					alert("We're sorry. There was an error and your account information was not updated.");
					document.getElementById('formsubmit').innerHTML = submitButtonDiv; 
				} else {
					document.getElementById('formsubmit').innerHTML = submitButtonDiv + "<br />Your account information was updated."; 
				}
			}
			
			function updateExpenseItem(lid,curAmt) {
				newAmt = prompt("Please enter the new amount for this item.",curAmt);
				if (newAmt == null || newAmt == '' || newAmt == curAmt) {
				
				} else {
					ajaxObj.call("action=ajaxFunctions&do=updateLedgerItem&lid="+lid+"&newAmt="+newAmt, updateExpenseItem2);				
				}
			}
			function updateExpenseItem2(resp) {
				getExpenseHistory(document.getElementById('expenseMonth').value);
			}

			function updateMonthlyHealthInsurancePayment() {
				val = document.getElementById('healthInsurancePayment').innerHTML
				newVal = prompt("Enter a new monthly payment for your health insurance.",val);
				if (newVal != null) {
					document.getElementById('healthInsurancePayment').innerHTML = '<img border="0" src="images/loading.gif">';
					curHealthInsurancePayment = val;
					newHealthInsurancePayment = newVal;
					ajaxObj.call("action=ajaxFunctions&do=updateHealthInsurancePayment&newVal="+newVal, updateMonthlyHealthInsurancePayment2);				
				}			
			}
			function updateMonthlyHealthInsurancePayment2(resp) {
				if (!resp.doSQL) {
					alert("We're sorry. There was an error and your information was not updated.");
					document.getElementById('healthInsurancePayment').innerHTML = curHealthInsurancePayment;
				} else {
					document.getElementById('healthInsurancePayment').innerHTML = newHealthInsurancePayment;
				}
			}
			
			function updateTrailerFinancedBy(val) {
				// call the ajax function
				ajaxObj.call("action=ajaxFunctions&do=updateTrailerFinancedBy&newVal="+val, updateTrailerFinancedBy2);				
			}
			function updateTrailerFinancedBy2(resp) {
				if (!resp) {
					alert("We're sorry. There was an error and your information was not updated.");
				} else {
					// if they have chosen 'None' or 'Paid For', set the payment to 0
					if (document.getElementById('trailer_financed_by').value == 'None' || document.getElementById('trailer_financed_by').value == 'Paid For') {
						//newTrailerPayment = 0;
						blocking('newTrailerPaymentDiv'); // open the div, because the next call closes it back up
						ajaxObj.call("action=ajaxFunctions&do=updateTrailerPayment&newVal=0", updateTrailerPayment2);
					} else {
						// the current payment is 0, prompt for a new one
						if (document.getElementById('trailerPayment').innerHTML == '0' || document.getElementById('trailerPayment').innerHTML == '0.00') {
							updateTrailerPayment();
						}
					}
				}
			}
			function updateTrailerPayment() {
				// they can't change the payment if they don't own a trailer, or it's paid for
				if (document.getElementById('trailer_financed_by').value == 'None') {
					alert("You have indicated that you do not own a trailer, so no payment can be applied. Please change the drop down indicating how your trailer is financed, then change the payment.");
					return;
				}
				if (document.getElementById('trailer_financed_by').value == 'Paid For') {
					alert("You have indicated that your trailer is paid for, so no payment can be applied. Please change the drop down indicating how your trailer is financed, then change the payment.");
					return;
				}
				val = document.getElementById('trailerPayment').innerHTML
				//newVal = prompt("Enter the new monthly payment for your trailer.",val);
				newVal = document.getElementById('newTrailerPayment').value;
				if (newVal != null) {
					document.getElementById('trailerPayment').innerHTML = '<img border="0" src="images/loading.gif">';
					//curTrailerPayment = val;
					//newTrailerPayment = newVal;
					ajaxObj.call("action=ajaxFunctions&do=updateTrailerPayment&newVal="+newVal+"&curVal="+val, updateTrailerPayment2);				
				}
			}
			function updateTrailerPayment2(resp) {
				if (!resp.doSQL) {
					alert("We're sorry. There was an error and your information was not updated.");
					document.getElementById('trailerPayment').innerHTML = resp.curVal;
				} else {
					document.getElementById('trailerPayment').innerHTML = resp.newVal;
					blocking('newTrailerPaymentDiv');
				}
			}
			function updateTruckFinancedBy(val) {
				// call the ajax function
				ajaxObj.call("action=ajaxFunctions&do=updateTruckFinancedBy&newVal="+val, updateTruckFinancedBy2);				
			}
			function updateTruckFinancedBy2(resp) {
				if (!resp) {
					alert("We're sorry. There was an error and your information was not updated.");
				} else {
					// if they have chosen 'None' or 'Paid For', set the payment to 0
					if (document.getElementById('truck_financed_by').value == 'None' || document.getElementById('truck_financed_by').value == 'Paid For') {
						//newTruckPayment = 0;
						curVal = document.getElementById('truckPayment').innerHTML;
						blocking('newTruckPaymentDiv'); // open the div, because the next call closes it back up
						ajaxObj.call("action=ajaxFunctions&do=updateTruckPayment&newVal=0&curVal="+curVal, updateTruckPayment2);
					} else {
						// the current payment is 0, prompt for a new one (open the div)
						if (document.getElementById('truckPayment').innerHTML == '0' || document.getElementById('truckPayment').innerHTML == '0.00') {
							//updateTruckPayment();
							blocking('newTruckPaymentDiv');
						}
					}
				}
			}
			function updateTruckPayment() {
				// they can't change the payment if they don't own a truck, or it's paid for
				if (document.getElementById('truck_financed_by').value == 'None') {
					alert("You have indicated that you do not own a truck, so no payment can be applied. Please change the drop down indicating how your truck is financed, then change the payment.");
					return;
				}
				if (document.getElementById('truck_financed_by').value == 'Paid For') {
					alert("You have indicated that your truck is paid for, so no payment can be applied. Please change the drop down indicating how your truck is financed, then change the payment.");
					return;
				}
				val = document.getElementById('truckPayment').innerHTML
				// record the current truck payment
				//newVal = prompt("Enter the new monthly payment for your truck.",val);
				newVal = document.getElementById('newTruckPayment').value;
				if (newVal != null) {
					document.getElementById('truckPayment').innerHTML = '<img border="0" src="images/loading.gif">';
					//curTruckPayment = val;
					//newTruckPayment = newVal;
					ajaxObj.call("action=ajaxFunctions&do=updateTruckPayment&newVal="+newVal+"&curVal="+val, updateTruckPayment2);				
				}
			}
			function updateTruckPayment2(resp) {
				if (!resp.doSQL) {
					alert("We're sorry. There was an error and your information was not updated.");
					document.getElementById('truckPayment').innerHTML = resp.curVal;
				} else {
					document.getElementById('truckPayment').innerHTML = resp.newVal;
					blocking('newTruckPaymentDiv');
				}
			}
			function updateVehicleInfo() {
				// error checking
				if (document.getElementById('year').value == "") { 
					alert("Please enter the year the vehicle was made."); 
					document.getElementById('year').focus();
					return;
				}
				if (!isNumeric(document.getElementById('year').value) && document.getElementById('year').value.length != 4) { 
					alert("Please enter a valid year for the vehicle."); 
					document.getElementById('year').focus();
					return;
				}
				if (!document.getElementById('make_model') || document.getElementById('make_model').value == "") { 
					alert("Please enter the make and model of this vehicle."); 
					document.getElementById('make_model').focus();
					return;
				}
				if (getRadioValue('leased') == 1 && !isNumeric(document.getElementById('lease_payment').value)) {
					alert("Please enter amount of your lease payment for this vehicle."); 
					document.getElementById('lease_amount').focus();
					return;				
				}
				// swap out the submit button
				submitButtonDiv = document.getElementById('formsubmit').innerHTML;
				document.getElementById('formsubmit').innerHTML = '<img border=0 src="images/loading.gif">';
				var formVars = ajaxObj.getForm('updateVehicleForm');
				// call the ajax function
				ajaxObj.call("action=ajaxFunctions&do=updateVehicle"+formVars, updateVehicle2);
			}
			
			function updateVehicle2(resp) {
				if (resp) {
					window.location.href='?p=myVehicles';
				} else {
					alert("We're sorry. There was an error and your vehicle information was not updated.");
					document.getElementById('formsubmit').innerHTML = submitButtonDiv;
				}
			}
			
