// Copyright (c) 2009 Asset Web Design.  All rights reserved.
// Pearland, Texas 77581
// 281-412-3539
// www.asset-web.com


//-- functions --------------------------------------------------
//---------------------------------------------------------------

function AdvAutoFillMailingAddress (theForm)
  {
  theForm.sMailingAddressStreet.value          = theForm.sStreetAddressStreet.value;
  theForm.sMailingAddressStreet2.value         = theForm.sStreetAddressStreet2.value;
  theForm.sMailingAddressCity.value            = theForm.sStreetAddressCity.value;
  theForm.iMailingAddressStateID.selectedIndex = theForm.iStreetAddressStateID.selectedIndex;
  theForm.sMailingAddressZipCode.value         = theForm.sStreetAddressZipCode.value;

  return (true);
  }


//---------------------------------------------------------------

function AdvAutoFillToday (cboMonth, cboDay, cboYear) 
  {
  var i;
  var iLength;

  var dNow;  
  var iMonth;
  var iDay;
  var iYear;

  // init
  dNow = new Date ();
  iMonth = dNow.getMonth () + 1;
  iDay   = dNow.getDate ();
  iYear  = dNow.getFullYear ();
  
  // month
  iLength = cboMonth.length;

  for (i=0; i<iLength; i++)
    if (cboMonth.options[i].value == iMonth)
      {
      // found it!
      cboMonth.selectedIndex = i;
      }
    
  // day
  iLength = cboDay.length;
  
  for (i=0; i<iLength; i++)
    if (cboDay.options[i].value == iDay)
      {
      // found it!
      cboDay.selectedIndex = i;
      }
    
  // year
  iLength = cboYear.length;

  for (i=0; i<iLength; i++)
    if (cboYear.options[i].value == iYear)
      {
      // found it!
      cboYear.selectedIndex = i;
      }
    
  return (true);
  }
  



