
var ids = new Array("simplewindow", "Advancedwindow", "browsewindow");
function switchid(id) {
	hideallids();
	showdiv(id);
}
function hideallids() {
	//loop through the array and hide each element by id
	for (var i = 0; i < ids.length; i++) {
		hidediv(ids[i]);
	}
}
function hidediv(id) {
	//safe function to hide an element with a specified id
	//document.getElementById(ids[2]).style.display = 'none';	
	if (document.getElementById) {
		document.getElementById(id).style.display = "none";
	} else {
		if (document.layers) {
			document.id.display = "none";
		} else {
			document.all.id.style.display = "none";
		}
	}
}
function showdiv(id) {
     
	//safe function to show an element with a specified id
	if (document.getElementById) {
		document.getElementById(id).style.display = "block";
		if ((id == "Advancedwindow") && (bw.saf)) {		
			//alert(bw.saf);
			loadGoogleMap();
			placeList = document.getElementById("placeList").value;
			if (placeList != "Select from the list") {
				spatialBounding(placeList);
			}
		} else {
			map.checkResize();
		}
	} else {
		if (document.layers) {
			document.id.display = "block";
		}
	}
}

