function initPage(){
	clearTextarea();
	clearInputs();
}
function clearTextarea(){
	var _txt = document.getElementsByTagName('textarea');
	var _value = [];
	if (_txt)
	{
		for(var i=0; i<_txt.length; i++)
		{
			_txt[i].index = i;
			_value['txt'+i] = _txt[i].value;
			_txt[i].onfocus = function()
			{
				if (this.value == _value['txt'+this.index] && this.className.indexOf("focus") == -1)
					this.className += " focus";
			}
			_txt[i].onblur = function()
			{
				if (this.value == '')
					this.className = this.className.replace(" focus", "");
			}
		}
	}
}
function clearInputs(){
	var inputs = document.getElementsByTagName("input");
	for (var i=0; i<inputs.length; i++)
	{
		if (inputs[i].type == "text")
		{
			inputs[i].onfocus = function ()
			{
				value = this.value;
				this.value = "";
			}
			inputs[i].onblur = function ()
			{
				if (this.value == "")
					this.value = value;
				value = "";
			}
		}
		
	}
}
if (window.addEventListener){
	window.addEventListener("load", initPage, false);
} else if (window.attachEvent){
	window.attachEvent("onload", initPage);
}

