function popupWindow(href, target, properties) {
  var options = "";
  for (p in properties)
    options += p + "=" + properties[p] + ",";
  var win = window.open(href,target,options);
  win.focus();
  return false;
}

$(document).ready(function(){

  $("a[rel='external'],a.popup").click(function(){
    var properties = {
      width: 800,
      height: 600,
      scrollbars: "yes",
      resizable: "yes"
    };
    return popupWindow(this.href, "popup", properties);
  });

});