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; } }

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;
  }
}

function quicklinks() 
{
    var theselect = document.getElementById("qlselect");
	var theurl = theselect.options[theselect.selectedIndex].value;
	if(theurl.indexOf("%") != -1) theurl = decode(theurl);
	window.location = theurl;
}

function decode(starturl)
{
	var endurl = "";
	for(var i = 0; i < starturl.length; i++)
	{
		if(starturl.charAt(i) != "%") { endurl += starturl.charAt(i); }
		else { endurl += unescape(starturl.charAt(i++)+starturl.charAt(i++)+starturl.charAt(i)); }
	}
	return endurl;
}
