Search Results

Loading


// JavaScript Document
/**
* Custom Search Engine code + modification to only one

in the main content. (Either page content or search results)
*/

function findByClass(tagName, className) {
var r = new RegExp(‘\\b’ + className + ‘\\b’);
var elements = document.getElementsByTagName(tagName);
for (var i = 0; i < elements.length; i++) { var e = elements[i]; if (e.className && r.test(e.className)) { return e; } } return null; } function searchSubmitted() { var e; if ((e = findByClass('input', 'gsc-input')) != null) { if (e.value === '') { searchCleared(); } } } function searchComplete() { document.getElementById('cse') .style.display = 'block'; document.getElementById('staticContent') .style.display = 'none'; } function searchCleared() { document.getElementById('staticContent') .style.display = 'block'; document.getElementById('cse') .style.display = 'none'; } function init() { var cseId = '012929099131817029369:km4taugrupq'; var customSearchControl = new google.search.CustomSearchControl(cseId); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); customSearchControl.setSearchCompleteCallback(null, searchComplete); var options = new google.search.DrawOptions(); options.setSearchFormRoot('cse-search-form'); customSearchControl.draw('cse', options); var e; if ((e = findByClass('form', 'gsc-search-box')) != null) { if (e.addEventListener) { e.addEventListener('submit', searchSubmitted, false); } else if (e.attachEvent) { e.attachEvent('onsubmit', searchSubmitted); } } if ((e = findByClass('input', 'gsc-search-button')) != null) { if (e.addEventListener) { e.addEventListener('click', searchSubmitted, false); } else if (e.attachEvent) { e.attachEvent('onclick', searchSubmitted); } } if ((e = findByClass('div', 'gsc-clear-button')) != null) { if (e.addEventListener) { e.addEventListener('click', searchCleared, false); } else if (e.attachEvent) { e.attachEvent('onclick', searchCleared); } } }

google.load(‘search’, ‘1’);
google.setOnLoadCallback(init, true);