// NOTE: This file depends on ajaxForm.js for PopupFormData
var ShippingInfoFormData = Class.create(PopupFormData, {
   // redefine the processSuccess method
   processSuccess: function(htmlText) {
      var elementToFill = document.getElementById("shoppingCart");
      if (elementToFill) {
         elementToFill.innerHTML = htmlText;
      }
      disableElement("shippingErrorsDiv");
      this.hide();
      showElement("shippingServiceDiv");
   },
/*
   // redefine the showProgress method to do nothing
   showProgress: function() {
   },
*/   
   // redefine the processError method to show the errors on the form itself
   processError: function(htmlText) {
      var elementToFill = document.getElementById("shippingErrorsDiv");
      if (elementToFill) {
         elementToFill.innerHTML = htmlText;
	 enableElement("shippingErrorsDiv", true);
      }
      this.updateStatus("");
      resetVisibility(this.formId);
   },
   // redefine the close method to show the productViewer
   close: function() {
      this.hide();
      showElement("productViewerDiv");
   }
});

var ShippingServiceFormData = Class.create(PopupFormData, {
   // redefine the processSuccess method
   processSuccess: function(htmlText) {
      var elementToFill = document.getElementById("shoppingCart");
      if (elementToFill) {
         elementToFill.innerHTML = htmlText;
      }
      this.close();
   },
   // redefine the showProgress method to do nothing
   showProgress: function() {
   },
   // redefine the close method to show the productViewer
   close: function() {
      this.hide();
      showElement("productViewerDiv");
   }
});

