/* $Id: internal.js 2142 2011-08-17 13:41:27Z jure.merhar $ */
// Cart warning

function init_cart_warning(time)
{
  cart_warning_time = time;
  run_cart_warning();
}

function display_cart_warning()
{
  alert(cart_warning_text);
}

function run_cart_warning()
{
  cart_warning_time--;
  if (cart_warning_time <= 0) {
    setTimeout(display_cart_warning, 1);
  } else {
    setTimeout(run_cart_warning, 1000);
  }
}

function open_popup(e, url)
{
  var width  = 800;
  var height = 600;
  var left_pos = (screen.width  / 2) - (width  / 2);
  var top_pos  = (screen.height / 2) - (height / 2);
  var link = Event.element(e);
  if (!url) url = link.href + '?popup';

  window.open(url, null, 'width=' + width + ',height=' + height + ',left=' + left_pos + ',top=' + top_pos + ',scrollbars=yes');
  Event.stop(e);
}

function init_popups()
{
  $$('a.popup').each(function(item) {
    Event.observe(item, 'click', open_popup);
  });
}

Event.onDOMReady(init_popups);

