function addToBasket(id, count, el) {
	$.ajax({
		"url": "/order/ajax.html?act=add&id=" + id + '&count=' + count,
		"dataType": "json",
		"type": "GET",
		"cache": false,
		"success": function(jsonData) {
			$("#basket_count").html(jsonData.count + " шт.");
			$("#msg_txt").html("Товар заказан.");
			/* if (count) {
				$(el).hide();
				$(el).next().show();
				if (jsonData.count == 1) {
					$("#cart").show();
				}
			}
			else {
				$(el).hide();
				$(el).prev().show();
				if (jsonData.count == 0) {
					$("#cart").hide();
					if (document.location.href.match(/\/order\//g, document.location)) {
						document.location = '/order/';
					}
				}
			} */
			if (jsonData.count == 0) {
				if (document.location.href.match(/\/order\//g, document.location)) {
					document.location = '/order/';
				}
			}
		},
		"error" : function(){
			alert("Ошибка передачи данных");
		}
	});
}

function addToBasket_count(id) {
	var count = $("#" + id).val();
	$.ajax({
		"url": "/order/ajax.html?act=add&id=" + id + '&count=' + count,
		"dataType": "json",
		"type": "GET",
		"cache": false,
		"success": function(jsonData) {
			$("#basket_count").html(jsonData.count + " шт.");
			if (jsonData.count == 0) {
				if (document.location.href.match(/\/order\//g, document.location)) {
					document.location = '/order/';
				}
			}
		},
		"error" : function(){
			alert("Ошибка передачи данных");
		}
	});
}

