/**
 *
 * Adding an item to the cart :)
 **/
 var lastresult=false;
function AddToCart(item,format){
lastresult=false;

	 JsHttpRequest.query(
	 	     '/process.php?p=addcart',
            {
			'item':item,
			'format':format
            },

            function(result, errors) {

		if(errors)alert(errors);
                if (result) {

						if(result["status"]=="OK")
							{
	   // cart_items
	   // cart_price
	   document.getElementById('cart_items').innerHTML=result["cart_items"];
	   document.getElementById('cart_price').innerHTML=result["cart_price"];
		document.getElementById('checkout_link_id').style.display='block';
		// show link;
	 CallBackItem(item,format);
							}
							else
							{

							   alert(result["status"]);

						return false;

							}

                }
            },
            true // do not disable caching
        );


}