function winopen(href, w, h, w_name)
{
  w += 24;
  h += 24;

  opts = w > 100 && h > 100 ? "toolbar=no, scrollbars=no, width=" + w + ", height=" + h + ", resizable=no" : "";

  if (typeof(href) == "object")
      href = href.href;

  if (!w_name)
    w_name = "_blank";
  w = window.open(href, w_name, opts);
  if (w)
    w.focus();

  window.retVal = false;

  return false;
}

//winopen("/ny_<?=$lang->code?>.php", 600, 700, "ny_pop");
//winopen("/popup/fudjin/", 800-24, 592-24, "fudjin");

function confirmLink(theLink, confirmMsg)
{
  // Confirmation is not required in the configuration file
  // or browser is Opera (crappy js implementation)
  if (confirmMsg == '' || typeof(window.opera) != 'undefined')
      return true;

  var is_confirmed = confirm(confirmMsg);
  if (is_confirmed)
    theLink.href += '&is_confirmed=1';

  return is_confirmed;
}

Event.observe(window, "load", function(){
	var colors = ["red", "green", "blue"];
	$$(".blink").each(function(element) {
	element.xColor = 0;
		new PeriodicalExecuter(function(pe) {
			//element.style.visibility = (element.style.visibility == "visible") ? "hidden" : "visible";
			element.xColor += 1;
			if (element.xColor >= colors.length) element.xColor = 0;
			element.style.color = colors[element.xColor];
		}, 0.1);
	});
});
