<search function="favDQSD">
  <name>Favorite Websites</name>
  <description>
    Create a complete list of favorite websites based on the lists of each browser.<br/>
    This list could potentially be augmented within the local preferences as well.
  </description>
  <link></link>
  <category nomenu="true">Favorites</category>
  <contributor>Ryan Carpenter</contributor>

  <script><![CDATA[
    function buildFavMenu(mb, hmenu)
    {
      mb.AppendMenuItem( "Google", "openSearchWindow('http://www.google.com/');", "http://www.google.com/", hmenu);
      mb.AppendMenuItem( "favorite pulled from IE folder or Ntscp bookmarks", "alert('Launch favorite website')", "url", hmenu);
      ensureLauncher();
    }

    function favDQSD(q)
    {
      // build the menu
      var mb = new ActiveXObject("DQSDTools.MenuBuilder");
      if (mb != null)
      {
        // Align the menu with the button
        mb.HorizontalAlignment = ( buttonalign == 'left' ? 1 : 2 ); // 1 = left, 2 = right (default)
        var hmenu = 0;
        buildFavMenu(mb, hmenu);
        var fn = mb.Display(document);
        if (fn) {
          eval(fn);
        }
        mb = null;
      }
    }

    function favMenuHook(mb)
    {
      var confhmenu = mb.InsertSubMenu("Favorites", 3);
      buildFavMenu(mb, confhmenu);
    }
	
    registerMenuHook(favMenuHook);
  ]]></script>
</search>
