var addObj = new Object(); addObj.id = 0; addObj.name = ""; var defaultSelect = new Object(); defaultSelect.selected = ""; showPreviousPage = function() { var startRow = parseInt( document.getElementById('start-row').value ); var rowsPerPage = parseInt( document.getElementById('rows-per-page').value ); var newStartRow = startRow - rowsPerPage; if( newStartRow >= 0 ) { document.getElementById('start-row').value = newStartRow; grabSearchResults( true ); location.href='#contentMiddle'; } } showNextPage = function() { var startRow = parseInt( document.getElementById('start-row').value ); var rowsPerPage = parseInt( document.getElementById('rows-per-page').value ); var newStartRow = startRow + rowsPerPage; if( newStartRow >= 0 ) { document.getElementById('start-row').value = newStartRow; grabSearchResults( true ); location.href='#contentMiddle'; } } grabSearchResults = function( useSession ) { var cityName = document.getElementById('city').value; if( cityName == 'CITY OR TOWN' ) cityName = ''; var strSession = "&session=" if( useSession ) strSession += "true"; else { strSession = ""; document.getElementById('start-row').value = 0; } var strStartRow = "?startRow=" + document.getElementById('start-row').value; var strRowsPerPage = "&rowsPerPage=" + document.getElementById('rows-per-page').value; var strName = "&name=" + encodeURIComponent( document.getElementById('name').value ); var strRegion = "®ion=" + encodeURIComponent( document.getElementById('region').value ); var strCity = "&city=" + encodeURIComponent(cityName); var strCode = "&code=" + Math.random() + Math.random(); var strQSV = strStartRow + strRowsPerPage + strSession + strName + strRegion + strCity; document.getElementById('querystringValues').value = strQSV; url = "/library/code/get-state-parks-regions.aspx" + strQSV + strCode; http = getHTTPObject(); http.onreadystatechange = processSearchResults; http.open("GET", url, true); http.setRequestHeader("Cache-Control", "no-cache"); http.send(null); } grabLoadSearchResults = function() { var strQSV = document.getElementById('querystringValues').value; if( strQSV != '' ) { var strSession = ""; if( strQSV.indexOf('&session=') == -1 ) strSession = "&session=true"; var strCode = "&code=" + Math.random() + Math.random(); url = "/library/code/get-state-parks-regions.aspx" + strQSV + strSession + strCode; http = getHTTPObject(); http.onreadystatechange = processSearchResults; http.open("GET", url, true); http.setRequestHeader("Cache-Control", "no-cache"); http.send(null); } } function alphabetize() { if( document.getElementById('querystringValues').value != '' ) { document.getElementById('start-row').value = 0; document.getElementById('querystringValues').value += "&alpha=true"; grabLoadSearchResults(); } } grabNames = function() { var strCode = "code=" + Math.random() + Math.random(); url = "/library/code/get-state-parks-dropdown.aspx?" +strCode; http = getHTTPObject(); http.onreadystatechange = processType; http.open("GET", url, true); http.setRequestHeader("Cache-Control", "no-cache"); http.send(null); } processType = function() { var typeDisplay = document.getElementById('typeSelect'); if (http.readyState == 4) { if (http.status == 200) typeDisplay.innerHTML = http.responseText; else typeDisplay.innerHTML = "Could not load type display!!"; setDefaultSelectedAndSearch(); } } processSearchResults = function() { var attractionsDisplay = document.getElementById('attractions-display'); if (http.readyState == 4) { if (http.status == 200) attractionsDisplay.innerHTML = http.responseText; else attractionsDisplay.innerHTML = "Could not load search results!!"; } } getHTTPObject = function() { if (typeof XMLHttpRequest != 'undefined') { return new XMLHttpRequest(); } try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } return false; } function Popup(url,windowname,w,h,x,y) { window.open(url,windowname,"resizable=yes,toolbar=no,scrollbars=yes,menubar=no,status=no,directories=no,width="+w+",height="+h+",left="+x+",top="+y+""); } function setDefaultSelected() { if( defaultSelect ) { var nameSelect = document.getElementById('name'); for (i=0; i