// Copyright© 2001-2004 New Vintage Software Inc.
//----------------------------------------------------------------


//----------------------------------------------------------------------
// Account  (assumes ValidateShippingAddress,ValidateBillingAddress and ValidateBusinessInfo are defined)
//----------------------------------------------------------------------



function Validate_EditAccount(thisform) {
with (thisform)
{
   var b = false
   var s = false
   var busn = false
 
   if (submitok==true) {
     submitok = false     
     
     b = ValidateBilling(thisform) ;    

     
     if (b) {s = ValidateShipping(thisform);}

     if (b && s) { busn = ValidateBusinessInfo(thisform); }
  
     if (b && s && busn) {
       return true;
     } else {
       return false;
     }

   } else {

     return true; 
   }
  
}}


  var EditAccount_ResetLoginFields_Done = false;

  function EditAccount_ResetLoginFields(thisform) {
    with (thisform) {
    if (EditAccount_ResetLoginFields_Done==false) { 
       UserName.value=""; 
       Password1.value = ""; 
       Password2.value = "";
    }}
    EditAccount_ResetLoginFields_Done = true
  }



  function ChangeCountryDDM(CountryDDM,ProvDDM,OtherBox) {

    if ((CountryDDM.options[CountryDDM.selectedIndex].value != "CA") && (CountryDDM.options[CountryDDM.selectedIndex].value != "US")) {
      ProvDDM.selectedIndex = 0; 
    } else {
      OtherBox.value = "";
    }
  }




//----------------------------------------------------------------------
// Checkout
//----------------------------------------------------------------------

var submitok = false
var forgetshipping = false


function Change_PayMethod(thisform) {
with (thisform)
{

if (PayMethod.value == "C.O.D.") {submit();}

}
}



function Validate_ConfirmOrder() {
   if (submitok==true) {
     submitok = false;             
     return Validate_PayMethod(form_PaymentForm);   
   } else {   
     submitok = false;   
     return true;
   }
}


