$(document).ready( function() {

	$(".addcart").click( function() {
		$.post("/basket/add/", {
			uid :$(this).attr("uid"),
			count :$("#cart_" + $(this).attr("price")).val(),
			price :$(this).attr("price"),
			catalog :"1"
		}, function(data) {
			t = data.split("|");
			$("#count_product_basket").html(t[0]);
			$("#summ_product_basket").html(t[1]);
			showsave("Товар успешно добавлен в корзину");
		});

		return false;
	});

	$(".addcart2").click( function() {
		$.post("/basket/add/", {
			uid :$(this).attr("uid"),
			count :$("#cart_" + $(this).attr("uid")).val(),
			catalog :"2"
		}, function(data) {
			t = data.split("|");
			$("#count_product_basket").html(t[0]);
			$("#summ_product_basket").html(t[1]);
			showsave("Товар успешно добавлен в корзину");
		});

		return false;
	});
	
	$("#producer").change( function() {
		location.href='/catalog/show_producer/?item='+$("#producer").val()+'';
		//return false;
	});

});

$(document).ready( function() {
	$("a[class^='comgal']").prettyPhoto();
});


var shid=0;
var hide = true;
function showLayer(id){
  //if (id != shid){
    hide = true;
    hideLayerFull(shid);
  //}
  shid = id;
  hide = false;
  $("#"+id).css("display","block");
  //document.getElementById(id).style.display="";
  //window.document.getElementById(""+id+"").style.visibility="hidden";
}
function hideLayer(id){
  hide = true;
  //setTimeout("hideLayerFull('"+shid+"')",1500);
  hideLayerFull(id);
}
function hideLayerFull(id){
  if (hide!=true) return;
  if (shid == 0) return;
	$("#"+id).css("display","none");
  //document.getElementById(id).style.display="none";
  shid = 0;
  hide = false;
}