var ids = new Array("simplewindow", "advancedwindow"); function switchid(id) { hideallids(id); showdiv(id); } function hideallids(id) { //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 == "simplewindow"){ document.getElementById("submit").style.display = "none"; } else{ document.getElementById("submit").style.display = "block"; } if ((id == "advancedwindow") && (bw.saf)) { loadGoogleMap(); placeList = document.getElementById("placeList").value; if (placeList != "Select from the list") { spatialBounding(placeList); } } else { map.checkResize(); map.setCenter(new GLatLng(35.0,-14),-1); } } else { if (document.layers) { document.id.display = "block"; } } }