    GoogleSuggestAutocompleter = Class.create();
    Object.extend(Object.extend(GoogleSuggestAutocompleter.prototype, Autocompleter.Local.prototype), {
        cache: {},
		selectEntry: function() {
			//if (event.keyCode != Event.KEY_TAB) {
				this.active = false;
				if (this.index!=10) { this.updateElement(this.getCurrentEntry()); }
				document.forms['f'].submit();
			//}
		},
        getUpdatedChoices: function() {
            var tok = this.getToken().toLowerCase();
            if (this.cache[tok]) return this.h( this.cache[tok] );
            var script = document.createElement('script');
            script.type = 'text/javascript';
            script.src = 'http://www.google.com/complete/search?hl=ru&client=suggest&js=true&q=' + encodeURIComponent(tok);
            document.body.appendChild(script);    
        },
        h: function( list ) {
			tok = document.getElementById('searchBox').value;
            if ((list[1].length) && (tok.length<2)) return this.updateChoices( '<ul></ul>' );
            if (!this.cache[tok]) this.cache[tok] = list;
            var values = [];
            for (var i=0; i<list[1].length; i+=1) {
                var v = list[1][i][0] + '';
				if (v!='undefined') {
					values.push('<b>'+v.slice(0, tok.length)+'</b>'+v.slice(tok.length));
				}
            }
			if (values != "") {
				this.updateChoices( '<ul><li>' + values.join('</li><li>') + '</li><ul>' );
				this.index=10;
				this.render();
			}
			else {
				this.hide();
			}
        }
    });
    
	var frameElement, google = {};
    
    Event.observe(window, 'load', function(event) {
        google.ac = new GoogleSuggestAutocompleter( "searchBox", "searchBoxSuggestions", null, { 
            minChars: 1, frequency: 0.1, autosubmit: true
        } );
    }, 'false');
