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["popup"]    = new Array ( "", "width=650,height=425,scrollbar=yes,menubar=yes");


popupLinkConfig["glossary1"] = new Array ( "", "width=650,height=400,scrollbar=yes,menubar=no");

popupLinkConfig["glossary2"] = new Array ( "", "width=650,height=615,scrollbar=yes,menubar=no");

popupLinkConfig["glossary3"] = new Array ( "", "width=650,height=500,scrollbar=yes,menubar=no");

popupLinkConfig["glossary4"] = new Array ( "", "width=650,height=475,scrollbar=yes,menubar=no");

popupLinkConfig["glossary5"] = new Array ( "", "width=650,height=215,scrollbar=yes,menubar=no");

popupLinkConfig["glossary6"] = new Array ( "", "width=650,height=255,scrollbar=yes,menubar=no");

popupLinkConfig["glossary7"] = new Array ( "", "width=650,height=358,scrollbar=yes,menubar=no");

popupLinkConfig["glossary8"] = new Array ( "", "width=650,height=235,scrollbar=yes,menubar=no");

popupLinkConfig["glossary9"] = new Array ( "", "width=650,height=455,scrollbar=yes,menubar=no");

popupLinkConfig["glossary10"] = new Array ( "", "width=650,height=358,scrollbar=yes,menubar=no");

popupLinkConfig["glossary11"] = new Array ( "", "width=650,height=420,scrollbar=yes,menubar=no");





// ==========================================================================
window.onload = initPage;
// Note: Make sure that no other javscripts assign a fuction to window.onload
// There can be only one function tied to window.onload at a time.

function initPage() {
  initPopupLinks();
  MM_preloadImages ('Images/Buttons/Home2.gif','Images/Buttons/About2.gif','Images/Buttons/Services2.gif','Images/Buttons/Photo2.gif','Images/Buttons/Contact2.gif','Images/Buttons/Wallbeds2.gif','Images/Buttons/Products2.gif','Images/Buttons/Homes2.gif','Images/Buttons/About2.gif','Images/Buttons/Wallbeds2.gif','Images/Buttons/Products2.gif','Images/Buttons/Photo2.gif','Images/Buttons/Investors2.gif','Images/Buttons/before2.gif','Images/sign-up2.gif','Images/Buttons/resources2.gif','Images/Buttons/feng2.gif') 
}

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] : theKey;
          }
          pageLinks[i].settings = popupLinkConfig[theKey][1];
          pageLinks[i].onclick = popUp;
        }
      }
    }
  }
  return true;
}

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