function cmfBasketDelete(id) 
{
	return cmfAjaxSend(cmfBaseUrl + '/mainAjax/basket/delete.php', {id: id});
}

function cmfBasketAdd(id) 
{     
	return cmfAjaxSend(cmfBaseUrl + '/mainAjax/basket/add.php', {id: id});
}

function cmfBasket() 
{
	var count = cmfGetCookie('main_basket_count');
	var price = cmfGetCookie('main_basket_price');
	cmfBasketHeader(count, price);
}

function cmfBasketHeader(count, price) 
{
	var html = '';
	fin = '';
	
	if(count > 1 && count < 5)
		fin = 'a';
	else if(count >= 5)
		fin = 'ов';
		
	if(count) 
	{		
		html += '<a href="'+cmfBaseUrl+'/basket/"><div class="basket_cont">В вашей корзине<div class="kol_things">'+ count +' товар'+ fin+' </div>';
		html += '<div class="sum">на сумму<br /><span>'+ price +' руб.</span></div></a></div>';						
	} 
	else 
	{		
		html += '<div class="basket_cont">В вашей <a href="'+cmfBaseUrl+'/basket/">корзине</a><div class="kol_things">товаров нет</div>';
		html += '<div class="sum"><br /><span></span></div></div>';	
	}
	
	$('#basket1').html(html);
}

function cmfBasketIsOrder() 
{
	cmfSetValue('isOrder', 1);
}
