
function getElementsByClassName(node, classname)
	{
		var a = [];
		var re = new RegExp('\\b' + classname + '\\b');
		var els = node.getElementsByTagName("*");
		for(var i=0,j=els.length; i<j; i++)
			if(re.test(els[i].className))a.push(els[i]);
		return a;
	}


// Used for alternating/highlighting tables  
// when the page loads it sees how each table is tagged and then gives
// it the appropriate highlighting/alternating colors...
// for example: 
// 			table class='tableLines' id='tableShade' = alternating tr colors
//			table class='tableLines' id='tableHighlight' = mouseover highlighting of trs
//			table class='tableLines' id='' = no tr colors, no highlighting
//			table class='tableAllLines' id='tableShade' = alternating tr colors
//			table class='tableAllLines' id='tableHighlight' = mouseover highlighting of trs
function alternate()
{
		// ALL TABLES W/ CLASS tableLines ----------------------
		tables = getElementsByClassName(document, 'tableLines');
		for(i = 0; i<tables.length; i++)
		{
		// sets array of all trs within tables with className tableLines
		trs = tables[i].getElementsByTagName('tr');
			// CLASS = tableLines ---- ID = 'tableShade'
			if(tables[i].id == 'tableShade')
			{
				for(k = 0; k < trs.length; k++)
				{
					if(k != 0) {
						if((k%2) == 0)
						{
							trs[k].className = "even";
						} 
						else 
						{
							trs[k].className = "odd";
						}
					}
				}
			} 
			// CLASS = tableLines ---- ID = 'tableHighlight'
			else if(tables[i].id == 'tableHighlight')
			{
				for(k = 0; k < trs.length; k++)
				{
					if(k != 0) {
						trs[k].onmouseover = function()
						{
							this.className = "even";
						}
						trs[k].onmouseout = function()
						{
							this.className = "odd";
						}
					}
				}
			}
		}
		
		// ALL TABLES W/ CLASS tableAllLines ----------------------
		tableAlls = getElementsByClassName(document, 'tableAllLines');
		for(l = 0; l<tableAlls.length; l++)
		{
			// sets array of all trs within tables with className = 'tableAllLines'
			trsAll = tableAlls[l].getElementsByTagName('tr');
			// CLASS = tableAllLines ---- ID = 'tableShade'
			if(tableAlls[l].id == 'tableShade')
			{
				for(m = 0; m < trsAll.length; m++)
				{
					if(m != 0) {
						if((m%2) == 0)
						{
							trsAll[m].className = "even";
						} 
						else 
						{
							trsAll[m].className = "odd";
						}
					}
				}
			}
			// CLASS = tableAllLines ---- ID = 'tableHighlight'
			else if(tableAlls[l].id == 'tableHighlight')
			{
				for(m = 0; m < trsAll.length; m++)
				{
					if(m != 0) {
						trsAll[m].onmouseover = function()
						{
							this.className = "even";
						}
						trsAll[m].onmouseout = function()
						{
							this.className = "odd";
						}
					}
				}
			}
		}
}	

	
//<iframe style="visibility: hidden" height="1" width="1" src="[~~ESTUDIO_SERVICE~~]serviceName=search&contentID=0" application="yes"></iframe>	
	
	
	
	<!--//--><![CDATA[//><!--
LINEHEIGHT = 21;
IFRAMEWIDTH = 110 + 'px';

sfHover = function() {
	if(document.getElementById("nav")) {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
			if(this.parentNode.id == 'nav') 
			{
				numLIs = this.getElementsByTagName('li').length;
				this.getElementsByTagName('iframe')[0].style.height = (LINEHEIGHT * numLIs + 1) + 'px';//- ((numLIs * 2) - 4) + 'px';
				this.getElementsByTagName('iframe')[0].style.width = IFRAMEWIDTH;
				this.getElementsByTagName('iframe')[0].style.display = 'block';
			}
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			
			if(this.parentNode.id == 'nav') {
				this.getElementsByTagName('iframe')[0].style.display = 'none';
			}
		}
	}}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]>
	
	
// Toggles Font-Size and Line-Height on content pages.
	function changeLabel(toggle){
		if(document.getElementById("puText")){
			// Number of <li> tags in the document, as well as an array containing references
			var LI_length = document.getElementById("columnWide").getElementsByTagName("li").length;
			var LI_arr = document.getElementById("columnWide").getElementsByTagName("li");
			
			// Number of <p> tags in the document, with an array of references
			var P_length = document.getElementById("columnWide").getElementsByTagName("p").length;
			var P_arr = document.getElementById("columnWide").getElementsByTagName("p");
			
			// Toggles the Text Size Icon and resizes text
			if(toggle == 'large'){
				document.getElementById("puText").className = "iconTextEnlarge";
				document.getElementById("puText").innerHTML = "smaller type";
				document.getElementById("puText").href = "javascript:changeLabel('small');";
				document.getElementById("columnWide").style.fontSize = "120%"; // "110%" MODIFIED
				// Change all <li>s lineHeight to greater percentage
					for(k = 0; k < LI_length; k++){ 
						LI_arr[k].style.lineHeight = "150%" 
					}
				// Change all <p>s lineHeight to greater percentage
					for(j = 0; j < P_length; j++){ 
						P_arr[j].style.lineHeight = "150%" 
					}
				createCookie('textSize', 'large');
				} 
			else {
				document.getElementById("puText").className = "iconTextEnlarge";
				document.getElementById("puText").innerHTML = "larger type";
				document.getElementById("puText").href = "javascript:changeLabel('large');";
				document.getElementById("columnWide").style.fontSize = "";
				// Change all <li>s back to default lineHeight
					for(k = 0; k < LI_length; k++){ 
						LI_arr[k].style.lineHeight = ""; 
					}
				// Change all <p>s back to default lineHeight
					for(j = 0; j < P_length; j++){ 
						P_arr[j].style.lineHeight = ""; 
					}
					createCookie('textSize', 'small');
				}
		}
	}
// Used to set a cookie with the user's font-size preference
function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
	//alert('Cookie\n' + name + '\ncreated with a value ' + value);
}

// Returns the cookie value
function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

// Used onLoad to set document text size
function userTextSize(){
	size = readCookie('textSize'); 
	changeLabel(size);
}


/* resize margin-bottom for main */

var orig_margin = 10;
var body_height;
function checkHeight(layout)
{
	body_height = document.body.clientHeight;
	changeHeight(layout);
}

function changeHeight(layout)
{
	browser_height = document.documentElement.clientHeight;
	diff = browser_height - body_height;
	
	el = document.getElementById("home");
	

	switch (layout) {
		case 1:
			if (diff > 0) {
				new_margin = orig_margin + diff;
			}
			else {
				new_margin = 10;
			}
			el.style.margin = "0  auto " + new_margin + "px auto";
			break;
		case 2:
			if (diff > 0) {
				new_margin = 10 + diff;
				el.style.padding = "0  0 " + new_margin + "px 0";
			}
			else {
				el.style.padding = "0 0 10px 0";
			}
			break
			
		case 3:
			if (diff > 0) {
				el.style.padding = "0  0 " + diff + "px 0";
			}
			else {
				el.style.padding = "0 0 0 0";
			}
	}
	
	window.onresize = function (evt) {
	changeHeight(3);
	};
	
} 

	function getElementsByClassName(node, classname)
	{
		var a = [];
		var re = new RegExp('\\b' + classname + '\\b');
		var els = node.getElementsByTagName("*");
		for(var i=0,j=els.length; i<j; i++)
			if(re.test(els[i].className))a.push(els[i]);
		return a;
	}


