   // Check if we should clear the cart
   // (after a submit)
   CheckSubmitted();

   function OpenSwatches() {
      window.open("/common/html/g-swatches.html", "swatches", "width=595,height=550,location=no,resizable=no,menubar=no,scrollbars=yes,titlebar=yes,status=no,toolbar=no");
   }

   function AddToCart(poColor, poStyle, poSize) {

      // Get value
      var lsColorText = poColor.options[poColor.selectedIndex].text;
      var lsColor = poColor.options[poColor.selectedIndex].value;
      var lsSize = poSize.options[poSize.selectedIndex].value;
      var lsSizeText = poSize.options[poSize.selectedIndex].text;
      var lsStyle = poStyle.options[poStyle.selectedIndex].value;

      // Check if nothing selected
      if (lsColor == "none" && lsStyle == "none" && lsSize == "none")
         alert("You did not select a color, sytle, or size.");
      else if (lsColor == "none" && lsStyle == "none" && lsSize != "none")
         alert("You did not select a color or style.");
      else if (lsColor == "none" && lsStyle != "none" && lsSize == "none")
         alert("You did not select a color or size.");
      else if (lsColor == "none" && lsStyle != "none" && lsSize != "none")
         alert("You did not select a color.");
      else if (lsColor != "none" && lsStyle == "none" && lsSize == "none")
         alert("You did not select a style or size.");
      else if (lsColor != "none" && lsStyle == "none" && lsSize != "none")
         alert("You did not select a style.");
      else if (lsColor != "none" && lsStyle != "none" && lsSize == "none")
         alert("You did not select a size.");
      else {

         AddItem(GetGaryBibCode(lsColor, lsStyle, lsSize), lsStyle + " " + lsColorText + " " + lsSizeText, GetGaryBibPrice(lsColor, lsStyle, lsSize));
         window.location.href = "/cart/";

      }

   }
