/*
 * customGoogleSearchbox()
 *
 * Used to determine display google image within
 * search box when not in use
 *
 * Date: 7/03/2008
 * Last Revised by: TJ
 */
(function() { 
	var f = document.getElementById('searchbox_003101711403383086340:xhathpp67to'); 
	if (!f) { 
		f = document.getElementById('searchbox_demo'); 
	} 
	if (f && f.q) { 
		var q = f.q; 
		var n = navigator; 
		var l = location; 
		if (n.platform == 'Win32') { 
			q.style.cssText = 'border: 1px solid #7e9db9; padding: 2px;'; 
		} 
		var b = function() { 
			if (q.value == '') { 
				q.style.background = '#FFFFFF url(/img/google_search_watermark.gif) left no-repeat'; 
			} 
		}; 
		var f = function() { 
			q.style.background = '#ffffff'; 
		}; 
		q.onfocus = f; 
		q.onblur = b; 
		if (!/[&?]q=[^&]/.test(l.search)) { 
			b(); 
		} 
	}
})();

/*
 * validateSearch()
 *
 * Used to determine if patron is searching for
 * items within the catalog or pages index by
 * google
 *
 * Date: 2008/07/15
 * Last Revised by: Jason Roma
 */


function validateSearch(formName)
{
  if (formName.q.value != "") {
    if (document.searchTypeForm.searchType[0].checked) {
	  return true;
	}
	else if (document.searchTypeForm.searchType[1].checked) {
	  document.search.request.value = formName.q.value;
	  document.search.submit();
	  return false;
	}
	else {
	  alert("You must search either the website or catalog");
	  return false;
	}
  }
  return false;
}