function initInputs() {
	var _inputs = document.getElementsByTagName('input');
	var _select = document.getElementsByTagName('span');
	var _value = '';
	if (_inputs) {
		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("input-txt") != -1) this.parentNode.className += ' selected';
					if(this.name == "search_query") {
						_value = this.value;
						this.value = '';
					}
				}
				_inputs[i].onblur = function(){
					if (this.className.indexOf("input-txt") != -1) this.parentNode.className = this.parentNode.className.replace(' selected','');
					if (this.name == "search_query") {
						if (this.value == '')
						  this.value = _value;
						  _value = '';
					}
				}
			}
		}
	}
}

if (window.addEventListener)
	window.addEventListener("load", initInputs, false);
else if (window.attachEvent)
	window.attachEvent("onload", initInputs);

