	
function Validator(smartform)
{
  var error = ""; 
   if (smartform.email.value == "")
  {
    error += "Your email address is required information and this form cannot be submitted without it. Please enter a valid email address at the top of this form in the Email Address form field.  This will prevent you from losing all of your information.\n";
  }
  if ((smartform.email.value.indexOf ('@',0) == -1 ||
   smartform.email.value.indexOf ('.',0) == -1) &&
   smartform.email.value != "")
  {
    error += "You must include an accurate email address. Use the following format: username@domain.com";
  } 

  if (smartform.b_first_name.value == "")
  {
	error += "Your first name is a required field.\n"
  }
  if (smartform.b_last_name.value == "")
  {
	error += "Your last name is a required field.\n"
  }
  if (smartform.b_phone.value == "")
  {
	error += "Your telephone number is a required field.\n"
  }
	
if (error != "")
  {
    alert(error);
    return (false);
  } else {
    return (true);
  } 
}

function validateInfoRequest(InfoForm)
{
	var error = "";
	if (InfoForm.nameField.value == "")
	{
		error += "Your name is required information.\n"
	}
	
	if (InfoForm.email.value == "")
	{
		error += "Your email address is required information.\n"
	}
	if ((InfoForm.email.value.indexOf ('@',0) == -1 ||
   		InfoForm.email.value.indexOf ('.',0) == -1) &&
   		InfoForm.email.value != "")
  	{
    		error += "You must include an accurate email address. Use the following format: username@domain.com";
  	}
	
	if (error != "")
  	{
    		alert(error);
    		return (false);
  	} else {
    		return (true);
  	} 
}


function validateInfoRequest2(InfoForm)
{
	var error = "";
	
	if (InfoForm.email.value == "")
	{
		error += "Your email address is required information.\n"
	}
	if ((InfoForm.email.value.indexOf ('@',0) == -1 ||
   		InfoForm.email.value.indexOf ('.',0) == -1) &&
   		InfoForm.email.value != "")
  	{
    		error += "You must include an accurate email address. Use the following format: username@domain.com";
  	}
	
	if (InfoForm.firstname.value == "")
  {
	error += " Your first name is a required field.\n"
  }
  if (InfoForm.lastname.value == "")
  {
	error += " Your last name is a required field.\n"
  }
	
	
	
	if (error != "")
  	{
    		alert(error);
    		return (false);
  	} else {
    		return (true);
  	} 
}

//nextfield = "email";
//netscape = "";
//ver = navigator.appVersion; len = ver.length;
//for(iln = 0; iln < len; iln++) if (ver.charAt(iln) == "(") break;
//netscape = (ver.charAt(iln+1).toUpperCase() != "C");

function keyDown(DnEvents) { 
k = (netscape) ? DnEvents.which : window.event.keyCode;
if (k == 13) { 
if (nextfield == 'done') return true; 
else { 
eval('document.smartform.' + nextfield + '.focus()');
return false;
      }
   }
}

//document.onkeydown = keyDown; // work together to analyze keystrokes
//if (netscape) document.captureEvents(Event.KEYDOWN|Event.KEYUP);


//function floor(number)
//{
//  return Math.floor(number*Math.pow(10,2))/Math.pow(10,2);
//}

function Fix(number) {
        return(Math.round(number*10000000)/10000000);
}

var b_res_street = "";
var b_res_city = "";
var b_res_state = "";
var b_res_zip = "";
var cb_res_street = "";
var cb_res_city = "";
var cb_res_state = "";
var cb_res_zip = "";
var cb_phone = "";
var cb_married = "";
var cb_separated = "";
var cb_unmarried = "";
var cb_own_home = "";
var cb_rent_home = "";
var cb_yrs_at_res = "";

function InitSaveVariables (form){
b_res_street = form.b_res_street.value;
b_res_city = form.b_res_city.value;
b_res_state = form.b_res_state.value;
b_res_zip = form.b_res_zip.value;
cb_phone = form.cb_phone.value;
cb_married = form.Co_MaritalStatus.checked;
cb_separated = form.Co_MaritalStatus.checked;
cb_unmarried = form.Co_MaritalStatus.checked;
cb_own_home = form.Co_Ownership.checked;
cb_rent_home = form.Co_Ownership.checked;
cb_yrs_at_res = form.cb_yrs_at_res.value;

}

function duplicate (form){
if (form.copy.checked) {
InitSaveVariables (form);
form.b_res_street.value = form.subj_prop_street.value;
form.b_res_city.value = form.subj_prop_city.value;
form.b_res_state.value = form.subj_prop_state.value;
form.b_res_zip.value = form.subj_prop_zip.value;
}
else {
form.b_res_street.value = b_res_street;
form.b_res_city.value = b_res_city;
form.b_res_state.value = b_res_state;
form.b_res_zip.value = b_res_zip;
   }
}

function duplicate2 (form){
if (form.copy2.checked) {
InitSaveVariables (form);
form.cb_res_street.value = form.b_res_street.value;
form.cb_res_city.value = form.b_res_city.value;
form.cb_res_state.value = form.b_res_state.value;
form.cb_res_zip.value = form.b_res_zip.value;
form.cb_phone.value = form.b_phone.value;
form.Co_MaritalStatus.checked = form.Borr_MaritalStatus.checked;
form.Co_MaritalStatus.checked = form.Borr_MaritalStatus.checked;
form.Co_MaritalStatus.checked = form.Borr_MaritalStatus.checked;
form.Co_Ownership.checked = form.Borr_Ownership.checked;
form.Co_Ownership.checked = form.Borr_Ownership.checked;
form.cb_yrs_at_res.value = form.b_yrs_at_res.value;

}
else {
form.cb_res_street.value = cb_res_street;
form.cb_res_city.value = cb_res_city;
form.cb_res_state.value = cb_res_state;
form.cb_res_zip.value = cb_res_zip;
form.cb_phone.value = cb_phone;
form.Co_MaritalStatus.checked = cb_married;
form.Co_MaritalStatus.checked = cb_separated;
form.Co_MaritalStatus.checked = cb_unmarried;
form.Co_Ownership.checked = cb_own_home;
form.Co_Ownership.checked = cb_rent_home;
form.cb_yrs_at_res.value = cb_yrs_at_res;

   }
}

function calcasset(form) {

	if ( TE_digit(form.bank_amount_one.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Cash or Market Value field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	if ( TE_digit(form.bank_amount_two.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Cash or Market Value field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	if ( TE_digit(form.bank_amount_three.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Cash or Market Value field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	if ( TE_digit(form.bank_amount_four.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Cash or Market Value field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	if ( TE_digit(form.stock_value_one.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Cash or Market Value field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	if ( TE_digit(form.stock_value_two.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Cash or Market Value field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	if ( TE_digit(form.retirement_fund_value.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Vested Interest in Retirement Fund field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	if ( TE_digit(form.business_owned_value.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Net Worth Of Business(es) Owned field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	if ( TE_digit(form.auto_one_value.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Cash or Market Value field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	if ( TE_digit(form.auto_two_value.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Cash or Market Value field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	if ( TE_digit(form.auto_three_value.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Cash or Market Value field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	if ( TE_digit(form.other_assets_value_one.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Cash or Market Value field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	if ( TE_digit(form.other_assets_value_two.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Cash or Market Value field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	if ( TE_digit(form.other_assets_value_three.value) == false) {
              alert("OOPS!  Only numeric characters (0 through 9) or a decimal point (.) are allowed in the Cash or Market Value field!  Please go back and remove any comma's (,) or dollar signs ($) from this field.");
              return false;                     }

	form.subtotal_liquid_assets.value = Fix(eval((form.bank_amount_one.value-0) + (form.bank_amount_two.value-0) + (form.bank_amount_three.value-0) + (form.bank_amount_four.value-0) + (form.stock_value_one.value-0) + (form.stock_value_two.value-0)));

	form.total_auto_value.value = Fix(eval((form.auto_one_value.value-0) + (form.auto_two_value.value-0) + (form.auto_three_value.value-0)));
	
	form.total_other_assets.value = Fix(eval((form.other_assets_value_one.value-0) + (form.other_assets_value_two.value-0) + (form.other_assets_value_three.value-0)));

	form.total_all_assets.value = Fix(eval((form.subtotal_liquid_assets.value-0) + (form.retirement_fund_value.value-0) + (form.business_owned_value.value-0) + (form.total_auto_value.value-0) + (form.total_other_assets.value-0)));

	return true;

}


function TE_digit(element) {
         var alpha = "~`!@#$%^&*()_+|-=\{}[]:\;'<>,/?abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

         for ( var o = 0; o < element.length; o++) {
               for ( var i = 0; i < alpha.length; i++) {  
                if ( element.charAt(o) == alpha.charAt(i) ) { return false;} 
                                                      }   
                                                   }
         return true;
                           }



function MM_preloadImages() { //v2.0

  if (document.images) {

    var imgFiles = MM_preloadImages.arguments;

    if (document.preloadArray==null) document.preloadArray = new Array();

    var i = document.preloadArray.length;

    with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){

      preloadArray[i] = new Image;

      preloadArray[i++].src = imgFiles[j];

  } }

}



function MM_swapImgRestore() { //v2.0

  if (document.MM_swapImgData != null)

    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)

      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];

}



function MM_swapImage() { //v2.0

  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;

  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {

    objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];

    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||

        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))

      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);

    obj = eval(objStr);

    if (obj != null) {

      swapArray[j++] = obj;

      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];

      obj.src = MM_swapImage.arguments[i+2];

  } }

  document.MM_swapImgData = swapArray; //used for restore

}



function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}