function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function addNavBehavior() {
	var nav = Array(document.getElementById("home"), 
		document.getElementById("ourwork"),
		document.getElementById("services"),
		document.getElementById("products"), 
		document.getElementById("company"), 
		document.getElementById("contactus"));
		
	for(var i = 0; nav[i]; i++) {
		nav[i].onmouseover = function() { 
			this.className = "hover";
		}
		nav[i].onmouseout = function() {
			this.className = "";
		}
	}
}

addLoadEvent(addNavBehavior);

function replace_password() {
		//var passfield_html = "<input id='password_formatting' name='vpd_password_formatting' type='password' style='display: none'>";
		var passfield_html = "<input id='password' name='vpd_password' type='password' class='text'>";

		//fix formatting in IE
		if(/MSIE (5|6|7)/.test(navigator.userAgent)) {
			passfield_html = "<input id='password' name='vpd_password' type='password' class='text' style='width: 89px; margin-right: 2px;'>";
		}

		document.getElementById("passfield").innerHTML = passfield_html;
}
function clearField(thefield) {
	if (thefield.defaultValue==thefield.value) {
		thefield.value = ""
	}
	replace_password();
}
function swapField() {
		replace_password();
		document.getElementById("username").focus();
		document.getElementById("password").focus();
}

