    ///////////////////////////////////////////
    // Return to the previous page in history
    function Back() {
      history.go(-1);
    }


    /////////////////////////////////////////////////////////
    // Links to a store page, loading the cart into the URL
    function StoreLink(storeURL) {
      var newlink = storeURL + "?selected=" + selected + "&incart=" + GetCookie("cart") + "&region1=" + region1 + "&region2=" + region2;
      window.location = newlink;
    }



    /////////////////////////////////////////////////////////
    // Links to a store page, loading the cart into the URL and specifying the given product ID
    function ProductLink(storeURL, productID) {
      var newlink = storeURL + "?selected=" + productID + "&incart=" + GetCookie("cart") + "&region1=" + region1 + "&region2=" + region2;
      window.location = newlink;
    }



    //////////////////////////////////////////////
    // Sets the store menu to highlighted status
    function SetStoreMenu(menuName) {
	  if (menuName != "") {
        eval("document." + menuName + ".src = \"../images/" + menuName + "_down.gif\"");
	  }
    }


    /////////////////////
    // Creates a cookie
    // cookieName is an identifier for retrieval; cookieData is the value to be stored
    // days is the number of days before expiration
    function BuildCookie(cookieName, cookieData, days) {

        // Calculate the expiration date
        var expireDate = new Date ();
        expireDate.setTime(expireDate.getTime() + days * (24 * 60 * 60 * 1000));

        // Set the cookie
        document.cookie = cookieName + "=" + escape(cookieData) +
                          "; expires=" + expireDate.toGMTString();
    }


    /////////////////////////////////////
    // Retrieves a cookie value by name
    function GetCookie(name) {
        var cookie = " " + document.cookie;
        var search = " " + name + "=";
    	var setStr = null;
    	var offset = 0;
    	var end = 0;
	    if (cookie.length > 0) {
		    offset = cookie.indexOf(search);
    		if (offset != -1) {
			    offset += search.length;
    			end = cookie.indexOf(";", offset)
			    if (end == -1) {
				    end = cookie.length;
			    }
    			setStr = unescape(cookie.substring(offset, end));
		    }
	    }
    	return(setStr);
    }


  ////////////////////////////////////////////////////
  // Counts the number of entries in the cookie cart
  function GetCartSize(name) {
    var lcode = " " + name;
    var search = "=";
  	var offset = 0;
   	var end = 0;
    var size = 0;
    if (lcode.length > 0) {
      // Count the number of entries
      while (offset != -1) {
        offset = lcode.indexOf(search,offset+1);
        size++;
      }
      // Correct for the last invalid entry
      size--;
    }

    // Return the final result
    return(size);
  }


  ///////////////////////////////////////////////////
  // Retrieves a license quantity value by position
  function GetQuantity(position,lcode) {
    var search = "=";
  	var setStr = null;
  	var offset = 0;
   	var end = 0;
    if (lcode.length > 0) {
      // Skip "position" number of separators
      for (i=0; i<position; i++) {
        offset = lcode.indexOf(search,offset+1);
      }
      if (offset != -1) {
        offset += search.length;
        end = lcode.indexOf(",", offset)
        if (end == -1) {
          end = lcode.length;
        }
        setStr = unescape(lcode.substring(offset, end));
      }
    }
    return(setStr);
  }


  /////////////////////////////////////////////
  // Retrieves a license ID value by position
  function GetID(position,lcode) {
    var stext = " ," + lcode;
    var search = ",";
  	var setStr = null;
  	var offset = 0;
   	var end = 0;
    if (lcode.length > 0) {
      // Skip "position" number of separators
      for (i=0; i<position; i++) {
        offset = stext.indexOf(search,offset+1);
      }
      if (offset != -1) {
        offset += search.length;
        end = stext.indexOf("=", offset)
        if (end == -1) {
          end = stext.length;
        }
        setStr = unescape(stext.substring(offset, end));
      }
    }
    return(setStr);
  }


  function GetCartArray(cookieData) {
    // Declare the 2-dimensional cookie array
    var cookieArray = new Array();
    cookieArray[0] = new Array();    // Product ID
    cookieArray[1] = new Array();    // Product quantity
    var cartcookie = cookieData;     // Cookie information to be used
    var cartsize = GetCartSize(cookieData);  // Determine the number of entries in the cart

    if (cookieData == null) {cartcookie = ""};   // Prepare data
    // Parse the cookie data into an array
    for (k=0; k<cartsize; k++) {
      cookieArray[0][k] = GetID(k+1,cartcookie);
      cookieArray[1][k] = GetQuantity(k+1,cartcookie);
    }

    // Return parsed data
    return cookieArray;
  }


  ///////////////////////////////////////////
  // Updates the cart with the listed items
  function UpdateCart() {
    var amount = null;                       // Current license quantity entered
    var cartcookie = GetCookie("cart");      // Retrieve the shopping cart cookie data
    var cartsize = GetCartSize(cartcookie);  // Determine the number of entries in the cart
    var oldcart = GetCartArray(cartcookie);

    // Build an updated cart array
    for (i=0; i<licenses.length; i++) {
      amount = eval("document.Shopper.license" + licenses[i] + ".value");

      if (amount != "") {
      // Update the array with the current form's data
      for (j=0; j<cartsize+1; j++) {
        // Search for an existing match, updating as appropriate
        if (oldcart[0][j] == licenses[i]) {
          // Existing entry found, so update and exit this loop
          oldcart[1][j] = amount;
          break;
        } else if (j == cartsize) {
          // Existing entry not found, so add it to the end
          oldcart[0][j] = licenses[i];
          oldcart[1][j] = amount;
          cartsize++;	// Increase the cart size to account for this item
          break;        // Terminate the loop now, since we're at the end of the cart
        }
      }}
    }

    // Generate cookie format cart data and submit to cart
    var newcookie = "";
    for (i=0; i<oldcart[0].length; i++) {
      if (oldcart[1][i] > 0) {
        newcookie += oldcart[0][i] + "=" + oldcart[1][i] + ",";
      }
    }

    // Write the cookie
    BuildCookie("cart",newcookie,3);
  }


  /////////////////////////////////////////
  // Checks to see if cookies are enabled
  function CookieCheck() {
    // Check to see if cookies are enabled or not
    BuildCookie("Check","on",1);
    cookiesOn = GetCookie("Check");
    if (cookiesOn != "on") {
      alert("You do not have cookies enabled. Cookies are required to use the online store.");
    }
  }
