// STH: 2011-01-24: Toggle small|large stylesheet.
    var sActiveStylesheet = 'small';
    jQuery(function () {
        jQuery('.zoom').click(function () {
            jQuery('link[title="' + sActiveStylesheet + '"]').attr('disabled', 'disabled');
            sActiveStylesheet = (sActiveStylesheet == 'small') ? 'large' : 'small';
            jQuery('link[title="' + sActiveStylesheet + '"]').attr('disabled', 'disabled').attr('disabled', false);
        });
    })

    var aOldSearch = [];
    var searchResultContainer;
    var sPort = ('80' != '80') ? ':80' : '';
    var autocomplete = '/Default.aspx?ID=2197&autocomplete=true&q=';
    var q, oDelayedSearchTimer, cache = 0;
    var iWaitBeforeSearch = 500;
    jQuery(function () {

        if (window.location.href.indexOf('debug=true') == -1)
            return;

        // STH: 2011-02-10 This is the code handling autosuggest/dynamic search
        // The search page must be named "searchAutocomplete"
        // searchResultContainer must point to the input fields where query is entered
        // This code uses url pattern: "http://[Global:Request.Host]:[Global:Request.Port]/[LongLang]/WEBSITE/searchAutocomplete.aspx?autosuggest=true&q=[querystring]
        // an extra param "autosuggest" is set to true so that any statistics may use it to spot autocomplete request

        searchResultContainer = jQuery('#searchResult');
        searchResultContainer.hover(function () {
            searchResultContainer.toggleClass('hasFocus');
            if (!searchResultContainer.hasClass('hasFocus')) {
                oSearchField.trigger('blur');
            }
        })
        var oSearchField = jQuery('.GoogleSiteSearch')
        oSearchField.keyup(function () {
            q = jQuery.trim(jQuery(this).val());
            if (typeof oDelayedSearchTimer != 'undefined') {
                window.clearTimeout(oDelayedSearchTimer);
            }
            if (q.length > 1) {
                oDelayedSearchTimer = window.setTimeout(function () { doSearch(q) }, iWaitBeforeSearch);
            } else {
                if (cache > 0) {
                    searchResultContainer.fadeTo('fast', 0);
                }
            };
        });
        oSearchField.blur(function (e) {
            window.setTimeout(function () {
                if (!searchResultContainer.hasClass('hasFocus')) {
                    searchResultContainer.fadeTo('fast', 0);
                };
            }, 100);
        })
    });

    function doSearch(q) {
        if (q != '') {
            if (typeof aOldSearch[q] != 'undefined') {
                searchResultContainer.html(aOldSearch[q]).fadeTo('fast', 1);
            } else {
                searchResultContainer.load(autocomplete + escape(q), {}, function () {
                    aOldSearch[q] = searchResultContainer.fadeTo('fast', 1).html();
                    cache++;
                });
            };
        } else {
            searchResultContainer.fadeTo('fast', 0);
        };
    };
