function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function prepareInputsForHints() {
	var inputs = document.getElementsByTagName("input");
	for (var i=0; i<inputs.length; i++){
			inputs[i].onfocus = function () {
				if (this.value == this.title) {
					this.value = '';
					//this.select();
				}
			}
			inputs[i].onblur = function () {
				if (this.value == '') {
					this.value = this.title;
				}
			}
	}
}
addLoadEvent(prepareInputsForHints);