<!--

    
    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(prodID + " " + count)
        // odeslání pozadavku na aktualizaci dat
        //document.getElementById('basket_small_table').style.backgroundColor = "#ffffff";  
        if (!send_xmlhttprequest(addToBasket_obsluha, 'GET', absolutePath + '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)
            {
            	//alert(xmlhttp.responseText);
                // aktualizace odpovědí na základě aktuálního stavu
				//var xmlDoc=xmlhttp.responseXML.documentElement;  
                //var totalCount = xmlhttp.responseXML.getElementsByTagName('totalCount');
                //var totalSum = xmlhttp.responseXML.getElementsByTagName('totalSum');
                //alert(xmlDoc.getElementsByTagName("totalCount")[0].childNodes[0].nodeValue);

                //document.getElementById('basket_small_table').innerHTML = xmlhttp.responseText;
                //alert(document.getElementById('basket_small_table').innerHTML);
                //document.getElementById('basket_small_table').innerHTML = '<tbody><tr><td>neco</td></tr></tbody>';
                //alert(xmlhttp.responseText);
                document.getElementById('testB').innerHTML = xmlhttp.responseText.replace(/#pocet#/, "Počet položek").replace(/#mena#/, " Kč");
                
                
                //document.getElementById('smallBasketSum').innerHTML = totalSum[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');
                 
                document.getElementById('smallBasketCount').innerHTML = totalCount[0].firstChild.data;
                document.getElementById('smallBasketSum').innerHTML = totalSum[0].firstChild.data;
                if (document.location.href.indexOf("kosik") > -1)
                    document.location.href = "index.php?obsah=kosik";
            } 
        }     
    } 
     
-->    
