      var url = location.protocol + '//' + location.hostname + '/Merchant2/4.24/ksdajax.mvc?Store_Code=ksd'; // The server-side script

      function handleHttpResponse() {
        if (http.readyState == 4) {
          if (http.responseText.indexOf('invalid') == -1) {

            // Use the XML DOM to unpack the city and state data 
            var xmlDocument = http.responseXML; 
            var basketcount = getInnerText(xmlDocument.getElementsByTagName('basketcount').item(0));
            var basketprice = getInnerText(xmlDocument.getElementsByTagName('basketprice').item(0));
            var src = xmlDocument.getElementsByTagName('src').item(0).xml;
            if (basketcount == 1) {
              document.getElementById('tinycart').innerHTML = "(" + basketcount + " item, " + basketprice + ")";
            } else {
              document.getElementById('tinycart').innerHTML = "(" + basketcount + " items, " + basketprice + ")";
            }
            document.getElementById('src').innerHTML = src;
            isWorking = false;
          }
        }
      }

      var isWorking = false;
      function checkCart() {
        if (!isWorking && http) {
					theScreen = document.getElementById('ajax-screen').innerHTML;
					theProd = document.getElementById('ajax-prod').innerHTML;
					theCtgy = document.getElementById('ajax-ctgy').innerHTML;
					theOffset = document.getElementById('ajax-offset').innerHTML;
										
					myRand=parseInt(Math.random()*99999999);  // cache buster
					fullurl = url + '&rand=' + escape(myRand) + '&Screen=' + escape(theScreen) + '&Product_Code=' + escape(theProd) + '&Category_Code=' + escape(theCtgy) + '&Offset=' + escape(theOffset);
//					alert(fullurl);
          http.open("GET", fullurl, true);
          http.onreadystatechange = handleHttpResponse;
          isWorking = true;
          http.send(null);
        }
      }

      function getHTTPObject() {
        var xmlhttp;
        /*@cc_on
        @if (@_jscript_version >= 5)
          try {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
          } catch (e) {
            try {
              xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (E) {
              xmlhttp = false;
            }
          }
        @else
        xmlhttp = false;
        @end @*/
        if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
          try {
            xmlhttp = new XMLHttpRequest();
          } catch (e) {
            xmlhttp = false;
          }
        }
        return xmlhttp;
      }

function getInnerText (node) { 
   if (typeof node.xml != 'undefined') { 
     return node.xml; 
   } 
   if (typeof node.textContent != 'undefined') { 
     return node.textContent; 
   } 
   else if (typeof node.innerText != 'undefined') { 
     return node.innerText; 
   } 
   else if (typeof node.text != 'undefined') { 
     return node.text; 
   } 
   else { 
     switch (node.nodeType) { 
       case 3: 
       case 4: 
         return node.nodeValue; 
         break; 
       case 1: 
       case 11: 
         var innerText = ''; 
         for (var i = 0; i < node.childNodes.length; i++) { 
           innerText += getInnerText(node.childNodes[i]); 
         } 
         return innerText; 
         break; 
       default: 
         return ''; 
     } 
   } 
} 

      var http = getHTTPObject(); // We create the HTTP Object
