//Javascript for hints
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++){
  	if (inputs[i].className =='loginfield') {
		if (inputs[i].title == "Username/Email")  {
			inputs[i].value = inputs[i].title;
			inputs[i].className ='hint';
		}
		else if (inputs[i].title == "Password")  {
			inputs[i].value = inputs[i].title;
			inputs[i].className ='hint';
		}
		inputs[i].onfocus = function () {
		  if (this.className=='hint') { this.className = ''; this.value = ''; }
		}
		inputs[i].onblur = function () {
		  if (this.value == '') { this.className = 'hint'; this.value = this.title; }
		}
	}
  }
}