// Gereric Popup window script ** version 1.3 **

var popupLinkConfig = new Array;
popupLinkConfig["popup"] = new Array ( "_blank", "");


function initPopupLinks()
{
  if (!document.getElementsByTagName) return true;
  for (var theKey in popupLinkConfig) 
  {
    var pttrn = " "+ theKey + " ";
    var theLinks = document.getElementsByTagName("a");
    for (var i = 0; i < theLinks.length; i++) 
    {
      var theClassName = " " + theLinks[i].className + " ";
      var theNode = theLinks[i].parentNode;
      while (theNode.tagName != "BODY")
      {
        if (theNode.className != null) {
          theClassName += theNode.className + " ";
        }
        theNode = theNode.parentNode;
      }

      if (theClassName.indexOf(pttrn) > -1)
      {
        theLinks[i].onclick = popUp;
      }
    }
  }
  return true;
}


function popUp()
{
  var theClassName = " " + this.className + " ";
  var theNode = this.parentNode;
  while (theNode.tagName != "BODY")
  {
    if (theNode.className != null) {
      theClassName += theNode.className + " ";
    }
    theNode = theNode.parentNode;
  }

  for (var theKey in popupLinkConfig) 
  {
    if (theClassName.indexOf(" " + theKey + " ") > -1)
    {
      var target = ((this.target != "") && (this.target != null)) ? this.target : (popupLinkConfig[theKey][0] != "") ? popupLinkConfig[theKey][0] : theKey;
      var settings = popupLinkConfig[theKey][1];
      newWin = window.open(this.href, target, settings);
      newWin.focus();
      return false;
    }
  }
  return false;
}

