function AddSearch() {
    if ((navigator.appVersion.indexOf("MSIE") > 6) && (parseInt(navigator.appVersion) >= 4) && (typeof document.body.style.maxHeight != "undefined") && (document.URL.match(/http\:/i))) {
        window.external.AddSearchProvider('http://www.e-kao.net/provider.xml');
    }
    if ((!document.all && document.getElementById && navigator.userAgent.indexOf("Safari") < 0 && !window.opera) && (document.URL.match(/http\:/i))) {
        installOpenSearch('http://www.e-kao.net/providermoz.xml');
    } else {
        return;
    }
}

function AddService() {
    if ((document.documentMode && document.documentMode >= 8) && (document.URL.match(/http\:/i))) {
        window.external.AddService('http://www.e-kao.net/acceralators.xml');
    } else {
        return;
    }
}

function installSherlock(iconURL) {
    if (typeof window.sidebar == "object" && typeof window.sidebar.addSearchEngine == "function") {
        if (!iconURL) return true;
        window.sidebar.addSearchEngine(iconURL.slice(0, -4) + ".src", iconURL, null, null);
    } else {
        alert("この検索エンジンをインストールするには Firefox をご利用ください。");
    }
    return false;
}

function installOpenSearch(engineURL) {
    if (typeof window.external == "object" && typeof window.external.AddSearchProvider == "function") {
        if (!engineURL) return true;
        window.external.AddSearchProvider(engineURL);
    } else {
        alert("この検索エンジンをインストールするには Firefox 2以上 をご利用ください。");
    }
    return false;
}
