<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs
        title="&#xD2E;&#xD32;&#xD2F;&#xD3E;&#xD33;&#xD02; search"
        description="Malayalam transliteration based query composer"
        directory_title="Official Google search gadget for entering queries using Malayalam Google transliteration"
        author="M. T. Raghunath"
        author_affiliation="Google Inc."
        author_location="Bangalore, India"
        author_email="indialabs+indictransliteration@google.com"
        scrolling="false"
        screenshot="/ig/modules/malayalam_translit.png"
        thumbnail="/ig/modules/malayalam_translit_thm.png"
        height="120"
        render_inline="never"
        category="tools">
        <Require feature="dynamic-height"/>
        <Require feature="analytics"/>
  </ModulePrefs>
  <UserPref name="restrict" display_name="Site restrict or Custom Search Engine ID:"
        datatype="string" default_value="" />
  <UserPref name="new_window" display_name="Results in new window?"
        datatype="bool" default_value="true" />

  <Content type="html"> <![CDATA[
    <style type="text/css">
      @import url(http://www.google.com/uds/modules/elements/transliteration/api.css);
    </style>
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script language="Javascript" type="text/javascript">
      google.load("elements", "1", { packages: "transliteration" });
    </script>
    <script language="Javascript" type="text/javascript">
      var restrict;
      function onLoadHandler() {
        var options = {
          sourceLanguage:
            google.elements.transliteration.LanguageCode.ENGLISH,
          destinationLanguage:
            google.elements.transliteration.LanguageCode.MALAYALAM,
          shortcutKey: 'ctrl+g',
          transliterationEnabled: true
        };
        var control =
          new google.elements.transliteration.TransliterationControl(options);
        var ids = ["q"];
        var prefs = new _IG_Prefs();
        restrict = prefs.getString("restrict");
        if (restrict.indexOf("http://") == 0) restrict = restrict.substr(7);
        if (restrict.indexOf(":") != -1) {
          // Custom Search Engine Requested
          document.getElementById("f").action = "http://www.google.co.in/cse";
          cseid_leading = restrict.substr(0, restrict.indexOf(":"));
          cseid_trailing = restrict.substr(restrict.indexOf(":")+1);
          document.getElementById("contain").innerHTML += "<input name='cx' value=" + _esc(cseid_leading) + ":" + _esc(cseid_trailing) + " type='hidden' />";
        }
        var newwindow = prefs.getBool("new_window");
        if (!newwindow) document.getElementById('f').target = "_top";
        control.makeTransliteratable(ids);
        var searchBox = document.getElementById("q");
        var minHeight = searchBox.offsetHeight * 7;
        _IG_AdjustIFrameHeight(minHeight);
      }
      function patchsite() {
        if ((restrict != "") && (restrict.indexOf(":") == -1)) {
          document.getElementById("q").value += " site:" + _esc(restrict);
        }
        return(true);
      }
      _IG_RegisterOnloadHandler(onLoadHandler);
    </script>
    <script type="text/javascript">
      _IG_Analytics("UA-2050665-1","/Malayalam/Translit");
    </script>
    <center lang="ml">
      <form id="f" name="f" method="get"
          action="http://www.google.co.in/search" target="_blank">
        <div id="contain">
          <input type="text" id="q" name="q" value="" maxlength="2048"
            style="width:100%;" ><br/>
          <input id="btnG" name="btnG" type="submit" onClick="patchsite();" value="&#xD05;&#xD28;&#xD4D;&#xD35;&#xD47;&#xD37;&#xD3F;&#xD15;&#xD4D;&#xD15;&#xD41;&#xD15;" style="font-family: sans-serif;"/>&nbsp;
          <input id="btnI" name="btnI" type="submit" onClick="patchsite();"
            value="&#xD1E;&#xD3E;&#xD28;&#xD4D;&#x200D; &#xD2D;&#xD3E;&#xD17;&#xD4D;&#xD2F;&#xD35;&#xD3E;&#xD28;&#xD3E;&#xD23;&#xD46;&#xD28;&#xD4D;&#xD28;&#xD4D; &#xD24;&#xD4B;&#xD28;&#xD4D;&#xD28;&#xD41;&#xD28;&#xD4D;&#xD28;&#xD41;" style="font-family: sans-serif;"/>&nbsp;
          <input name="hl" type="hidden" id="langcode" value="ml"/>
          <input name="source" type="hidden" id="source" value="transl_ml"/>
        </div>
      </form>
    </center>
    <font size="-2">
      Type an English word followed by space to convert it to &#xD2E;&#xD32;&#xD2F;&#xD3E;&#xD33;&#xD02;<br/>
      Press Ctrl-G to toggle between English and &#xD2E;&#xD32;&#xD2F;&#xD3E;&#xD33;&#xD02; <br/>
      Click on the &#xD2E;&#xD32;&#xD2F;&#xD3E;&#xD33;&#xD02; word to see more alternatives<br/>
    </font>
  ]]>
  </Content>
</Module>
