	function switchSearch(type) {

		// define contents
		var link1 = document.getElementById('searchLink1');
		var link2 = document.getElementById('searchLink2');
		var option = document.getElementById('searchType');

		// check argument and switch link class
		if(type == 'commercial') {
			link1.className = 'inactive';
			link2.className = 'active2';
		} else {
			link1.className = 'active1';
			link2.className = 'inactive';
		}

		// set option input
		option.value = type;

	}

	function swapImage(node, url, button) {

		// change image source
		document.getElementById(node).src = url;

		// change button url
		document.getElementById('zoom_button_link').href = button;
	}

        	function collapse(target) {

		if(target.className == 'collapsed') {
			target.className = 'expanded';
		} else {
			target.className = 'collapsed';
		}
	}

	function next(elem) {
		do {
			elem = elem.nextSibling;
		} while (elem && elem.nodeType != 1);
		return elem;
	}


	function expandAll() {

		var allHTMLTags = new Array();

		//Create Array of All HTML Tags
		var allHTMLTags=document.getElementsByTagName("div");

			//Loop through all tags using a for loop
			for (i=0; i<allHTMLTags.length; i++) {

			//Get all tags with the specified class name.
			if (allHTMLTags[i].className == 'collapsed') {

			//Place any code you want to apply to all
			//pages with the class specified.
			//In this example is to “display:none;” them
			//Making them all dissapear on the page.

			allHTMLTags[i].className = 'expanded';

			}
			}
	}

	function collapseAll() {

		var allHTMLTags = new Array();

		//Create Array of All HTML Tags
		var allHTMLTags=document.getElementsByTagName("div");

			//Loop through all tags using a for loop
			for (i=0; i<allHTMLTags.length; i++) {

			//Get all tags with the specified class name.
			if (allHTMLTags[i].className == 'expanded') {

			//Place any code you want to apply to all
			//pages with the class specified.
			//In this example is to “display:none;” them
			//Making them all dissapear on the page.

			allHTMLTags[i].className = 'collapsed';

			}
			}
	}