   $(document).ready(function(){
   		$(".compare").click(function(){
 			val = $(this).attr("val");
 			$('#c'+val).html('Уже в <a href="/catalog/compare/">сравнении</a>');
 			$.ajax({
    				type: "POST",
    				url: "/pages/postcompare.php",
                    data: ({id : this.getAttribute('val')}),
                    success: function(data){                    	$("#comcount").html(data);
        		}
    		});
   		});
   	});

   $(document).ready(function(){
   		$(".remember").click(function(){
 			val = $(this).attr("val");
 			$('#r'+val).html('Уже в <a href="/catalog/remembered/">запомнено</a>');
 			$.ajax({
    				type: "POST",
    				url: "/pages/remember.php",
                    data: ({rid : this.getAttribute('val')}),
                    success: function(data){                    	$("#remcount").html(data);
        		}
    		});
   		});
   	});

   $(document).ready(function(){
   		$(".cart").click(function(){        	mID = $(this).attr("val");
        	AddCart(mID);
   		});
   	});

   $(document).ready(function(){
   		$(".cartfull").click(function(){
        	mID = $(this).attr("val");
        	AddCart2(mID);
   		});
   	});

   		function AddCart2(mID){
 			$('#cart'+mID).html('<a href="/cart/"><img src="images/addcarton.png" border="0" alt=""></a>');
           	$.post("/pages/postcart.php", $("#form-sizes-"+mID).serialize(),
           	function(data){
					$("#cartcount").html(data);
			});
   		}

   		function AddCart(mID){ 			$('#cart'+mID).html('Уже в <a href="/cart/">корзине</a>');
           	$.post("/pages/postcart.php", $("#form-sizes-"+mID).serialize(),
           	function(data){
					$("#cartcount").html(data);
			});   		}
   		function GetPriceSize(mID){
           	$.post("/pages/getpricesize.php", $("#form-sizes-"+mID).serialize(),
           	function(data){
					$('#price-'+mID).html(data.price);
					$('#lprice-'+mID).html(data.list_price);
					$('#econom-'+mID).html(data.summa);
					$('#cart'+mID).html('<a href="javascript:AddCart('+mID+');" val="'+mID+'" class="cart">Добавить в корзину</a> <img src="/images/str.jpg" alt="" border="0">');
			}, "json");
   		}

   		function GetPriceSize2(mID){
           	$.post("/pages/getpricesize.php", $("#form-sizes-"+mID).serialize(),
           	function(data){
					$('#price-'+mID).html(data.price);
					$('#lprice-'+mID).html(data.list_price);
					$('#econom-'+mID).html(data.summa);
					$('#cart'+mID).html('<a href="javascript:AddCart2('+mID+');" val="'+mID+'" class="cartfull"><img src="images/addcart.png" border="0" alt=""></a>');
			}, "json");
   		}

	function Cartshippingcheck(){
		if ($('#shipping-method-9').prop('checked')){			$('#payment-method-1')[0].disabled = "disabled";
			$('#payment-method-3')[0].checked = "checked";
		}
		else
		{			$('#payment-method-1')[0].checked = "checked";
			$('#payment-method-1')[0].disabled = false;		}
	}

      $(document).ready(function(){
        // Подсказки
		$(".vopros, .vopros2").each(function(){
	       val = $(this).attr("attr");
	       text = $("#"+val).html();
		   $(this).simpletip({
		   		content: text,
		   		persistent: false,
		   		fixed: true,
   				position: 'left'
		   });
		});
	});
	function anichange (objName) {
	  if ( $(objName).css('display') == 'none' ) {
	    $(objName).animate({height: 'show'}, 200);
	  } else {
	    $(objName).animate({height: 'hide'}, 200);
	  }
	}
   /* $(document).ready(function(){
   		$("#formreview").onsubmit(function(){   			alert('d');
 			//$('#cart'+mID).html('<a href="/cart/"><img src="images/addcarton.png" border="0" alt=""></a>');
           	//$.post("/pages/postcart.php", $("#form-sizes-"+mID).serialize(),
           	//function(data){
					//$("#cartcount").html(data);
			//});
   		});
   	});
   	*/
