function initInputs()
{
	inputs = document.getElementsByTagName("input");
	if (inputs){
		for (var i = 0, length = inputs.length; i < length; i++){
			if ((inputs[i].type == "text") && (inputs[i].value == "") && (inputs[i].title != "")){
				inputs[i].value = inputs[i].title;
				inputs[i].className += " clear";
				inputs[i].onfocus = function(){
					if (this.className.indexOf("clear") != -1) this.className = this.className.replace("clear", "");
					if (this.value == this.title) this.value = "";
				}
				inputs[i].onblur = function(){
					if (this.value == ""){
						this.value = this.title;
						this.className += " clear";
					}
				}
			}
		}
	}
}

function initTextareas() {
	var textareas = document.getElementsByTagName("textarea");
	for (var i = 0; i < textareas.length; i++) {
		textareas[i]._value = textareas[i].value;
		textareas[i]._static = false;
		if (textareas[i].className.indexOf("static") != -1)
		{
			textareas[i]._static = true;
		}
		textarea_Blur(textareas[i]);
		textarea_Focus(textareas[i]);
	}
}

function textarea_Focus(_obj) {
	_obj.onfocus = function ()
	{
		if (!this._static) {
			if (this.value == this._value)
			{
				this.value = "";
				this.innerHTML = "";
			}
		}
		this.className += " hovered";
	}
}

function textarea_Blur(_obj) {
	_obj.onblur = function ()
	{
		if (!this._static)
		{
			if (this.value == "")
			{
				/* note! may be some collisions with "autofill" function in some browsers (Firefox detected) */
				this.value = this._value;
			}
		}
		this.className = this.className.replace("hovered", "");
	}
}
