numPopups = 0;
popupNames = new Array();
popupReferences = new Array();

// Popup Functions
function AddPopup(name, reference) {
  refIndex = popupNames[name];
  if (refIndex == null) {
    refIndex = numPopups++;
    popupNames[name] = refIndex;
  }
  popupReferences[refIndex] = reference;
}

function openGenPopup(name,url,width,height,attribs)
{
  var win;

  if (attribs == null) {
    attribs = "hotkeys,resizable,scrollbars,dependent";
  }

  if (FocusPopup(name)) {
    var refIndex = popupNames[name];
    win = popupReferences[refIndex];
    win.location = url;
  }
  else {
    var desc_str = "height=" + height + 
                   ",width=" + width + "," + attribs;
    win = window.open(url,name,desc_str);
    AddPopup(name,win);
 }
 FocusPopup(name);
 return (win);
}

function openRegister(url)
{
    var saveUrl = "returnurl" + "=" + escape (window.location.href);
    saveUrl += ";path=/;domain=.atlantaregional.com";
    document.cookie = saveUrl;

    window.location.href = url;
}

function FocusPopup(name) {
  refIndex = popupNames[name];
  if (refIndex != null && ! popupReferences[refIndex].closed) {
    popupReferences[refIndex].focus();
    return true;
  }
  return false;
  
  function ClosePopups() {
  for (var i=0; i < popupReferences.length; i++) {
    curRef = popupReferences[i]
    if (curRef != null && !curRef.closed) {
      curRef.close();
    }
    popupReferences[i] = null;
  }
}

function ClosePopup(name) {
  refIndex = popupNames[name];
  if (refIndex != null && ! popupReferences[refIndex].closed) {
    popupReferences[0].close();
    popupReferences[refIndex] = null;
    popupNames[name] = null;
    return true;
  }
  return false;
}

}


function resetit(){
	document.frmKeyword.txtKeyword.value="";
	document.frmKeyword.cboCategory.value="";
	document.frmKeyword.cboMonth.value="";
}

function resetform(){
	document.frmSearch.Title.value="";
	document.frmSearch.Month.value="";
	document.frmSearch.Date.value="";
	document.frmSearch.Year.value="";
	document.frmSearch.Location.value="";
	document.frmSearch.Category.value="";
	document.frmSearch.Information.value="";
	}