function initPage()
{
	rolloverSubmit();
	hideTextForm();
}

if (window.addEventListener)
	window.addEventListener("load", initPage, false);
else if (window.attachEvent)
	window.attachEvent("onload", initPage);
	
function hideTextForm() {
	var _inputs = document.getElementsByTagName('input');
	var _textarea = document.getElementsByTagName('textarea');
	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(){
					_value = this.value;
					this.value = '';
				}
				_inputs[i].onblur = function(){
					if (this.value == '')
						this.value = _value;
					_value = '';
				}
			}
		}
	}
	if (_textarea) {
		for(var i=0; i<_textarea.length; i++) {
			_textarea[i].onfocus = function(){
				_value = this.value;
				this.value = '';
			}
			_textarea[i].onblur = function(){
				if (this.value == '')
					this.value = _value;
				_value = '';
			}
		}
	}
}
	
function rolloverSubmit(){
	var inputs = document.getElementsByTagName("input");
	for (var i=0; i<inputs.length; i++)  {
		if (inputs[i].className.indexOf("bt-") != -1 )  {
			inputs[i].onmouseover = function()
			{
			   this.src = this.src.replace(".gif", "-hover.gif");
			}
			inputs[i].onmouseout = function()
			{
				this.src = this.src.replace("-hover.gif", ".gif");
			}
		}
	}	
}

function ieHover()
{
	var nav = document.getElementById("nav");
	if (nav)
	{
		var nodes = nav.getElementsByTagName("li");
		for (var i=0; i<nodes.length; i++)
		{
			nodes[i].onmouseover = function() 
			{
				this.className += " hover";
			}
			nodes[i].onmouseout = function()
			{
				this.className = this.className.replace(" hover", "");
			}
		}
	}
}

if (window.attachEvent && !window.opera){
	window.attachEvent("onload", ieHover);
}