function initPage()
{

	var inputs = document.getElementsByTagName("input");
	for (var i=0; i<inputs.length; i++)
	{
		if (inputs[i].type == "text" && (inputs[i].name == "email"))
		{
			var form = getAncestor(inputs[i], "form");
			inputs[i].onfocus = function () {
				if ((this.value == "Your Email Here...")){
					this.value = "";
				}
			}
			inputs[i].onblur = function () {
				if (this.value == "" && this.name == "email") this.value = "Your Email Here...";
			}
		}
	}
	if (navigator.appVersion.indexOf("Safari") != -1) document.body.className += " safari";
}

function getAncestor(element, tagName)
{
	var node = element;
	while (node.parentNode && (!node.tagName || (node.tagName.toUpperCase() != tagName.toUpperCase())))
		node = node.parentNode;
	return node;
}

function navList()
{

	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(new RegExp(" hover"), "");
			}
		}
	}
}

if (window.addEventListener){
	window.addEventListener("load", initPage, false);
}
else if (window.attachEvent){
	window.attachEvent("onload", initPage);
	window.attachEvent("onload", navList);
}



				// check multi checkboxes based on the name passed in.
				function CheckMultiple(name) 
				{
					theFrm = document.frmSS;
					for (var i=0; i < theFrm.length; i++) 
					{
						fldObj = theFrm.elements[i];
						var fieldnamecheck=fldObj.name.indexOf(name);
						if (fieldnamecheck != -1) {
							if (fldObj.checked) {
								return true;
							}
						}
					}
					return false;
				}


				function CheckSS()
				{
					theFrm = document.frmSS;

					hasDot = theFrm.Email.value.indexOf(".");
					hasAt = theFrm.Email.value.indexOf("@");
					
							if (!CheckMultiple("SelectLists")) {
								alert("Please choose a mailing list to subscribe to.");
								return false;
							}
						
					if (hasDot == -1 || hasAt == -1)
					{
						alert("Please enter a valid email address.");
						theFrm.Email.focus();
						theFrm.Email.select();
						return false;
					}

					
					return true;
				}


function openURL()
{

      // grab index number of the selected option
      selInd = document.theForm.popular.selectedIndex;

      // get value of the selected option
      goURL = document.theForm.popular.options[selInd].value;

      // redirect browser to the grabbed value (here a URL)
      top.location.href = goURL;

}

//-->



