
function showMiniCart() { 
    var minicartcontainer = document.getElementById('mini-cart-container'); 
      
    var xmlHttp = ajaxFunction();
    var params = '';

    xmlHttp.onreadystatechange = function() {

        if (xmlHttp.readyState == 4) {

            if (document.all) {
                var result=xmlHttp.responseText;
                 result=result.replace(/<[//]{0,1}(form|Form)[^><]*>/g, ""); 
                 minicartcontainer.innerHTML = result;                     
            }
            else
            {
                minicartcontainer.innerHTML = xmlHttp.responseText;    
            } 
                         
            down = false;
        }
    }
  
    xmlHttp.open("POST", "/minicart.aspx", true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Content-length", params.length);
    xmlHttp.setRequestHeader("Connection", "close");
    xmlHttp.send(params);

    return;
}



  function processPromoCode(type) {
        var minicartcontainer = document.getElementById('mini-cart-container'); 
        var promo = document.getElementById('tbPromoCode');
        var xmlHttp = ajaxFunction();
        var params;
        if(type == 'apply')
        {
            params = 'applypromo=1&pcode=' + promo.value;
        }
        else if(type == 'remove'){
            params = 'applypromo=2';
        }
        xmlHttp.onreadystatechange = function() {

            if (xmlHttp.readyState == 4) {
                 if (document.all) {
                    var result=xmlHttp.responseText;
                     result=result.replace(/<[//]{0,1}(form|Form)[^><]*>/g, ""); 
                     minicartcontainer.innerHTML = result;                     
                }
                else
                {
                    minicartcontainer.innerHTML = xmlHttp.responseText;    
                }
            }
        }
  
        xmlHttp.open("POST", "/minicart.aspx", true);
        xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlHttp.setRequestHeader("Content-length", params.length);
        xmlHttp.setRequestHeader("Connection", "close");
        xmlHttp.send(params);

        if(window.location.href.toString().toUpperCase().indexOf("SHOPPINGCART.ASPX") > 0){
            window.location.href = "/store/os/shoppingcart.aspx";
        }
    }




