      function createHTTPRequest()
      {
        var xmlHttp;
        
        try
        {    // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
        }
        catch (e)
        {    // Internet Explorer
          try
          {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
          }
          catch (e)
          {
            try
            {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e)
            {
              alert("Your browser does not support AJAX!");
              return false;
            }
          }
        }
        
        return xmlHttp;
      }
      
      function addToCart(id,qty)
      {
        xmlHttp = createHTTPRequest();
        
        xmlHttp.onreadystatechange = function()
        {
          // xmlHttp.readyState
          // 0 The request is not initialized 
          // 1 The request has been set up 
          // 2 The request has been sent 
          // 3 The request is in process 
          // 4 The request is complete 
          
          if (xmlHttp.readyState == 4)
          {
            var totalqty = parseInt(xmlHttp.responseText);
            if (isNaN(totalqty) == true || totalqty < 0)
              totalqty = 0;
            
            var cartcount = document.getElementById('cartCount');
            
            cartcount.innerHTML = totalqty;
            
            var currentcount = document.getElementById('currentInCart');
            var proqty = parseInt(currentcount.innerHTML);
            if (isNaN(proqty) == true || proqty < 0)
              proqty = 0;
            proqty += qty;
            
            currentcount.innerHTML = proqty;
            
          }
        }
        
        var params = "id=" + escape(id) + "&qty=" + escape(qty);
        
        xmlHttp.open("POST","/member/ecommerce/addtocart.php",true);
        
        //Send the proper header information along with the request
        xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlHttp.setRequestHeader("Content-length", params.length);
        xmlHttp.setRequestHeader("Connection", "close");

        xmlHttp.send(params);
      }