   var bGood;
   var sName = navigator.appName;
   var sAppVersion = parseInt(navigator.appVersion);

   if (sName == "Netscape" && sAppVersion >= 4)
      bGood = true;
   else if (sName == "Microsoft Internet Explorer" && sAppVersion >= 4)
      bGood = true;
   else if ((sName == "WebTV Plus Receiver") ||
            (sName == "WEB TV PLUS RECEIVER"))
      bGood = true;
   else
      bGood = false;


   // If browser is no good alert
   if (bGood == false) {

      alert("Our shopping cart system was designed with IE 4.0 or later and Netscape 4.0 " +
            "or later browsers in mind. You may not be able to shop " +
            "on this site with your current browser.  It is recommended that " +
            "obtain one of these or later browsers.  Thank you.");

   }

   var loLoadingImg;
   var iHeight = 130;
   var iWidth = 161;

   // Loading... image
   loLoadingImg = new Image(iHeight, iWidth);
   loLoadingImg.src = "/common/images/loading.gif";

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

   function OpenSwatches() {
      var objWindow = 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");
      objWindow.focus();
   }

   function ChangePicture(psPic) {

      var loNewImage;

      if (psPic != "none") {

         // Show loading image
         document.images["pantpic"].src = loLoadingImg.src;
		 
         // Create a new image
         loNewImage = new Image(iHeight, iWidth);
		 switch (psPic) {
			case 'softpastelblue':
			case 'softpastelpink':
			case 'softpastellemmon':
				loNewImage.src = "images/g-pants.unavailable.gif";
				break;
			default:
				loNewImage.src = "images/g-pants." + psPic + ".gif";
				break;
		}

         // Show new image
         document.images["pantpic"].src = loNewImage.src;

      }

   }

   function ChangeLining(psColor) {

      // Default to none
      if (psColor == "none") {

         with (document.addtocart.lining) {
            length = 1;
            selectedIndex = 0;
         }

      }

      // Show linings for flannel
      else if ((psColor == "brownbears") ||
               (psColor == "toys")) {

         // Add colors
         with (document.addtocart.lining) {

            length = 2;

            options[1].value = "softwear";
            options[1].text = "Softwear";

            selectedIndex = 0;

         }

      }

      // Show linings for vinyls
      else {

        // Add colors
         with (document.addtocart.lining) {

            length = 3;

            options[1].value = "terry";
            options[1].text = "Terry";

            options[2].value = "tricot";
            options[2].text = "Tricot Nylon";

            selectedIndex = 0;

         }


      }

   }

   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 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(GetGaryPOSOCode(lsColor, lsStyle, lsSize), lsStyle + " " + lsColorText + " (" + lsSize + ")", GetGaryPOSOPrice(lsColor, lsStyle, lsSize));
         window.location.href = "/cart/";

      }

   }   
   
   function OpenMeasuringInstructions() {
      var objWindow = window.open("/common/html/measuringinstructions.html", "measuringinstructions", "width=595,height=550,location=no,resizable=no,menubar=no,scrollbars=yes,titlebar=yes,status=no,toolbar=no");
      objWindow.focus();
   }
