var popupLinkConfig = new Array;

// popupLinkConfig["classname"] = new Array ( "targetname", "width=550,height=350,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,location=yes,menubar=yes");
popupLinkConfig["cotatiiSingle"]    = new Array ( "_blank", "height=500,width=410,top=20,left=20,status=no,resizable=yes");
popupLinkConfig["cotatiiListaACT"] = new Array ( "cotatiiListaACT", "width=740,height=400,top=20,left=20,status=no,scrollbars=yes,resizable=yes");
popupLinkConfig["cotatiiListaRDQ"] = new Array ( "cotatiiListaRDQ", "width=740,height=400,top=20,left=20,status=no,scrollbars=yes,resizable=yes");
popupLinkConfig["cotatiiListaDFB"] = new Array ( "cotatiiListaDFB", "width=740,height=400,top=20,left=20,status=no,scrollbars=yes,resizable=yes");
popupLinkConfig["cotatiiListaDF"] = new Array ( "cotatiiListaDFB", "width=740,height=400,top=20,left=20,status=no,scrollbars=yes,resizable=yes");
popupLinkConfig["cotatiiBA"]    = new Array ( "_blank", "height=430,width=400,top=20,left=20,status=no,resizable=yes,scrollbars=yes");
popupLinkConfig["clipPrez"] = new Array ( "clipPrez", "width=360,height=350,top=20,left=20,status=no,scrollbars=yes,resizable=yes");
popupLinkConfig["newsAlert"]    = new Array ( "_blank", "height=430,width=400,top=20,left=20,status=no,resizable=yes,scrollbars=yes");

var debuglog="";

function initPopupLinks()
{
  if (!document.getElementsByTagName) return true;
  var pageLinks = document.getElementsByTagName("a");
  for (var i = 0; i < pageLinks.length; i++) 
  {
    if (((pageLinks[i].className != null) && 
         (pageLinks[i].className != "")) ||
        ((pageLinks[i].parentNode.className != null) && 
         (pageLinks[i].parentNode.className != "")))
    {
      var linkClass = " " + pageLinks[i].className + " ";
      if ((linkClass == "  ") && (pageLinks[i].parentNode.className != ""))
      {
        linkClass = " " + pageLinks[i].parentNode.className + " ";
      }
      for (var theKey in popupLinkConfig) 
      {

        if (linkClass.indexOf(" " + theKey + " ") > -1)
        {
			
          if ((pageLinks[i].target == "") || (pageLinks[i].target == null))
          {
            pageLinks[i].target = (popupLinkConfig[theKey][0] != "") ? popupLinkConfig[theKey][0] : '_blank';
			
          }
		  
          pageLinks[i].settings = popupLinkConfig[theKey][1];
          pageLinks[i].onclick = popUp;
        }
		debuglog=debuglog + pageLinks[i].href + ' : ' + pageLinks[i].target + "\n";
      }
    }
  }
  return true;
}

function popUp()
{
  //alert(this.href);
  newWin = window.open(this.href, this.target, this.settings);
  newWin.focus();
  return false;
}
