function add_cart(id) 
{
	var selr=document.getElementById('razmer'+id);	
	var razmer=selr.options[selr.selectedIndex].value;	
	JsHttpRequest.query('../ajax_loader/add_cart.php?random='+Math.random()*1000,{'id':razmer},
	   function(result, errors) 
	   {
			document.getElementById("BlockCartSumma").innerHTML = result[0];
			document.getElementById("BlockCartCount").innerHTML = result[1]; 
			alert('Товар внесен в Вашу корзину.');
	   }
    );
}

function add_cart_count(id) 
{
	var c=document.getElementById('vprodCout').value;
	JsHttpRequest.query('../ajax_loader/add_cart.php?random='+Math.random()*1000,{'id':id,'count':c},
	   function(result, errors) 
	   {
		  	//document.getElementById("login_check").innerHTML = result[0]; 
			alert('Товар внесен в Вашу корзину.');
	   }
    );
}

function delete_cart(id) 
{
	JsHttpRequest.query('../ajax_loader/delete_cart.php?random='+Math.random()*1000,{'id':id},
	   function(result, errors) 
	   {
		  	//document.getElementById("login_check").innerHTML = result[0]; 
			window.location.reload();
	   }
    );
}


function switchCheckboxFrID(id,znID,p)
{
	var chbox = document.getElementById('chk'+id);
	chbox.checked = true;
	
	JsHttpRequest.query('../ajax_loader/checksave.php?random='+Math.random()*1000,{'id':id,'znID':znID,'p':p},
	function(result, errors) 
	{
		return true;	
	}
   );	
}
