Varien.searchForm = Class.create(); Varien.searchForm.prototype = {    initialize : function(form, field, emptyText){        this.form   = $(form);        this.field  = $(field);        this.emptyText = emptyText;        Event.observe(this.form,  'submit', this.submit.bind(this));        Event.observe(this.field, 'focus', this.focus.bind(this));        Event.observe(this.field, 'blur', this.blur.bind(this));        this.blur();    },    submit : function(event){        if (this.field.value == this.emptyText || this.field.value == ''){            Event.stop(event);            return false;        }        return true;    },    focus : function(event){        if(this.field.value==this.emptyText){            this.field.value='';        }    },    blur : function(event){        if(this.field.value==''){            this.field.value=this.emptyText;        }    },    initLivesearch : function(url, destinationElement, charstostart){        		new Ajax.Autocompleter(this.field, destinationElement, url, {		              		paramName: this.field.name,					minChars: charstostart,					indicator: 'lsloading',					updateElement: this._selectLivesearchItem.bind(this),					onShow : function(element, update) {     						if(!update.style.position || update.style.position=='absolute') {                        										update.style.position = 'absolute';							                        Position.clone(element, update, {											setHeight: false,											offsetTop: element.offsetHeight                        										});    setTimeout( function() {      Element.clonePosition('search_autocomplete', 'search', {      'setWidth': false,      'setHeight': false,      'offsetTop': $('search').offsetHeight    } );  }, 300);                    				}		                    	Effect.Appear(update,{duration:0});			                }            }        );    },    _selectLivesearchItem : function(element){        if(element.title){            window.location = element.title;                    }            }}