// this is used to toggle a specific div's status
function div_toggle (thisdiv) {
	var the_div = document.getElementById( thisdiv );
	if (the_div.style.display == 'block') {
		the_div.style.display='none'; }
	else { the_div.style.display='block';}
	}

// This function takes a single div name and an array of known div names and 
// changes the display to "none" and then the single given div to "block"
function make_option_active (thisdiv) {	
	
	// a list of div names. Please make sure these are the exact div names
	// you can add or subtract names of divs from this array, provided you 
	// maintain the array list.

	// EDIT THIS LINE 
	var thedivnames = new Array( "simplesearch","geosearch","simpleadvanced","minisimplesearch","minigeosearch" );
	
	// -- NO NEED TO EDIT BELOW HERE -- // 
	// -------------------------------- //

	// first we turn everything back to normal state, then we make the current div and its elements active
	// build array of elements

	for (var i = 0; i < thedivnames.length; i++) {			
		document.getElementById(thedivnames[i]).style.display='none';
	}

	// make clicked option visible 			
	document.getElementById(thisdiv).style.display='block';

	// apply correct focus
	document.getElementById("input_" + thisdiv).focus();
}

function mini_make_option_active (thisdiv) {	
	
	// a list of div names. Please make sure these are the exact div names
	// you can add or subtract names of divs from this array, provided you 
	// maintain the array list.

	// EDIT THIS LINE 
	var thedivnames = new Array( "minisimplesearch","minigeosearch" );
	
	// -- NO NEED TO EDIT BELOW HERE -- // 
	// -------------------------------- //

	// first we turn everything back to normal state, then we make the current div and its elements active
	// build array of elements

	for (var i = 0; i < thedivnames.length; i++) {			
		document.getElementById(thedivnames[i]).style.display='none';
	}

	// make clicked option visible 			
	document.getElementById(thisdiv).style.display='block';

	// apply correct focus
	document.getElementById("input_" + thisdiv).focus();
}
