// JavaScript Document

window.onload = {
	}


function addLoadEvent(func) {
	
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;		
	} else {
		window.onload = function () {
			oldonload();
			func;
		}
	}
}


//================================================================================
//Add a class value to any element...if there is already a class assigned, add a space and the new class to the string
function addClass(element, value) { 
	if (!element.className) { 
		element.className = value;
	} else { 
		newClassName = element.className;
		newClassName += " ";
		newClassName += value;
		element.className = newClassName;
	}
}
//================================================================================
//Shade alternate rows of every table on a page
function stripeTables() {
	if (!document.getElementsByClassName) return false;
	var tables = document.getElementsByClassName("stripeMe");
	
	for (i=0; i<tables.length; i++) { 
		var odd = true;
		var rows = tables[i].getElementsByTagName("tr");
		for (var j=0; j<rows.length; j++) { 
			if (odd==true) { 
				addClass(rows[j],"trAlt1");
				odd=false;
			} else { 
				odd = true;
			}		
		}
	}
}
addLoadEvent(stripeTables);
//================================================================================
//Provide protected email link
function emailLink (em, dom, ext,whatToSay) { 
var name = em;
var atsign = "@";
var virtual_domain = dom;
var dotcom = ext;
document.write("<a href=mailto:"+ name + atsign +
virtual_domain + "." + dotcom+ ">" + whatToSay + "</a>");
}

//================================================================================
