function startList() {
	if (document.all && document.getElementById) {
		navRoot = document.getElementById("dropdownnav");

		for (i=0; i < navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName == "LI") {
				node.onmouseover = function() {
					this.className += " over";
				}
				node.onmouseout = function() {
					this.className = this.className.replace(" over", "");
				}
			}
		}
	}
}

window.onload = function() {
	startList();
	Nifty("#first","same-height");
	//Nifty("p.desc","height");
	Nifty("#footernav","small");
}

//--- Image Mouseovers -------------------------------------

var outArr = new Array();
var overArr = new Array();
var path = "/pics/";
var ids = new Array("topics", "personalize", "about");

// preload
if (document.images) {
	for (i=0; i < ids.length; i++) {
		overArr[i] = new Image;
		overArr[i].src = path + ids[i] + "_on.gif";
		outArr[i] = new Image;
		outArr[i].src = path + ids[i] + "_off.gif"
	}
}

function over(n) {
	document.images[ids[n]].src = overArr[n].src;
}

function out(n) {
	document.images[ids[n]].src = outArr[n].src;
}

//--- Form Validations -------------------------------------

function validEmail(email) {
	invalidChars = " /:,;";
	if (email == "") {
		return false;
	}
	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i);
		if (email.indexOf(badChar,0) != -1) {
			return false;
		}
	}
	atPos = email.indexOf("@",1);
	if (atPos == -1) {
		return false;
	}
	if (email.indexOf("@",atPos+1) != -1) {
		return false;
	}
	periodPos = email.indexOf(".",atPos);
	if (periodPos == -1) {
		return false;
	}
	if (periodPos+3 > email.length)	{
		return false;
	}
	return true;
}