function Google() {} Google.prototype.Onload = function() { var terms = document.getElementById( "text_2" ); var location = document.getElementById( "suggestbox_2" ); if ( terms.value == "" && location.value == "" ) { return; } var panel = document.getElementById( "search_result" ); var num = (5 - panel.getElementsByTagName("div").length / 7); if ( num < 0 ) { alert( num ); return; } var xmlhttprequest = new AJAX(); xmlhttprequest.open( "GET", "/_search/custom-search?t=" + terms.value + "&l=" + location.value + (num != 5 ? "&num=" + num : ""), true ); xmlhttprequest.onreadystatechange = function() { if ( xmlhttprequest.readyState == 4 ) { var results = xmlhttprequest.responseXML.getElementsByTagName("R"); Google.prototype.BuildResults( results ); } }; xmlhttprequest.send(null); }; Google.prototype.BuildResults = function( xml ) { var results = new Array(), classval; var title, summary, url; var panel = document.getElementById( "search_result" ); var loading_msg = document.getElementById( "loading_msg" ); if (loading_msg != null) loading_msg.style.display = 'none'; for ( var i = 0; i < xml.length; i++ ) { classval = "search_result"; if ( (i%2)==0 ) { classval += " bg"; } title = xml[i].getElementsByTagName("T"); summary = xml[i].getElementsByTagName("S"); url = xml[i].getElementsByTagName("U"); results.push( "
"; panel.innerHTML += "As much as we would like to be able to have infomation on every "; panel.innerHTML += "organisation from day one, this is not possible and unfortunately "; panel.innerHTML += " we do not have any information on your search query. "; panel.innerHTML += "
"; panel.innerHTML += ""; panel.innerHTML += "Please spread the word about wheredo-i.com.au and hopefully next "; panel.innerHTML += "time you search we will be able to help you!"; panel.innerHTML += "
"; return; } else if ( xml.length == 0 ) { return; } // update the id="content" height if ( panel.parentNode.parentNode.parentNode.clientHeight < (panel.clientHeight + 80) ) { panel.parentNode.parentNode.parentNode.style.height = (panel.clientHeight + 80) + "px"; } };