//jquery-latest.js required
function initOpenNewWindow() {
  var popupEvent = function(event) {
  var option = this.href.replace(/^[^\?]+\??/,'').replace(/&/g, ',');
    window.open(this.href, this.rel, option).focus();    event.preventDefault();
    event.stopPropagation();
  }
  jQuery("a.popup").each(function(i) {
      jQuery(this).click(popupEvent);
      jQuery(this).keypress(popupEvent);
  });
}

jQuery(document).ready(initOpenNewWindow);
