function autoCsearches () { var options = { script:"/wp-content/plugins/AutoCompletionSearches/suggest.php?", varname:"input", json:true, maxresults: 35, noresults: "", shownoresults: , delay: , cache: }; var as_json = new bsn.AutoSuggest('', options); } //setup onload function if(typeof window.addEventListener != 'undefined') //.. gecko, safari, konqueror and standard window.addEventListener('load', autoCsearches, false); else if(typeof document.addEventListener != 'undefined') //.. opera 7 document.addEventListener('load', autoCsearches, false); else if(typeof window.attachEvent != 'undefined') //.. win/ie window.attachEvent('onload', autoCsearches); else //** remove this condition to degrade older browsers : mac/ie5 and anything else that gets this far { if(typeof window.onload == 'function') //if there's an existing onload function { var existing = onload; window.onload = function() //add new onload handler { existing(); //call existing onload function autoCsearches(); //call replacetext onload function }; } else //setup onload function window.onload = autoCsearches; }