/*************************************************************************
*                                                                        *
*  Program Name :  fedex                                                 *
*          Type :  javascript                                            *
*     File Type :  .js                                                   *
*      Location :  /www/golfsmith/                                       *
*    Created By :  Janna Cilindro                                        *
*  Created Date :  12/17/2008                                            *
*               :  Copyright 2005-20**  Golfsmith International          *
*------------------------------------------------------------------------*
*   Order Details specific functions                                     *
*------------------------------------------------------------------------*
*   Called From :                                                        *
*                                                                        *
*   Form Action :  None                                                  *
*                                                                        *
* Funcitons used:  None                                                  *
*                                                                        *
* Functions created:  AcceptAddress                                      *
*                     DeclineAddress                                     *
*                                                                        *
* Database Objects Used : None                                           *
*                                                                        *
* Required _SESSION  variables : None                                    *
* Required _POST  variables    : None                                    *
*                                                                        *
* History:                                                               *
* --------                                                               *
* Date       By                  Comments                                *
* ---------- ---------------     --------------------                    *
* 12/17/2008 Janna Cilindro      Initial Version                         *
*                                                                        *
**************************************************************************/

function AcceptAddress(add1, add2, city, state, pcode, country, addtype, type)
{
 if (type == "1")
 {
    document.register.FedExVerify.value = "N";
    document.register.addr1_bill.value = add1;
    document.register.addr2_bill.value = add2;
    document.register.city_bill.value = city;
    document.register.state_bill.value = state;
    document.register.pcode_bill.value = pcode;
    document.register.country_bill.value = country;
    document.register.FedExAddType.value = addtype;
    document.register.FedExAcceptAdd.value = "Y";
 }
 else if (type == "2")
 {
    document.register.FedExVerify.value = "N";
    document.register.addr1.value = add1;
    document.register.addr2.value = add2;
    document.register.city.value = city;
    document.register.state.value = state;
    document.register.pcode.value = pcode;
    document.register.country.value = country;
    document.register.FedExAddType.value = addtype;
    document.register.FedExAcceptAdd.value = "Y";
 }
 else if (type == "3")
 {
    document.address_select.FedExVerify.value = "N";
    document.address_select.addr1.value = add1;
    document.address_select.addr2.value = add2;
    document.address_select.city.value = city;
    document.address_select.state.value = state;
    document.address_select.pcode.value = pcode;
    document.address_select.country.value = country;
    document.address_select.FedExAddType.value = addtype;
    document.address_select.fnm.value = "update_address" ;
    document.address_select.FedExAcceptAdd.value = "Y";
 }
 else
 {
    document.payments.FedExAcceptAdd.value = "Y";
    document.payments.FedExVerify.value = "N";
 }

}




function DeclineAddress(type)
{
  if (type == "3")
  {
    document.address_select.FedExVerify.value = "N";
    document.address_select.FedExDeclineAdd.value = "Y";
    if (document.address_select.FedExAddType != null)
    {
      document.address_select.FedExAddType.value = "UNDETERMINED";
    }
    document.address_select.fnm.value = "update_address" ;
  }
  else if (type == "1")
  {
    document.register.FedExVerify.value = "N";
    document.register.FedExDeclineAdd.value = "Y";
    if (document.register.FedExAddType != null)
    {
       document.register.FedExAddType.value = "UNDETERMINED";
    }
  }
  else if (type == "2")
  {
    document.register.FedExVerify.value = "N";
    document.register.FedExDeclineAdd.value = "Y";
    if (document.register.FedExAddType != null)
    {
      document.register.FedExAddType.value = "UNDETERMINED";
    }
  }
  else
  {
    document.payments.FedExVerify.value = "N";
    document.payments.FedExDeclineAdd.value = "Y";
    document.payments.FedExAddType.value = "UNDETERMINED";
  }
  
}
