

function basketHeader(count, sum) {
	if(count && sum) {
		$('#basket_count').text(count);
		$('#basket_sum').text(sum);
		$('#basket_order').show();
	}
}


function basketSelect( id) {
    var req = new JsHttpRequest();
    //req.caching = true;
    req.onreadystatechange = function() {
        if (req.readyState == 4) {
            var count = req.responseJS.count;
            var sum = req.responseJS.sum;
            basketHeader(count, sum);
			lib_ajax_log(req.responseText);
        }
    }
	req.open(null, proekt_main_url + 'main_ajax/basket.php', true);
	req.send( { action: 'add', product: id } );
	return false;
}

