function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

// -----------------------------------
//  Default search text
// -----------------------------------
function clearSearchBox(theField,defText) {
	if(theField.value==defText) { theField.value=""; } 
}
function resetSearchBox(theField,defText) {
	if(theField.value=="") { theField.value=defText; } 
}
function initSearchBox() {
	var theField = document.getElementById("search-text");
	var defText = theField.value;
	theField.onfocus = function() { clearSearchBox(this,defText); }
	theField.onblur = function() { resetSearchBox(this,defText); }
}


// Engage
addLoadEvent(initSearchBox);