function initInputs()
{
	var inputs = document.getElementsByTagName("input");
	var textarea = document.getElementsByTagName("textarea");
	for (var i=0; i<inputs.length; i++)
	{
		if ((inputs[i].type == "text") || (inputs[i].type == "password")) {
			inputs[i].onfocus = function ()
			{
					if (this.className.indexOf("focus") == -1)
					{
						this.className += " focus";
					}
			}
			inputs[i].onblur = function ()
			{
				if (this.value == "")
					{
						this.className = this.className.replace("focus", "");
					}
			}
		}
	}
	for (var j=0; j<textarea.length; j++) {
		textarea[j].onfocus = function ()
		{
				if (this.className.indexOf("focus") == -1)
				{
					this.className += " focus";
				}
		}
		textarea[j].onblur = function ()
		{
			if (this.value == "")
				{
					this.className = this.className.replace("focus", "");
				}
		}
	}
}

if (window.addEventListener){
	window.addEventListener("load", initInputs, false);
}
else if (window.attachEvent){
	window.attachEvent("onload", initInputs);
}
