
    google.load('search', '1');

    function OnLoad() {
        var searchControl = new google.search.SearchControl();

        if ( document.getElementById("google_site_results") ) {
            var siteOptions = new google.search.SearcherOptions();
            siteOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
            siteOptions.setRoot(document.getElementById("google_site_results"));

            var siteSearch = new google.search.WebSearch();
            siteSearch.setSiteRestriction(window.location.hostname);

            searchControl.addSearcher(siteSearch, siteOptions);
        }

        //////////////////////////////////////////////////////////////////////////

        if ( document.getElementById("google_encyclopedia_results") ) {
            var encyclopediaOptions = new google.search.SearcherOptions();
            encyclopediaOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
            encyclopediaOptions.setRoot(document.getElementById("google_encyclopedia_results"));

            var encyclopediaSearch = new google.search.WebSearch();
            encyclopediaSearch.setSiteRestriction('010556040290576196251:oq0qbndamcc');

            searchControl.addSearcher(encyclopediaSearch, encyclopediaOptions);
        }

        //////////////////////////////////////////////////////////////////////////

        if ( document.getElementById("google_dictionary_results") ) {
            var dictionaryOptions = new google.search.SearcherOptions();
            dictionaryOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
            dictionaryOptions.setRoot(document.getElementById("google_dictionary_results"));

            var dictionarySearch = new google.search.WebSearch();
            dictionarySearch.setSiteRestriction('010556040290576196251:8jdnbm61pzu');

            searchControl.addSearcher(dictionarySearch, dictionaryOptions);
        }

        //////////////////////////////////////////////////////////////////////////

        if ( document.getElementById("google_answer_results") ) {
            var answerOptions = new google.search.SearcherOptions();
            answerOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
            answerOptions.setRoot(document.getElementById("google_answer_results"));

            var answerSearch = new google.search.WebSearch();
            answerSearch.setSiteRestriction('010556040290576196251:a866lawjwns');

            searchControl.addSearcher(answerSearch, answerOptions);
        }

        //////////////////////////////////////////////////////////////////////////

        if ( document.getElementById("google_product_results") ) {
            var productOptions = new google.search.SearcherOptions();
            productOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
            productOptions.setRoot(document.getElementById("google_product_results"));

            var productSearch = new google.search.WebSearch();
            productSearch.setSiteRestriction('010556040290576196251:c62yszqvt8u');

            searchControl.addSearcher(productSearch, productOptions);
        }

        //////////////////////////////////////////////////////////////////////////

        if ( document.getElementById("google_directory_results") ) {
            var directoryOptions = new google.search.SearcherOptions();
            directoryOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
            directoryOptions.setRoot(document.getElementById("google_directory_results"));

            var directorySearch = new google.search.WebSearch();
            directorySearch.setSiteRestriction('010556040290576196251:nbfcei_lds4');

            searchControl.addSearcher(directorySearch, directoryOptions);
        }

        //////////////////////////////////////////////////////////////////////////

        if ( document.getElementById("google_web_results") ) {
            var webOptions = new google.search.SearcherOptions();
            webOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
            webOptions.setRoot(document.getElementById("google_web_results"));

            var webSearch = new google.search.WebSearch();
            searchControl.addSearcher(webSearch, webOptions);
        }

        //////////////////////////////////////////////////////////////////////////

        if ( document.getElementById("google_video_results") ) {
            var videoOptions = new google.search.SearcherOptions();
            videoOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
            videoOptions.setRoot(document.getElementById("google_video_results"));

            var videoSearch = new google.search.VideoSearch();
            searchControl.addSearcher(videoSearch, videoOptions);
        }

        //////////////////////////////////////////////////////////////////////////

        if ( document.getElementById("google_image_results") ) {
            var imageOptions = new google.search.SearcherOptions();
            imageOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
            imageOptions.setRoot(document.getElementById("google_image_results"));

            var imageSearch = new google.search.ImageSearch();
            searchControl.addSearcher(imageSearch, imageOptions);
        }

        //////////////////////////////////////////////////////////////////////////

        if ( document.getElementById("google_news_results") ) {
            var newsOptions = new google.search.SearcherOptions();
            newsOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
            newsOptions.setRoot(document.getElementById("google_news_results"));

            var newsSearch = new google.search.NewsSearch();
            searchControl.addSearcher(newsSearch, newsOptions);
        }

        //////////////////////////////////////////////////////////////////////////

        if ( document.getElementById("google_blog_results") ) {
            var blogOptions = new google.search.SearcherOptions();
            blogOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
            blogOptions.setRoot(document.getElementById("google_blog_results"));

            var blogSearch = new google.search.BlogSearch();
            searchControl.addSearcher(blogSearch, blogOptions);
        }

        //////////////////////////////////////////////////////////////////////////

        if ( document.getElementById("google_local_results") ) {
            var localOptions = new google.search.SearcherOptions();
            localOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
            localOptions.setRoot(document.getElementById("google_local_results"));

            var localSearch = new google.search.LocalSearch();
            localSearch.setCenterPoint(coords);
            searchControl.addSearcher(localSearch, localOptions);
        }

        //////////////////////////////////////////////////////////////////////////


        searchControl.draw(document.getElementById("search_control"));

        searchControl.execute(searchTerm);
    }

    google.setOnLoadCallback(OnLoad);
