var addObj = new Object(); addObj.id = 0; addObj.name = ""; var defaultSelect = new Object(); defaultSelect.selected = "State Parks"; function addToMyPlanner( addID, addName, addType ) { addObj.id = addID; addObj.name = addName; var strId = "?id=" + addID; var strType = "&type=" + addType; var strCode = "&code=" + parseInt( 1000 * Math.random() ) + parseInt( 1000 * Math.random() ); url = "/library/code/add-to-my-planner.aspx" + strId + strType + strCode; http = getHTTPObject(); http.onreadystatechange = processAddToMyPlanner; http.open("GET", url, true); http.setRequestHeader("Cache-Control", "no-cache"); http.send(null); } processAddToMyPlanner = function() { if (http.readyState == 4) { if( http.status == 200 ) { var trueResponse = http.responseText.replace("\n",""); if( trueResponse == "OK" ) { if( window.opener ) window.opener.document.location.reload(true); alert( 'Added ' + addObj.name + ' to My Planner!!!'); } else alert( 'Error: Could not add ' + addObj.name + ' to My Planner!!!'); } else alert( 'Error: Could not add ' + addObj.name + ' to My Planner!!!'); } } 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 strType = "&type=" + encodeURIComponent( document.getElementById('type').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 + strType + strRegion + strCity; document.getElementById('querystringValues').value = strQSV; url = "/library/code/get-attractions.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-attractions.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(); } } grabTypes = function() { var strCode = "code=" + Math.random() + Math.random(); url = "/library/code/get-attractions-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 typeSelect = document.getElementById('type'); for (i=0; i