function BlurHintedField() { if (this.value == '') { this.value = this.title; }	}
function FocusHintedField() { if (this.value == this.title) { this.value = ''; } }
function CheckSearchEntry() { if (this.query.value == '' || this.query.value == this.query.title) { alert("Please enter some search terms"); return false; } else { return true; } }
function QuickLinksHandler() { var selectField =  document.getElementById('qlselect'); var url = selectField.options[selectField.selectedIndex].value; window.location = url; }

window.onload = function() {
  // Initialise search query field
  var searchForm;
  if (searchForm = document.getElementById('search')) {
  	var searchField = searchForm.query;
  	searchField.onfocus = FocusHintedField;
  	searchField.onblur = BlurHintedField;
  	searchForm.onsubmit = CheckSearchEntry;
  }
  
  if (document.getElementById('quicklinks')) {
    var goButton = document.getElementById('qlbutton');
    goButton.onclick = QuickLinksHandler;
    goButton.onkeyup = QuickLinksHandler;
  }
}