﻿            google.load('search', '1');
        
            function OnLoad() {

                // create a search control
                var searchControl = new google.search.SearchControl();

                // Set the Search Control to get the most number of results
                searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
                searchControl.setLinkTarget(google.search.Search.LINK_TARGET_SELF);

                // Create 2 searchers and add them to the control
                var webSearch = new google.search.WebSearch();
                if (sSiteRestriction != "") {
                    webSearch.setSiteRestriction(sSiteRestriction);
                }
                searchControl.addSearcher(webSearch);

                // Set the options to draw the control in tabbed mode
                var drawOptions = new google.search.DrawOptions();
                drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);

                // Draw the control onto the page
                searchControl.draw(document.getElementById("searchcontrol"), drawOptions);

                // Search, if we have some terms
                if (sSearchTerms != "") {
                    searchControl.execute(sSearchTerms);
                }
            }
            google.setOnLoadCallback(OnLoad);
