<!--
// reywire js base . info@reywire.com
//
function rollOn(imgName) {
      document [imgName].src = eval(imgName+"_on.src");
}

function rollOff(imgName) {
      document [imgName].src = eval(imgName+"_off.src");
}

// the prototype cash money
function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string') { element = document.getElementById(element); }
		if (arguments.length == 1) { return element; }
		elements.push(element);
	}
	return elements;
}

// returns array of elements of class 'searchClass' within 'node' and of type 'tag'
function getElementsByClass(searchClass,node,tag) {

	// init the array and set defaults
	var classElements = new Array();
	if (node == null) { node = document; }
	if (tag == null) { tag = '*'; }
	
	// traverse node for tags and test matches for 'searchClass'
	var pattern  = new RegExp("(^|\\s)" + searchClass + "(\\s|$)");
	var elements = node.getElementsByTagName(tag);
	var i; var j;
	for (i = 0, j = 0; i < elements.length; i++) {
		if (pattern.test(elements[i].className)) {
			classElements[j] = elements[i];
			j++;
		}
	}
	if (classElements.length > 0) { return classElements; }
	else { return false; }
}

// spawn a nice popup info pane
var win = null;
function popWin(loc,w,h) {
  win = window.open('','WIN','width=' + w + ',height=' + h + ',scrollbars,location=no,menubar=no,toolbar=no');
  if (win != null) {
    if (win.opener == null) {
      win.opener = self;
    }
    win.location.href = loc;
  }
}

// fp custom second-level nav
function loadSecondary(id) {
	$("parent").style.display = 'none';

	var subDivs = getElementsByClass('content', null, "div");
	var subLinks = getElementsByClass('subNavBold', null, "a");
	var i;
	for (i = 0; i < subLinks.length; i++) {
		subLinks[i].className = 'subNav';
	}
	for (i = 0; i < subDivs.length; i++) {
		if (subDivs[i].id != ('sub_' + id)) { subDivs[i].style.display = 'none'; }
		else { $("subnav_" + id).className = 'subNavBold'; subDivs[i].style.display = 'block'; $("subnav_" + id).blur(); }
	}
}
//-->