    function SoftShop()
    { 
        var ShopID = "47611";      //Shop ID
        var LocPostal = "1";     //Delivery option used for Postal Orders
        var LocRestNum = "2";    //Delivery option used for remaining Postal Orders
        var LocCurrency = "USD"; //Default currency value
        var LocOpts = "";       //Default value used for variations
        var LocDeliv = "0";      //Default delivery value
        var LocText = "";	//Default Text value
        var LocProds = "";       //used to store product numbers
        var LocQty = "";         //used to store product quantities
        var LocBuy = 0;          //used to calculate total products ordered
        var LocTemp = "";        //used to store form element names
        var LocUrl = " https://usd.swreg.org/cgi-bin/s.cgi?";

        for ( i = 0; i < document.order.elements.length; i++) 
        {
          LocTemp = document.order.elements[i].name;
          if (LocTemp.charAt(0) == "P")
          {
             if ( isNaN(eval(document.order.elements[i].value)) )
                document.order.elements[i].value = "0";
             if (eval(document.order.elements[i].value) > 0)
             {
                LocBuy += 1;
                LocProds = LocProds + LocTemp.substring(1,11) + ":";
                LocQty = LocQty + document.order.elements[i].value + ":";
				if (LocTemp.charAt(11) == "S")
					{
					LocOpts = LocOpts + "1:";
					}
				else
					{
					LocOpts = LocOpts + "0:";
					}
             }
          }
          else 
          {
             if (LocTemp == "delivery")
             {
                LocDeliv = getValue(document.order.elements[i]);
             }
             else 
             {
                 if (LocTemp == "currency")
                 {
                    LocCurrency = getValue(document.order.elements[i]);
                 }
                 else
                 {
                    if (LocTemp.charAt(0) == "T")
                    {
                       LocText = LocText + getValue(document.order.elements[i]) + ":";
                    }
                 }
              }
            }
        }  //end for
        if (LocBuy > 0) {
           if (LocBuy > 1) {
              if (LocDeliv == LocPostal) {
                 for ( i = 1; i < LocBuy; i++) {
                    LocDeliv = LocDeliv + ":" + LocRestNum;
                 }
              }
              else {
                 LocRestNum = LocDeliv;
                 for ( i = 1; i < LocBuy; i++) {
                    LocDeliv = LocDeliv + ":" + LocRestNum;
                 }
              }
           }
           LocProds = LocProds.substring(0,(LocProds.length-1));
           LocQty = LocQty.substring(0,(LocQty.length-1));
           LocOpts = LocOpts.substring(0,(LocOpts.length-1));
		   LocText = LocText.substring(0,(LocText.length-1));
			var affiliate = "";
			affiliate = getCookie("affiliate");
           location.href = LocUrl + "s=" + ShopID + "&p=" + LocProds + "&v=" + LocOpts + "&d=" + LocDeliv + "&q=" + LocQty + "&t=" + LocText + "&currency=" + LocCurrency + "&a=" + affiliate;
        }
        else {
           alert("Please specify Quantities for each Product.");
        }
      }  //end function

    function getValue(item)
      { var returnValue = "";
        if (item.type == "radio") {
		   if (item.checked == true) {
			  returnValue = item.value;
		   }
		}
		else {
		   if (item.type == "select-one") {
			  returnValue = item.options[item.selectedIndex].value;
		   }
		   else {
			  returnValue = item.value;
		   }
		}
		return returnValue;
      }




