<!--

    
    function send_xmlhttprequest(obsluha, method, url, content, headers) 
    {
        var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest : (window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : false)); 
        if (!xmlhttp) 
            { 
                return false; 
            } 
        
        xmlhttp.open("GET", url, true);
        
        xmlhttp.onreadystatechange = function() { obsluha(xmlhttp); };
         
        /*if (headers) 
        { 
            for (var key in headers) 
            { 
                xmlhttp.setRequestHeader(key, headers[key]); 
            } 
        } 
        */
            
        xmlhttp.send(null);
        
        return true;
     } 

    function addToBasket(prodID, count, cena) 
    { 
        //alert('addToBasket.php?prodID=' + prodID + '&count=' + count + '&cena=' + cena)
        //alert(prodID + " " + count)
        // odeslání pozadavku na aktualizaci dat
        document.getElementById('basket_small_table').style.backgroundColor = "#ffffff";  
        if (!send_xmlhttprequest(addToBasket_obsluha, 'GET', 'addToBasket.php?prodID=' + prodID + '&count=' + count + '&cena=' + cena)) 
        { 
            return false; 
        } 
        return true; 
        
    } 
    
    function addToBasket_obsluha(xmlhttp) 
    { 
        
        //alert('anketa_obsluha ' + xmlhttp.readyState);
        if (xmlhttp.readyState == 4) 
        {
            
            if (xmlhttp.status == 200)
            {
                // aktualizace odpovědí na základě aktuálního stavu  
                var totalCount = xmlhttp.responseXML.getElementsByTagName('totalCount');
                var totalSum = xmlhttp.responseXML.getElementsByTagName('totalSum');
                var totalDPH = xmlhttp.responseXML.getElementsByTagName('totalDPH');
                 
                document.getElementById('smallBasketCount').innerHTML = totalCount[0].firstChild.data;
                document.getElementById('smallBasketSum').innerHTML = totalSum[0].firstChild.data;
                document.getElementById('smallBasketDPH').innerHTML = totalDPH[0].firstChild.data;
                document.getElementById('basket_small_table').style.backgroundColor = "transparent"; 
            } 
        } 
        
    }
    
    function clearBasket()
    {
        if (!send_xmlhttprequest(clearBasket_obsluha, 'GET', 'addToBasket.php?clear=1')) 
        { 
            return false; 
        } 
        return true; 
    }
    
    function clearBasket_obsluha(xmlhttp)
    {

        if (xmlhttp.readyState == 4) 
        {
            if (xmlhttp.status == 200)
            {
                // aktualizace odpovědí na základě aktuálního stavu  
                var totalCount = xmlhttp.responseXML.getElementsByTagName('totalCount');
                var totalSum = xmlhttp.responseXML.getElementsByTagName('totalSum');
                var totalDPH = xmlhttp.responseXML.getElementsByTagName('totalDPH');
                 
                document.getElementById('smallBasketCount').innerHTML = totalCount[0].firstChild.data;
                document.getElementById('smallBasketSum').innerHTML = totalSum[0].firstChild.data;
                document.getElementById('smallBasketDPH').innerHTML = totalDPH[0].firstChild.data;
                if (document.location.href.indexOf("kosik") > -1)
                    document.location.href = "index.php?obsah=kosik";            
            } 
        }     
    } 
     
-->    

