<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=<$Charset>">
    <link href="web_images/frame.css" type="text/css" rel="stylesheet" />
    <title><$Title></title>

    <script src="jscript/searchIndexs.js" type="text/javascript"></script>

    <script type="text/javascript">

        Array.prototype.indexOf = function(substr, start) {
            var ta, rt, d = '\0';
            if (start != null) { ta = this.slice(start); rt = start; } else { ta = this; rt = 0; }
            var str = d + ta.join(d) + d, t = str.indexOf(d + substr + d);
            if (t == -1) return -1; rt += str.slice(0, t).replace(/[^\0]/g, '').length;
            return rt;
        }

        function Search() {
            window.parent.frames["frameContent"].ClearPage();
            var keywords = document.getElementById("tbxKey").value.toLowerCase();

            var d = /[^\x00-\xff]|([a-z0-9\'-]+)/ig;
            var result = keywords.match(d);

            parent.Keys = result;

            if (result != null) {
                var vs = new Array(result.length);
                var minvalue = null;

                for (i = 0; i < result.length; i++) {
                    var values = GetIndexs(result[i]);
                    if (values != null) {
                        vs[i] = values;

                        if (minvalue == null) {
                            minvalue = values;
                        }
                        else {
                            if (values.length < minvalue.length) {
                                minvalue = values;
                            }
                        }
                    }
                }

                if (minvalue != null) {
                    for (i = 0; i < minvalue.length; i++) {
                        var found = true;
                        for (_i = 0; _i < vs.length; _i++) {
                            if (vs[_i] != null) {
                                if (vs[_i].indexOf(minvalue[i]) == -1) {
                                    found = false;
                                    break;
                                }
                            } else {
                                found = false;
                                break;
                            }
                        }
                        if (found) {
                            window.parent.frames["frameContent"].ShowPage(minvalue[i]);
                        }
                    }
                }
            }
        }

        function GetIndexs(keyword) {
            var values = null;
            var i = 0;
            var index = ks.indexOf(keyword);
            if (index > -1) {
                values = is[index];
            }
            return values;
        }

        function GetIndexs1(keyword) {
            var values = null;
            var i = 0;
            for (i = 0; i < ks.length; i++) {
                if (ks[i] == keyword) {
                    values = is[i];
                    break;
                }
            }

            return values;
        }

    </script>

</head>
<body>
    <table style="width: 100%" cellpadding="0" cellspacing="0">
        <tr>
            <td class="button border_bottom_top">
                <a href="javascript:parent.location='tableContents_frame.html';void(0);"><$TableOfContents></a>
            </td>
            <td class="button border_bottom_top">
                <a href="javascript:parent.location='index_frame.html';void(0);"><$Index></a>
            </td>
            <td class="button bg border_left border_top border_right">
                <$Search>
            </td>
            <td class="border_bottom_top">
            </td>
        </tr>
        <tr>
            <td colspan="4" class="textinput bg border_left border_right border_bottom" style="padding:4px">
                <$InputKeywordsTips><br />
                <input id="tbxKey" type="text" /><br />
                <input id="btnSearch" type="button" value="<$ListTopics>" onclick="Search();" class="searchbutton" />
            </td>
        </tr>
    </table>
</body>
</html>
