// JavaScript Document



function pop(url) {

	newwindow=window.open(url,'name','height=700,width=775');

	if (window.focus) {newwindow.focus()}

	return false;

}

function popitup(url,pHeight,pWidth) {
	var sets = 'height=' + pHeight + ',width=' + pWidth;
	newwindow=window.open(url,'name',sets);
	if (window.focus) {newwindow.focus()}
	return false;
}


function submitform() {

	searchform.submit();

}



// fixes IE Win to allow hover on other tags

startList = function() {  

	if (document.all&&document.getElementById) {

	navRoot = document.getElementById("topNavList");

	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", "");

		 }

		 }

		}

	 }

}





function alternateRowColors() {

	var classNameOne = 'table1';

	var classNameTwo = 'table2';

	var classNameThree = 'table3';

	var classNameFour = 'table4';

	var rowcolor = '#e4eed0';

	var rows, arow;

	var tables = document.getElementsByTagName("table");

	var rowCount = 2;

	

	for(var k=0; k<tables.length; k++) {

		//dump(tables.item(i).className + " " + tables.item(i).nodeName + "\n");

		if(tables.item(k).className == classNameOne) {

			atable = tables.item(k);

			rows = atable.getElementsByTagName("tr");

			for(var j=0;j<rows.length;j++) {

				arow = rows.item(j);

				if(arow.nodeName == "TR") {

					if(rowCount % 2) {

						arow.style.backgroundColor = rowcolor;

					} else {

						// default case

					}

					rowCount++;

				}

			}

			rowCount = 0;

		}

		

	  var rowCount = 2;

		if(tables.item(k).className == classNameTwo) {

			atable = tables.item(k);

			rows = atable.getElementsByTagName("tr");

			for(var jj=0;jj<rows.length;jj++) {

				arow = rows.item(jj);

				if(arow.nodeName == "TR") {

					if(rowCount % 2) {

						arow.style.backgroundColor = rowcolor;

					} else {

						// default case

					}

					rowCount++;

				}

			}

			rowCount = 0;

		} 

		

	  var rowCount = 2;

		if(tables.item(k).className == classNameThree) {

			atable = tables.item(k);

			rows = atable.getElementsByTagName("tr");

			for(var jj=0;jj<rows.length;jj++) {

				arow = rows.item(jj);

				if(arow.nodeName == "TR") {

					if(rowCount % 2) {

						arow.style.backgroundColor = rowcolor;

					} else {

						// default case

					}

					rowCount++;

				}

			}

			rowCount = 0;

		} 

		

	  var rowCount = 2;

		if(tables.item(k).className == classNameFour) {

			atable = tables.item(k);

			rows = atable.getElementsByTagName("tr");

			for(var jj=0;jj<rows.length;jj++) {

				arow = rows.item(jj);

				if(arow.nodeName == "TR") {

					if(rowCount % 2) {

						arow.style.backgroundColor = rowcolor;

					} else {

						// default case

					}

					rowCount++;

				}

			}

			rowCount = 0;

		} 

		

	} //end main For Loop

	

}







//// match css column heights:

function fixColumnHeights()

{

		var heightContent = 0;

		var leftHeight = 0;

		var rightHeight = 0;



		leftHeight = document.getElementById('leftColumn').offsetHeight;				// Get initial height of left column

		rightHeight = document.getElementById('contentColumn').offsetHeight;			// Get initial height of right column

				

		// Get tallest column height by checking left and right column		

		if ((rightHeight) > (leftHeight)) {

			heightContent = document.getElementById('contentColumn').offsetHeight;	// Set new height to tallest column

		} else {

			heightContent = document.getElementById('leftColumn').offsetHeight;		// Set new height to tallest column

		}

		

		// IE or not IE?

		if (navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0) // if IE then:

		{

				document.getElementById('leftColumn').style.setAttribute('height', heightContent + 'px');		// set the new height

				document.getElementById('contentColumn').style.setAttribute('height', heightContent + 'px');	// set the new height

		}

		else // if not IE then:

		{

				document.getElementById('leftColumn').style.setProperty('height', heightContent + 'px', null); // set the new height

				document.getElementById('contentColumn').style.setProperty('height', heightContent + 'px', null); // set the new height

		}

}





function pageTitle() {

	document.write (document.title);

}



function init() {

	startList();

	alternateRowColors();

	// fixColumnHeights();

	

	var popups = document.getElementsByTagName('a');

	for (var detc=0; detc < popups.length; detc++) {

		if (popups[detc].getAttribute('rel') == 'popup') {

			popups[detc].onclick = function () {

				return pop(this.href)

		}

		}

	}

}



window.onload=init;

