$(function() {
	  if($.browser.msie){
		    var offset = $("#sidebar").offset();
		    var topPadding = 15;
		    $(window).scroll(function() {
			      //alert("scrollTop = "+$(window).scrollTop());
			      if ($(window).scrollTop() > offset.top) {
					$("#sidebar").stop().animate({
						  marginTop: $(window).scrollTop() - offset.top + topPadding
					});
			      } else {
					$("#sidebar").stop().animate({
						  marginTop: 0
					});
			      }
		    });
	  }

	  $("#sidebar img,#sidebar a").click(function(){
		    //$("form[name=mform]").attr("target","shop");
		    //window.status="Æäèòå, èäåò äîáàâëåíèå â êîðçèíó...";
		    //$("form[name=mform]").submit();
		    $(":submit[name=quick]").click();
	  });
	  $("form[name=mform] input[name^=num]").live('keyup',function(){
		    $(this).parents("tbody:first").children().children().css("background-color","white");
		    $("input[name^=num]").not($(this)).val("");
		    if($(this).val().length)
			      $(this).parents("tr:first").children("td:not(td:nth(4))").css("background-color","#ffc459");
	  });

	  $(":image[src*=btn_ny]").mouseover(function(){
		    $(this).attr("src","/html/img/btn_ny2.jpg");
	  }).mouseout(function(){
		    $(this).attr("src","/html/img/btn_ny.jpg");
	  });

	  updateBasketInfo();
});

function updateBasketInfo(){
	  $.ajax({
		    type: "POST",
		    url: "ajax_online.php",
		    data: "action=getBasketInfo",
		    success: function(msg){
			      //alert(msg);
			      $("#basketInfo").html(msg);
		    }
	  });
}
