var link_popup_windows = {};

function new_popup_window(id, url, dimensions) {
	var current = new Date;
  var win

  // don't let them double click windows open
	if(!link_popup_windows[id] || (link_popup_windows[id].opened < (current.getTime() - 5000))) {
		link_popup_windows[id] = {popup: null, opened:current.getTime() }  // mark that we've done this

		box = (dimensions != null) ? dimensions : {width:759,height:650};
		var left = (screen.width - box.width) / 2;
		var top = (screen.height - box.height) / 2;

		link_popup_windows[id].popup = window.open(url, id, 'resizable=1,scrollbars=1,location=0,status=0,toolbar=0,menubar=0,width='+box.width+',height='+box.height+',left='+left+',top='+top);
	}
  if(link_popup_windows[id].popup) {
    link_popup_windows[id].popup.focus();
  }

  return(link_popup_windows[id].popup);
}

function link_popup_window(id, link, dimensions) {
  new_popup_window(id, link.href, dimensions);
	return(false); // onclick return
}

