$(document).ready(function() {
  $('.b_1_4 img').ifixpng();
});
function show_tips(delay, id)
{
//  $("#bt_add_basket").attr("disabled","disabled");
  if(!delay) delay = 1000;
  if (id)
	  $('#' + id).fadeIn(200);
	else
	  $('.tips').fadeIn(200);
	tips_time = setInterval('hide_tips()', delay);
}
function hide_tips()
{
  $('.tips').fadeOut(500);
  clearInterval(tips_time);
//  $("#bt_add_basket").attr("disabled","");
}

function add2basketOzon(id)
{
  time=new Date();
  time_sec=time.getSeconds();
  time_min=time.getMinutes();
  time_hours=time.getHours();
  time_day=time.getDay();
  var time_str = time_day + '' + time_hours + '' + time_min + '' + time_sec;
  $.getJSON("/inc/1/basket_ozon.php?time="+time_str, {id:id}, function(data){
    if(data.status)
    {
      $("#b_count").text(data.count);
      $("#b_price").text(data.price);
      show_tips(false, id);
    }
  });
  return false;
}

function add2basket(id)
{
  time=new Date();
  time_sec=time.getSeconds();
  time_min=time.getMinutes();
  time_hours=time.getHours();
  time_day=time.getDay();
  var time_str = time_day + '' + time_hours + '' + time_min + '' + time_sec;
  var list_1 = $("#list_1").val();
  var list_2 = $("#list_2").val();
  var count = $("#count").val();
//  alert(id + " " + list_1 + " " + list_2 + " "+ count)
  $.getJSON("/inc/1/basket.php?time="+time_str, {id:id, list_1:list_1, list_2:list_2, count:count}, function(data){
    if(data.status)
    {
      $("#b_count").text(data.count);
      $("#b_price").text(data.price);
      show_tips();
    }
  });
  return false;
}
$(document).ready(function () {
	jQuery(function($) {
		$("a.zoom").slimbox({
      'overlayOpacity': 0.0,
      'overlayFadeDuration': 0,
      'imageFadeDuration': 0,
      'captionAnimationDuration': 0,
      'resizeDuration': 0
    }, null, function(el) {
			return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
		});
	});
});
function ShowPage(PagePath, width, height)
{
  var scroll = 'no';
  var top=0, left=0;
  if(width > screen.width-10 || height > screen.height-28)
          scroll = 'yes';
  if(height < screen.height-28)
          top = Math.floor((screen.height - height)/2-14);
  if(width < screen.width-10)
          left = Math.floor((screen.width - width)/2);
  width = Math.min(width, screen.width-10);
  height = Math.min(height, screen.height-28);
  scroll = 'yes';
  window.open(PagePath,'','scrollbars='+scroll+',resizable=yes, width='+width+',height='+height+',left='+left+',top='+top);
  return false;
}

