jQuery(document).ready(function()
{
auto_url = "http://" + window.location.hostname + "/autocomplete/autocomplete_query.php";                                                                                      
itemformatter = function(item){ return item[0]; }                                                                                 
resulthandler = function(event, item){ location.href="http://gsearch.sparknotes.com/search?q="+item[0]+"&searchbg=&template=default&x=0&y=0&output=xml_no_dtd&oe=UTF-8&ie=UTF-8&client=default_frontend&proxystylesheet=default_frontend&site=default_collection"; }                                                                   
                                                                                                                                          
jQuery('.search_field').autocomplete(auto_url, {                                                                                       
                                            minChars: 1,                                                                          
                                            max: 0,                                                                               
                                            matchContains: true,                                                                  
                                            formatItem: itemformatter                                                             
        }).result(resulthandler);                                                                                                         
});
