Index: modules/tv/init.php
===================================================================
--- modules/tv/init.php	(revision 14972)
+++ modules/tv/init.php	(working copy)
@@ -32,6 +32,7 @@
                                                   'schedules/manual' => t('Schedule Manually'),
                                                   'schedules/custom' => t('Custom Schedule'),
                                                   'recorded'         => t('Recorded Programs'),
+                                                  'opensearch'       => t('Firefox Search Plugin'),
                                                  ),
                           );
 
Index: modules/tv/opensearch.php
===================================================================
--- modules/tv/opensearch.php	(revision 0)
+++ modules/tv/opensearch.php	(revision 0)
@@ -0,0 +1,67 @@
+<?php
+/**
+ * An OpenSearch system for suggesting program names from the firefox toolbar
+ *
+ * @url         $$
+ * @date        $$
+ * @version     $$
+ * @author      $$
+ * @license     GPL
+ *
+ * @package     MythWeb
+ * @subpackage  TV
+ *
+/**/
+
+
+if ($_REQUEST['type'] == 'xml') 
+{
+header("Content-Type: application/xml"); 
+echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+?>
+<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
+  <ShortName>MythTV</ShortName>
+  <Description>Search MythTV</Description>
+  <Url type="application/x-suggestions+json"
+       method="GET"
+       template="http://<?php echo $_SERVER["SERVER_NAME"]; echo root?>tv/opensearch?type=suggest&amp;search={searchTerms}">
+  </Url>
+  <Url type="text/html" 
+       method="GET"
+       template="http://<?php echo $_SERVER["SERVER_NAME"]; echo root?>tv/search?type=q&amp;search=Search&amp;s={searchTerms}">
+  </Url>
+  <Image height="16" width="16" type="image/png">http://<?php echo $_SERVER["SERVER_NAME"]; echo skin_url ?>img/favicon.ico</Image>
+</OpenSearchDescription>
+<?php
+exit;
+
+}
+
+if ($_REQUEST['type'] == 'suggest') 
+{
+if (!isset($_REQUEST['search'])){
+    echo "ERROR: Must have a search term";
+    exit;
+    }
+
+$search = $_REQUEST['search'];
+echo '["'.$search.'",[';
+
+$sh = $db->prepare('SELECT DISTINCT title FROM program WHERE title LIKE ? LIMIT 10');
+$sh->execute($search."%");
+
+$middle=0;
+while ($data =  $sh->fetch_row()){
+    if ($middle) echo ",";
+    $middle=1;
+    $title = $data[0];
+    $title = addslashes($title);
+    echo "\"".$title."\"";
+    }
+echo "]]";
+exit;
+}
+
+// Exit
+    exit;
+
Index: modules/_shared/tmpl/default/header.php
===================================================================
--- modules/_shared/tmpl/default/header.php	(revision 14972)
+++ modules/_shared/tmpl/default/header.php	(working copy)
@@ -124,6 +124,7 @@
     </div>
 </div>
 
+<link type="application/opensearchdescription+xml" rel="search" href="<?php echo root ?>tv/opensearch?type=xml" title="MythTV">
 
 <table width="100%" border="0" cellspacing="2" cellpadding="0">
 <tr>
