
function getSelectedValues (select) {
var r = new Array();
for (var i = 0; i < select.options.length; i++)
if (select.options[i].selected)
  r[r.length] = select.options[i].value;
return r;
}

function getSelectedTexts (select) {
var r = new Array();
for (var i = 0; i < select.options.length; i++)
if (select.options[i].selected)
  r[r.length] = select.options[i].text;
return r;
}

function CharacterCount(field,remaining) {
// This variable (MaxCharacters) sets the maximum characters allowed
var MaxCharacters = 250;
	if (field.value.length > MaxCharacters)
	{
	field.value = field.value.substring(0, MaxCharacters);
	}
	else
	{
	// This will update remaining characters to be allowed
	remaining.value = MaxCharacters - field.value.length;
	}
}

function showhide(layer_ref,sub) {

var flag = 0;

	if (document.all) //IS IE 4 or 5 (or 6 beta)
	{
		if (eval( "document.all." + layer_ref + ".style.display == 'block'"))
		{
		eval( "document.all." + layer_ref + ".style.display = 'none'");
		flag = 0;
		}
		else
		{
		eval( "document.all." + layer_ref + ".style.display = 'block'");
		flag = 1;
		}
	}

	if (document.layers) //IS NETSCAPE 4 or below
	{
		if (document.layers[layer_ref].display == "block")
		{
		document.layers[layer_ref].display = "none";
		flag = 0;
		}
		else
		{
		document.layers[layer_ref].display = "block";
		flag = 1;
		}
	}

	if (document.getElementById &&!document.all) 
	{
	hza = document.getElementById(layer_ref);
		if (hza.style.display == "block")
		{
		hza.style.display = "none";
		flag = 0;
		}
		else
		{
		hza.style.display = "block";
		flag = 1;
		}
	}

	if (sub)
	{
	var a = document.getElementById(sub);		
		if(flag == 0)
		a.innerHTML = '<img src="/design/images/site/arrow_down.gif" class="nav_arrow" alt="show sub-pages" title="show sub-pages" />';
		else
		a.innerHTML = '<img src="/design/images/site/arrow_up.gif" class="nav_arrow" alt="hide sub-pages" title="hide sub-pages" />';
	}

}

function popup(num) {
window.open('/new/popup/' + num + '/','popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizeable=yes,copyhistory=no,width=400,height=280')
}

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;



