//dynamic navigation
initNav = function() {
	if (typeof document.body.style.maxHeight == 'undefined') {
		var nav = document.getElementById("main-nav");
		var lis = nav.getElementsByTagName("li");
		for (var i=0; i<lis.length; i++)
		{
			lis[i].onmouseover = function()
			{
				this.className += " hover";
			}
			lis[i].onmouseout = function()
			{
				this.className = this.className.replace(" hover", "");
			}
		}
	}
}
if (document.all && !window.opera) attachEvent("onload", initNav);

function clearInput(){
	var _input = document.getElementsByTagName('input');
	for(var i = 0; i < _input.length; i++ ){
		if(_input[i].type == 'text' || _input[i].type == 'password'){
			_input[i]._val = _input[i].value;
			_input[i].onfocus = function(){
				if(this.value == this._val) this.value = '';
				if(this.parentNode.className.indexOf('input-hold') != -1) this.parentNode.style.border = '1px solid #f00';
			}
			_input[i].onblur = function(){
				if(this.value == '') this.value = this._val;
				if(this.parentNode.className.indexOf('input-hold') != -1) this.parentNode.style.border = '1px solid #999';
			}
		}
	}
}
if (window.addEventListener) window.addEventListener("load", clearInput, false);
else if (window.attachEvent) window.attachEvent("onload", clearInput);



//son of suckerfish
sfHover = function() {
	var sfEls = document.getElementById("top-navigation").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
