<!--

////////////////
// image preload
////////////////
function preloadimages() {

	if (document.images)
	{
	
		//home_button_on = new Image();
		//home_button_on.src = "images/buttons/home_on.jpg";

	}

}


/////////////
// image swap
/////////////
function buttonChanger(from, to) {
	if(document.images) {
		document.images[from].src = "images/buttons/" + from + "_" + to + ".jpg";
	}
}


// Function to 'activate' the image.
function imgOn(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "_on.src");
        }
}

// Function to 'deactivate' the image.
function imgOff(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "_off.src");
        }
}


function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\\\s)"+searchClass+"(\\\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}


// highlight alternate rows
function updateRowHighlights() {
	
	arrTRs = getElementsByClass('tr_item');

	for(intIndex = 0; intIndex < arrTRs.length; intIndex++) {
		if (intIndex % 2 == 1){
      arrTRs[intIndex].style.backgroundColor = "#efefef";

    } else {
    	arrTRs[intIndex].style.backgroundColor = "#ffffff";

    }

	}
}
