	function validateMortgageCalc()
	{
	    var loan_amt = document.getElementById('inp_loan_amount').value;
	    var num_years = document.getElementById('inp_years').value; 
	    var int_rate = document.getElementById('inp_interest_rate').value;
	    
	    //clean up loan amount
	    var clean_loan_amt = sterilizeCurrencyInput(loan_amt);
	    loan_amt = clean_loan_amt;
		document.getElementById('inp_loan_amount').value = loan_amt;
		
	    var errors = false;
	    var errortext = 'There was a problem with your submission... \n\n';
	    
   	   	/* test loan amount - is not empty, is numeric, is not zero */
	    if (loan_amt == "") {
	    		errortext = errortext + '* Loan Amount is required. \n'; 
	    		errors = true;
	    } else {
	    	if (!IsNumeric(loan_amt)) {
	    		errortext = errortext + '* Loan Amount must be a number. \n'; 
	    		errors = true;
	    	} else {
	    		if (loan_amt == 0) {
	    			errortext = errortext + '* Loan Amount cannot be zero. \n'; 
	    			errors = true;
	    		}
	    	}
	    }	 
	    
	   	/* test years - is not empty, is numeric */
	    if (num_years == "") {
	    		errortext = errortext + '* Years is required. \n'; 
	    		errors = true;
	    } else {
	    	if (!IsNumeric(num_years)) {
	    		errortext = errortext + '* Years must be a number. \n'; 
	    		errors = true;
	    	} else {
	    		if (num_years == 0) {
	    			errortext = errortext + '* Years cannot be zero. \n'; 
	    			errors = true;
	    		}
	    	}
	    }	
	    
	   /* test interest rate - is not empty, is numeric, is between 0 and 100 */
	    if (int_rate == "") {
	    		errortext = errortext + '* Annual Interest Rate is required. \n'; 
	    		errors = true;
	    } else {
	    	if (!IsNumeric(int_rate)) {
	    		errortext = errortext + '* Annual Interest Rate must be a number. \n'; 
	    		errors = true;
	    	} else {
	    		if (int_rate <= 0 || int_rate > 100) {
	    			errortext = errortext + '* Annual Interest Rate must be between 0 and 100. \n'; 
	    			errors = true;
	    		}
	    	}
	   }	 
	    
	    /* testing done - if errors, show them and don't calculate.  if not, tell it to run it through */
	    if (errors == true) {
	    	errortext = errortext + '\nPlease correct these issues and try again. \n'; 
	    	alert(errortext);
	   		return false;
	    } else {
	    	return true;
	    }
	}

	function validateAutoLoanCalc()
	{
	    var loan_amt = document.getElementById('inp_auto_loan_amount').value;
	    var num_months = document.getElementById('inp_months').value; 
	    var int_rate = document.getElementById('inp_interest_rate').value;
	    
	    //clean up loan amount
	    var clean_loan_amt = sterilizeCurrencyInput(loan_amt);
	    loan_amt = clean_loan_amt;
		document.getElementById('inp_auto_loan_amount').value = loan_amt;
	    
	    var errors = false;
	    var errortext = 'There was a problem with your submission... \n\n';
	    
   	   	/* test loan amount - is not empty, is numeric, is not zero */
	    if (loan_amt == "") {
	    		errortext = errortext + '* Loan Amount is required. \n'; 
	    		errors = true;
	    } else {
	    	if (!IsNumeric(loan_amt)) {
	    		errortext = errortext + '* Loan Amount must be a number. \n'; 
	    		errors = true;
	    	} else {
	    		if (loan_amt == 0) {
	    			errortext = errortext + '* Loan Amount cannot be zero. \n'; 
	    			errors = true;
	    		}
	    	}
	    }	 
	 
	   	/* test months - is not empty, is numeric */
	    if (num_months == "") {
	    		errortext = errortext + '* Months is required. \n'; 
	    		errors = true;
	    } else {
	    	if (!IsNumeric(num_months)) {
	    		errortext = errortext + '* Months must be a number. \n'; 
	    		errors = true;
	    	} else {
	    		if (num_months == 0) {
	    			errortext = errortext + '* Months cannot be zero. \n'; 
	    			errors = true;
	    		}
	    	}
	    }	
	 	    
	   /* test interest rate - is not empty, is numeric, is between 0 and 100 */
	    if (int_rate == "") {
	    		errortext = errortext + '* Interest Rate is required. \n'; 
	    		errors = true;
	    } else {
	    	if (!IsNumeric(int_rate)) {
	    		errortext = errortext + '* Interest Rate must be a number. \n'; 
	    		errors = true;
	    	} else {
	    		if (int_rate <= 0 || int_rate > 100) {
	    			errortext = errortext + '* Interest Rate must be between 0 and 100. \n'; 
	    			errors = true;
	    		}
	    	}
	   }	 
	    
	    /* testing done - if errors, show them and don't calculate.  if not, tell it to run it through */
	    if (errors == true) {
	    	errortext = errortext + '\nPlease correct these issues and try again. \n'; 
	    	alert(errortext);
	   		return false;
	    } else {
	    	return true;
	    }
	}

	function validateInvestmentCalc()
	{
	    var deposit = document.getElementById('inp_initial_deposit').value;
	    var num_months = document.getElementById('inp_months').value; 
	    var int_rate = document.getElementById('inp_interest_rate').value;
	    
	    //clean up deposit
	    var clean_deposit = sterilizeCurrencyInput(deposit);
	    deposit = clean_deposit;
		document.getElementById('inp_initial_deposit').value = deposit;
	    
	    var errors = false;
	    var errortext = 'There was a problem with your submission... \n\n';
	    
   	   	/* test deposit - is not empty, is numeric */
	    if (deposit == "") {
	    		errortext = errortext + '* Deposit is required. \n'; 
	    		errors = true;
	    } else {
	    	if (!IsNumeric(deposit)) {
	    		errortext = errortext + '* Deposit must be a number. \n'; 
	    		errors = true;
	    	} else {
	    		if (deposit == 0) {
	    			errortext = errortext + '* Deposit cannot be zero. \n'; 
	    			errors = true;
	    		}
	    	}
	    }	 
	    
	   	/* test months - is not empty, is numeric */
	    if (num_months == "") {
	    		errortext = errortext + '* Term is required. \n'; 
	    		errors = true;
	    } else {
	    	if (!IsNumeric(num_months)) {
	    		errortext = errortext + '* Term must be a number. \n'; 
	    		errors = true;
	    	} else {
	    		if (num_months == 0) {
	    			errortext = errortext + '* Term cannot be zero. \n'; 
	    			errors = true;
	    		}
	    	}
	    }	
	    
	   /* test interest rate - is not empty, is numeric, is between 0 and 100 */
	    if (int_rate == "") {
	    		errortext = errortext + '* Annual Interest Rate is required. \n'; 
	    		errors = true;
	    } else {
	    	if (!IsNumeric(int_rate)) {
	    		errortext = errortext + '* Annual Interest Rate must be a number. \n'; 
	    		errors = true;
	    	} else {
	    		if (int_rate <= 0 || int_rate > 100) {
	    			errortext = errortext + '* Annual Interest Rate must be between 0 and 100. \n'; 
	    			errors = true;
	    		}
	    	}
	   }	 
	    
	    /* testing done - if errors, show them and don't calculate.  if not, tell it to run it through */
	    if (errors == true) {
	    	errortext = errortext + '\nPlease correct these issues and try again. \n'; 
	    	alert(errortext);
	   		return false;
	    } else {
	    	return true;
	    }
	}

	function validateCollegeSavingsCalc() 
	{
	    var int_rate = document.getElementById('inp_interest_rate').value;
	    var start_balance = document.getElementById('inp_starting_balance').value; 
	    var sav_goal = document.getElementById('inp_savings_goal').value;
	    var num_years = document.getElementById('inp_years_to_save').value;
	    
		//clean up start balance
	    var clean_start_balance = sterilizeCurrencyInput(start_balance);
	    start_balance = clean_start_balance;
		document.getElementById('inp_starting_balance').value = start_balance;    
	    
		//clean up savings goal
	    var clean_sav_goal = sterilizeCurrencyInput(sav_goal);
	    sav_goal = clean_sav_goal;
		document.getElementById('inp_savings_goal').value = sav_goal;    
	    
	    var errors = false;
	    var savings_errors = false;
	    var errortext = 'There was a problem with your submission... \n\n';
	   
	   
	   
	   /* test interest rate - is not empty, is numeric, is between 0 and 100 */
	    if (int_rate == "") {
	    		errortext = errortext + '* Interest Rate is required. \n'; 
	    		errors = true;
	    } else {
	    	if (!IsNumeric(int_rate)) {
	    		errortext = errortext + '* Interest Rate must be a number. \n'; 
	    		errors = true;
	    	} else {
	    		if (int_rate <= 0 || int_rate > 100) {
	    			errortext = errortext + '* Interest Rate must be between 0 and 100. \n'; 
	    			errors = true;
	    		}
	    	}
	   }
	   
	   	/* test starting balance - is not empty, is numeric */
	    if (start_balance == "") {
	    	document.getElementById('inp_starting_balance').value = 0;
	    } else {
	    	if (!IsNumeric(start_balance)) {
	    		errortext = errortext + '* Starting Balance must be a number. \n'; 
	    		savings_errors = true;
	    		errors = true;
	    	}
	    }	    
	    
	   /* test savings goal - is not empty, is numeric, not zero */
	    if (sav_goal == "") {
	    		errortext = errortext + '* Savings Goal is required. \n'; 
	    		errors = true;
	    		savings_errors = true;
	    } else {
	    	if (!IsNumeric(sav_goal)) {
	    		errortext = errortext + '* Savings Goal must be a number. \n'; 
	    		errors = true;
	    		savings_errors = true;
	    	} else {
	    		if (sav_goal == 0) {
	    			errortext = errortext + '* Savings Goal cannot be zero. \n'; 
	    			errors = true;
	    			savings_errors = true;
	    		}
	    	}
	    }	  	    
	    
	//    alert('start: ' + Number(start_balance));	    alert('gaol: ' + Number(sav_goal));
	    
	   /* if no savings errors to this point - be sure that current savings <  target savings */
		if (savings_errors == false)
		{
			if (start_balance >= sav_goal)
			{
	    		errortext = errortext + '* Savings Goal must be larger than Start Balance. \n'; 
	    		errors = true;
			}
		}
	   
	   	/* test years to save - is not empty, is numeric */
	    if (num_years == "") {
	    		errortext = errortext + '* Years to Save is required. \n'; 
	    		errors = true;
	    } else {
	    	if (!IsNumeric(num_years)) {
	    		errortext = errortext + '* Years to Save must be a number. \n'; 
	    		errors = true;
	    	}
	    }	
	   
	    /* testing done - if errors, show them and don't calculate.  if not, tell it to run it through */
	    if (errors == true) {
	    	errortext = errortext + '\nPlease correct these issues and try again. \n'; 
	    	alert(errortext);
	   		return false;
	    } else {
	    	return true;
	    }
	      
	}

	function validateTaxSurvey() 
	{
	    var response = document.getElementById('slct_response').value;
	    
	 	var errors = false;
	//    var errortext = 'There was a problem with your submission... \n';
	    
	   /* test response - is not empty */
	    if (response == "") {
	    	errortext = 'Please select a response before submitting. \n'; 
	    	errors = true;
	    }
	    
	    /* testing done - if errors, show them and don't calculate.  if not, tell it to run it through */
	    if (errors == true) {
	    	alert(errortext);
	   		return false;
	    } else {
	    	return true;
	    }
	}

	function validateRetirementCalc() 
	{
	
	    var curr_age = document.getElementById('inp_current_age').value;
	    var targ_age = document.getElementById('inp_target_retirement_age').value; 
	    var curr_savings = document.getElementById('inp_current_savings').value;
	    var targ_savings = document.getElementById('inp_target_savings').value;
	    var return_rate = document.getElementById('inp_return_on_savings').value;
	    
	    //clean up current savings
	    var clean_curr_savings = sterilizeCurrencyInput(curr_savings);
	    curr_savings = clean_curr_savings;
		document.getElementById('inp_current_savings').value = curr_savings;    
	    
	    //clean up target savings
	    var clean_targ_savings = sterilizeCurrencyInput(targ_savings);
	    targ_savings = clean_targ_savings;
		document.getElementById('inp_target_savings').value = targ_savings;    
		
	    var errors = false;
	    var savings_errors = false;
	    var errortext = 'There was a problem with your submission... \n\n';
	   
	   /* test current age - is not empty, is numeric, is between 1 and 105 */
	    if (curr_age == "") {
	    	errortext = errortext + '* Current Age is required.. \n'; 
	    	errors = true;
	    } else {
	    	if (!IsNumeric(curr_age)) {
	    		errortext = errortext + '* Current Age must be a number. \n'; 
	    		errors = true;
	    	} else {
	    		if (curr_age < 1 || curr_age > 105) {
	    			errortext = errortext + '* The Current Age you entered is not within an acceptable range. \n'; 
	    			errors = true;
	    		}
	    	}
	    }
	    
	   /* test target retirement age - is not empty, is numeric, is between 1 and 105 */
	    if (targ_age == "") {
	    	errortext = errortext + '* Target Retirement Age is required. \n'; 
	    	errors = true;
	    } else {
	    	if (!IsNumeric(targ_age)) {
	    		errortext = errortext + '* Target Retirement Age must be a number. \n'; 
	    		errors = true;
	    	} else {
	    		if (targ_age < 1 || targ_age > 105) {
	    			errortext = errortext + '* The Target Retirement Age you entered is not within an acceptable range. \n'; 
	    			errors = true;
	    		}
	    	}
	    }

	   /* if no errors to this point - be sure that current age <  target age */
		if (errors == false)
		{
			if (curr_age > targ_age)
			{
	    		errortext = errortext + '* Your Target Retirement Age must be larger than your Current Age. \n'; 
	    		errors = true;
			}
		}
	    
	   /* test current savings - is not empty, is numeric */
	    if (curr_savings == "") {
	    	document.getElementById('inp_current_savings').value = 0;
	    } else {
	    	if (!IsNumeric(curr_savings)) {
	    		errortext = errortext + '* Current Savings must be a number. \n'; 
	    		savings_errors = true;
	    		errors = true;
	    	}
	    }	    
	    
	   /* test target savings - is not empty, is numeric */
	    if (targ_savings == "") {
	    		errortext = errortext + '* Target Savings is required. \n'; 
	    		errors = true;
	    		savings_errors = true;
	    } else {
	    	if (!IsNumeric(targ_savings)) {
	    		errortext = errortext + '* Target Savings must be a number. \n'; 
	    		errors = true;
	    		savings_errors = true;
	    	} else {
	    		if (targ_savings == 0) {
	    			errortext = errortext + '* Target Savings cannot be zero. \n'; 
	    			errors = true;
	    			savings_errors = true;
	    		}
	    	}
	    }	  	    
	    
	   /* if no savings errors to this point - be sure that current savings <  target savings */
		if (savings_errors == false)
		{
			if (curr_savings >= targ_savings)
			{
	    		errortext = errortext + '* Your Target Savings amount must be larger than your Current Savings amount. \n'; 
	    		errors = true;
			}
		}

	   /* test return on savings rate - is not empty, is numeric, is between 0 and 100 */
		 if (return_rate == "") {
		 		errortext = errortext + '* Return on Savings is required. \n'; 
		 		errors = true;
		 } else {
		 	if (!IsNumeric(return_rate)) {
		 		errortext = errortext + '* Return on Savings must be a number. \n'; 
		 		errors = true;
		 	} else {
		 		if (return_rate <= 0 || return_rate > 100) {
		 			errortext = errortext + '* Return on Savings must be between 0 and 100. \n'; 
		 			errors = true;
		 		}
		 	}
		}	   
	    
	    /* testing done - if errors, show them and don't calculate.  if not, tell it to run it through */
	    if (errors == true) {
	    	errortext = errortext + '\nPlease correct these issues and try again. \n'; 
	    	alert(errortext);
	   		return false;
	    } else {
	    	return true;
	    }
	}
	
	function sterilizeCurrencyInput(input)
	{
		var newstr = input.replace(',','');
		var newstr2 = newstr.replace(',','');
		var newstr3 = Number(newstr2.replace('$',''));
		return newstr3;
	}
	
	
	function IsNumeric(sText)
	{
		var ValidChars = "0123456789.";
		var IsNumber=true;
		var Char;
		 
		for (i = 0; i < sText.length && IsNumber == true; i++) 
		{ 
			Char = sText.charAt(i); 
			if (ValidChars.indexOf(Char) == -1) 
			{
				IsNumber = false;
			}
		}
		return IsNumber;
	}	