	function savEstimate(a,b,c,d,e)
{
  var formIsValid=true;
//  var errorMessages="Your input could not be submitted because of the following errors:\n"
  var errorMessages="Some of the required form fields have been left blank.\n\Please complete all of the required form inputs.\n\Thank you.\n"
  var targetLocation = "/save/save-on-library-automation.asp?show-savings=a"
			re = /^\$|,/g;
		
	a = document.saveIt.titles.value;
	b = document.saveIt.stations.value;
		// remove "$" and ","
		b = b.replace(re, "");
		bb = b.split(".") //get rid of every thing to the right of the decimal
		b = bb[0]
	c = document.saveIt.sites.value;
		c = c.replace(re, "");
		cc = c.split(".") //get rid of every thing to the right of the decimal
		c = cc[0]
	d = document.saveIt.vendor.value;
	e = document.saveIt.cost.value;
		e = e.replace(re, "");
		ee = e.split(".") //get rid of every thing to the right of the decimal
		e = ee[0]

	numStat=0
	numSites=0

  if (IsNumeric(a) && IsNumeric(b) && IsNumeric(c) && IsNumeric(e) ) {
	a = eval(a);
	b = eval(b);
	c = eval(c);
	e = eval(e);
  	}
  else {
	errorMessages+="\n-Number of Stations, Number of Sites and Current Yearly Cost must be numeric";
	formIsValid=false;
	}
  if(!formIsValid)
  {
    alert(errorMessages);
    return false;
  }
  else
  {	
	//saveIt.submit();
//		targetLocation += "&titles="+a+"&stations="+b+"&sites="+c+"&vendor="+d+"&cost="+e+"";
		document.saveIt.action = targetLocation;
	return true;
  }

 }
function validateText() {
var formIsValid=true;
//  var errorMessages="Your input could not be submitted because of the following errors:\n"
var errorMessages="Some of the required form fields have been left blank.\n\Please complete all of the required form inputs.\n\Thank you.\n"
var targetLocation = "/save/your-savings.asp"
  if(document.saveIt2.library.value=="")
  {
    errorMessages+="\n-Library Name is required";
	formIsValid=false;
  }
  if(document.saveIt2.name.value=="")
  {
    errorMessages+="\n-Contact Name is required";
	formIsValid=false;
  }
//  if(document.saveIt.phone.value=="")
//   {
//     errorMessages+="\n-Phone is required";
//	 formIsValid=false;
//   }
  if(document.saveIt2.email.value=="")
   {
     errorMessages+="\n-Email is required";
	 formIsValid=false;
   }
  else
  {
     if(!validateEmail(document.saveIt2.email.value))
	 {
	   errorMessages+="\n-Email doesn't appear to be valid.";
	   formIsValid=false;
	 }
  }
   
  if(!formIsValid)
  {
    alert(errorMessages);
    return false;
  }
  else
  {	
	//saveIt.submit();
//		targetLocation += "&titles="+a+"&stations="+b+"&sites="+c+"&vendor="+d+"&cost="+e+"";
		document.saveIt2.action = targetLocation;
	return true;
  }
}

function validateEmail(email)
{
  return !(email.indexOf("@")==-1 || email.indexOf(".")==-1);
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
