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("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 clearField(thefield) {
	if (thefield.defaultValue==thefield.value)
		thefield.value = ""
}
function swapField() {
		document.getElementById("passfield").innerHTML = "<input id='password' name='vpd_password' type='password'>"
		document.getElementById("username").focus()
		document.getElementById("password").focus()
}
