// JavaScript Document

//************************************************************
// LOADS THE NECESSARY FUNCTIONS FOR SITE
function addLoadEvent(func)
	{
		var oldonload = window.onload;
		if (typeof window.onload != 'function')
			{
				window.onload = func;
			}
		else
			{
				window.onload = function()
					{
						oldonload();
						func();
					}
			}
	}
	
// END LOADS THE NECESSARY FUNCTIONS FOR SITE
//************************************************************

//************************************************************
// FOR POPUP WINDOWS - NEW WINDOW
// add 'class="popup"' to any link that you want to open in a new window

function popUp(winURL)
	{
		window.open(winURL, "popup");	
	}
	
function openNewWindow() 
	{
		if (!document.getElementsByTagName) return false;
		var lnks = document.getElementsByTagName("a");
		for (var i=1; i<lnks.length; i++) 
			{
				if(lnks[i].className == "popup")
					{
						lnks[i].onclick = function()
							{
								popUp(this.getAttribute("href"));
								return false;
							}
					}
			}
		
	}
	
// END FOR POPUP WINDOWS - NEW WINDOW
//************************************************************

// ******************************
// HAD TO PUT THIS IN THE ACTUAL HEADER IN ORDER FOR IT TO WORK
// ON IE 6 COMMENTED IT OUT IN THE JAVASCRIPT FILE


startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
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=startList;
	

//************************************************************
// FORMS: initial values
// these functions allow an initial value that disappears when clicked.	

/*

function resetFields(whichform) {
  for (var i=0; i<whichform.elements.length; i++) {
    var element = whichform.elements[i];
    if (element.type == "submit") continue;
    if (!element.defaultValue) continue;
    element.onfocus = function() {
    if (this.value == this.defaultValue) {
      this.value = "";
     }
    }
    element.onblur = function() {
      if (this.value == "") {
        this.value = this.defaultValue;
      }
    }
  }
}

function prepareForms() {
  for (var i=0; i<document.forms.length; i++) {
    var thisform = document.forms[i];
    resetFields(thisform);
    thisform.onsubmit = function() {
      return validateForm(this);
    }
  }
}

*/

// END FORMS: initial values
//************************************************************
	

//************************************************************
// load the functions	
addLoadEvent(openNewWindow);
addLoadEvent(prepareForms);
//addLoadEvent(startList);