/* function finds all divs in the search tool table and sets their display to none*/
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;
}
function hideAllDivs(){ 
	var arrayOfDivs = getElementsByClass("hidden");
	for (var i=0; i<arrayOfDivs.length; i++) {
		arrayOfDivs[i].style.display="none"; 
	}
}

/* function finds all divs in the search tool table and sets them to show*/
function showAllDivs(){ 
	var arrayOfDivs = getElementsByClass("hidden");
	for (var i=0; i<arrayOfDivs.length; i++) {
		arrayOfDivs[i].style.display="block"; 
	}
}

/* function hides or shows the div name given to it and hides all other divs*/
function showhide(id) {
	hideAllDivs();
	 if (document.getElementById){ 
		 obj = document.getElementById(id); 
		 if (obj.style.display == "none"){ 
			 obj.style.display = "block"; 
		 } else { 
			 obj.style.display = "none"; 
		 } 
	 } 
}
/* shows the div passed to it */
function show(id) {
	 if (document.getElementById){ 
		 obj = document.getElementById(id); 
		 obj.style.display = "block"; 
	 } 
}
/* hides the div passed to it */
function hide(id) {
	 if (document.getElementById){ 
		 obj = document.getElementById(id); 
		obj.style.display = "none"; 
	 } 
}
