Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Format of URL Detected #1360

Open
amiremami opened this issue May 7, 2024 · 5 comments
Open

Wrong Format of URL Detected #1360

amiremami opened this issue May 7, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@amiremami
Copy link
Contributor

amiremami commented May 7, 2024

Wrong format of URL passed through BBOT

{"type": "HTTP_RESPONSE", "id": "HTTP_RESPONSE:88ca3b576a4a1bdf6a40dab338da8cdb6560ee26", "data": {"url": "https://irmaservices.nps.gov/arcgis/rest/%E2%80%9Dhttps:/www.nps.gov/lib/bootstrap/3.3.2/css/nps-bootstrap.min.css%22", "timestamp": "2024-05-02T10:35:08.93813259+02:00", "hash": {"body_md5": "e1677cf96ac48a1f1769b2ee96ef8bfc", "body_mmh3": "-1927533020", "body_sha256": "e46ba0db6b1c6896d645913e16bfdc3922b77c8596b9c1020232a4ef81216fb6", "body_simhash": "590606101044242396", "header_md5": "499c1a0beb2f2ad093d9384e1a823e41", "header_mmh3": "-336750885", "header_sha256": "5f78836cfbecefcdf3fd3d02caa5679793f200f4918129cba1ceede42b5affcd", "header_simhash": "11021052781802536815"}, "port": "443", "input": "https://irmaservices.nps.gov:443/arcgis/rest/%E2%80%9Dhttps:/www.nps.gov/lib/bootstrap/3.3.2/css/nps-bootstrap.min.css%22", "title": "Runtime Error", "scheme": "https", "webserver": "Microsoft-IIS/10.0", "body": "<!DOCTYPE html>\r\n<html>\r\n    <head>\r\n        <title>Runtime Error</title>\r\n        <meta name=\"viewport\" content=\"width=device-width\" />\r\n        <style>\r\n         body {font-family:\"Verdana\";font-weight:normal;font-size: .7em;color:black;} \r\n         p {font-family:\"Verdana\";font-weight:normal;color:black;margin-top: -5px}\r\n         b {font-family:\"Verdana\";font-weight:bold;color:black;margin-top: -5px}\r\n         H1 { font-family:\"Verdana\";font-weight:normal;font-size:18pt;color:red }\r\n         H2 { font-family:\"Verdana\";font-weight:normal;font-size:14pt;color:maroon }\r\n         pre {font-family:\"Consolas\",\"Lucida Console\",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}\r\n         .marker {font-weight: bold; color: black;text-decoration: none;}\r\n         .version {color: gray;}\r\n         .error {margin-bottom: 10px;}\r\n         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:pointer; }\r\n         @media screen and (max-width: 639px) {\r\n          pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }\r\n         }\r\n         @media screen and (max-width: 479px) {\r\n          pre { width: 280px; }\r\n         }\r\n        </style>\r\n    </head>\r\n\r\n    <body bgcolor=\"white\">\r\n\r\n            <span><H1>Server Error in '/arcgis' Application.<hr width=100% size=1 color=silver></H1>\r\n\r\n            <h2> <i>Runtime Error</i> </h2></span>\r\n\r\n            <font face=\"Arial, Helvetica, Geneva, SunSans-Regular, sans-serif \">\r\n\r\n            <b> Description: </b>An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.\r\n            <br><br>\r\n\r\n            <b>Details:</b> To enable the details of this specific error message to be viewable on remote machines, please create a &lt;customErrors&gt; tag within a &quot;web.config&quot; configuration file located in the root directory of the current web application. This &lt;customErrors&gt; tag should then have its &quot;mode&quot; attribute set to &quot;Off&quot;.<br><br>\r\n\r\n            <table width=100% bgcolor=\"#ffffcc\">\r\n               <tr>\r\n                  <td>\r\n                      <code><pre>\r\n\r\n&lt;!-- Web.Config Configuration File --&gt;\r\n\r\n&lt;configuration&gt;\r\n    &lt;system.web&gt;\r\n        &lt;customErrors mode=&quot;Off&quot;/&gt;\r\n    &lt;/system.web&gt;\r\n&lt;/configuration&gt;</pre>                      </code>\r\n\r\n                  </td>\r\n               </tr>\r\n            </table>\r\n\r\n            <br>\r\n\r\n            <b>Notes:</b> The current error page you are seeing can be replaced by a custom error page by modifying the &quot;defaultRedirect&quot; attribute of the application&#39;s &lt;customErrors&gt; configuration tag to point to a custom error page URL.<br><br>\r\n\r\n            <table width=100% bgcolor=\"#ffffcc\">\r\n               <tr>\r\n                  <td>\r\n                      <code><pre>\r\n\r\n&lt;!-- Web.Config Configuration File --&gt;\r\n\r\n&lt;configuration&gt;\r\n    &lt;system.web&gt;\r\n        &lt;customErrors mode=&quot;RemoteOnly&quot; defaultRedirect=&quot;mycustompage.htm&quot;/&gt;\r\n    &lt;/system.web&gt;\r\n&lt;/configuration&gt;</pre>                      </code>\r\n\r\n                  </td>\r\n               </tr>\r\n            </table>\r\n\r\n            <br>\r\n\r\n            </font>\r\n\r\n    </body>\r\n</html>\r\n", "content_type": "text/html", "method": "GET", "host": "52.149.222.62", "path": "/arcgis/rest/%E2%80%9Dhttps:/www.nps.gov/lib/bootstrap/3.3.2/css/nps-bootstrap.min.css%22", "header": {"cache_control": "private", "content_length": "3496", "content_type": "text/html; charset=utf-8", "date": "Thu, 02 May 2024 08:35:08 GMT", "frame_ancestors": "*.nps.gov", "server": "Microsoft-IIS/10.0", "strict_transport_security": "max-age=31536000; includeSubDomains", "x_aspnet_version": "4.0.30319", "x_frame_options": "SAMEORIGIN"}, "raw_header": "HTTP/1.1 400 Bad Request\r\nConnection: close\r\nContent-Length: 3496\r\nCache-Control: private\r\nContent-Type: text/html; charset=utf-8\r\nDate: Thu, 02 May 2024 08:35:08 GMT\r\nFrame-Ancestors: *.nps.gov\r\nServer: Microsoft-IIS/10.0\r\nStrict-Transport-Security: max-age=31536000; includeSubDomains\r\nX-Aspnet-Version: 4.0.30319\r\nX-Frame-Options: SAMEORIGIN\r\n\r\n", "request": "GET /arcgis/rest/%E2%80%9Dhttps:/www.nps.gov/lib/bootstrap/3.3.2/css/nps-bootstrap.min.css%22 HTTP/1.1\r\nHost: irmaservices.nps.gov\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.2151.97\r\nAccept-Charset: utf-8\r\nAccept-Encoding: gzip\r\n\r\n", "time": "257.013057ms", "a": ["52.149.222.62"], "words": 830, "lines": 83, "status_code": 400, "content_length": 3496, "failed": false, "header-dict": {"connection": "close", "content-length": "3496", "cache-control": "private", "content-type": "text/html; charset=utf-8", "date": "Thu, 02 May 2024 08:35:08 GMT", "frame-ancestors": "*.nps.gov", "server": "Microsoft-IIS/10.0", "strict-transport-security": "max-age=31536000; includeSubDomains", "x-aspnet-version": "4.0.30319", "x-frame-options": "SAMEORIGIN"}}, "web_spider_distance": 2, "scope_distance": 0, "scan": "SCAN:ece9675afde8fc294d4fca36ad4eebe827311aa6", "timestamp": 1714631709.641479, "resolved_hosts": ["52.149.222.62"], "source": "URL:2a4d087d53b69dd69cfb762dd9359d83e5483abc", "tags": ["extension-css-22", "ip-52-149-222-62", "status-400", "endpoint", "in-scope", "cloud-azure", "http-title-runtime-error"], "module": "httpx", "module_sequence": "httpx"}

{"type": "URL", "id": "URL:2a4d087d53b69dd69cfb762dd9359d83e5483abc", "data": "https://irmaservices.nps.gov/arcgis/rest/%E2%80%9Dhttps:/www.nps.gov/lib/bootstrap/3.3.2/css/nps-bootstrap.min.css%22", "web_spider_distance": 2, "scope_distance": 0, "scan": "SCAN:ece9675afde8fc294d4fca36ad4eebe827311aa6", "timestamp": 1714631709.640931, "resolved_hosts": ["52.149.222.62"], "source": "URL:6f0768274ccf010163ff5906a65f8233ed037711", "tags": ["extension-css-22", "ip-52-149-222-62", "status-400", "endpoint", "in-scope", "cloud-azure", "http-title-runtime-error"], "module": "httpx", "module_sequence": "gowitness->httpx"}

{"type": "URL", "id": "URL:6f0768274ccf010163ff5906a65f8233ed037711", "data": "https://irmaservices.nps.gov/arcgis/rest/services", "web_spider_distance": 1, "scope_distance": 0, "scan": "SCAN:ece9675afde8fc294d4fca36ad4eebe827311aa6", "timestamp": 1714631505.940615, "resolved_hosts": ["52.149.222.62"], "source": "HTTP_RESPONSE:2ef991334e367eda7c83c3a80de6e41440faf7b3", "tags": ["ip-52-149-222-62", "endpoint", "in-scope", "cloud-azure", "status-200", "http-title-national-park-service-folder"], "module": "httpx", "module_sequence": "excavate->httpx"}

Maybe also this one:

{"type": "URL", "id": "URL:a6607c3ba8de19e296a58cc444282ef9af69b017", "data": "https://smokiespermits.nps.gov/layout/js/%27%20+%20decodeURIComponent%28%20v.FIC_internal_link%20%29%20+%20%27", "web_spider_distance": 2, "scope_distance": 0, "scan": "SCAN:ece9675afde8fc294d4fca36ad4eebe827311aa6", "timestamp": 1714631367.729301, "resolved_hosts": ["52.149.222.62"], "source": "HTTP_RESPONSE:d8be77e81836fec520cf727e456c35de41cc1739", "tags": ["ip-52-149-222-62", "endpoint", "http-title-file-not-found-backcountry-per", "in-scope", "extension-fic-internal-link-20-29-20-20-27", "cloud-azure", "status-200"], "module": "httpx", "module_sequence": "excavate->httpx"}

{"type": "HTTP_RESPONSE", "id": "HTTP_RESPONSE:d8be77e81836fec520cf727e456c35de41cc1739", "data": {"url": "https://smokiespermits.nps.gov/layout/js/global.js", "timestamp": "2024-05-02T10:15:57.141282142+02:00", "csp": {"domains": ["www.nps.gov", "www.googletagmanager.com", "www.google-analytics.com", "https://www.google-analytics.com/", "fonts.gstatic.com", "https"]}, "hash": {"body_md5": "db7be3288b1e9acbfa36d998a714b6d7", "body_mmh3": "-1534563558", "body_sha256": "0401975f57a1095c9ba30ebf702cf51ffe010702be5c7df3f664b1bbee45ab4b", "body_simhash": "9814396149870737404", "header_md5": "c204316cb8c7af6e60067a9deb5be58d", "header_mmh3": "-1775295497", "header_sha256": "62ec42817569a93f1a691ebc721e9fe93bc9b229376e82cc59f01317149a0b9e", "header_simhash": "15616147169787753769"}, "port": "443", "input": "https://smokiespermits.nps.gov:443/layout/js/global.js", "scheme": "https", "webserver": "Microsoft-IIS/10.0", "body": "var NPS = NPS || {};\r\n\r\nNPS.cycle = {\r\n  bapSlider: function() {\r\n    var effect = this.cycleEffect(),\r\n      bapSize;\r\n\r\n    if (jQuery('.bap').length) {\r\n      jQuery.each(jQuery('.bap .title'), function(index) {\r\n        var maxWidth = 640;\r\n\r\n        if (jQuery(this).children('.main').children('h1').width() > maxWidth) {\r\n          jQuery(this).children('.main').children('h1').addClass('resized');\r\n        }\r\n\r\n        while(jQuery(this).children('.main').children('h1').width() > maxWidth) {\r\n          var curSize = jQuery(this).children('.main').children('h1').css('font-size'),\r\n            newSize = parseInt(curSize.replace('px',''), 10) + -2 + 'px';\r\n\r\n          jQuery(this).children('.main').children('h1').css('font-size', newSize);\r\n        }\r\n      });\r\n\r\n      bapSize = jQuery('.bap .cycle').children().size();\r\n\r\n      if (bapSize > 1) {\r\n        jQuery('.bap .cycle')\r\n          .after(jQuery('<ul>').addClass('controls'))\r\n          .cycle({\r\n            fx: effect,\r\n            autostop: 0,\r\n            activePagerClass: 'active',\r\n            pager: '.bap .controls',\r\n            pagerAnchorBuilder: function(idx, slide) {\r\n              return jQuery('<li>')\r\n                .attr('class', 'ir')\r\n                .text('Go to slide ' + (++idx));\r\n            },\r\n            end: function(options) {\r\n              jQuery('.bap .cycle').cycle(0).cycle('pause');\r\n            }\r\n          });\r\n      }\r\n    }\r\n\r\n    if (jQuery('.bap-mini').length) {\r\n      bapSize = jQuery('.bap-mini .cycle').children().size();\r\n\r\n      if (bapSize > 1) {\r\n        jQuery('.bap-mini .cycle')\r\n          .after(jQuery('<ul>').addClass('controls'))\r\n          .cycle({\r\n            activePagerClass: 'active',\r\n            autostop: 0,\r\n            fx: effect,\r\n            pager: '.bap-mini .controls',\r\n            pagerAnchorBuilder: function(idx, slide) {\r\n              return jQuery('<li>')\r\n                .attr('class', 'ir')\r\n                .text('Go to slide ' + (++idx));\r\n            },\r\n            end: function(options) {\r\n              jQuery('.bap-mini .cycle').cycle(0).cycle('pause');\r\n            }\r\n          });\r\n      }\r\n    }\r\n  },\r\n  // Enables slider on bap.\r\n  carousel: function() {\r\n    var self = this;\r\n\r\n    if (!(jQuery('.carousel-list ul').length)) {\r\n      return;\r\n    }\r\n\r\n    this.carousel = jQuery('.carousel-list ul');\r\n    this.slideCount = jQuery('.carousel-list ul li').length;\r\n    this.addControls = function() {\r\n      jQuery('' +\r\n        '<ul id=\"carousel-controls\"><li id=\"carousel-controls-prev\"><a class=\"ir\" href=\"#\"><img src=\"/common/commonspot/templates/images/controls/carousel_arrow_left.png\" /></a></li><li id=\"carousel-controls-next\"><a class=\"ir\" href=\"#\"><img src=\"/common/commonspot/templates/images/controls/carousel_arrow_right.png\" /></a></li></ul>' +\r\n      '').appendTo(jQuery('.carousel-list'));\r\n\r\n      if (jQuery('.carousel-list .row').length > 1) {\r\n        this.carousel.next('#carousel-controls').show();\r\n      }\r\n    };\r\n    this.contentsWrap = function() {\r\n      var classes = jQuery('.carousel-list').attr('class'),\r\n        countIndex = classes.indexOf('carousel-list-'),\r\n        carNum = parseInt(classes.substr(countIndex + 14, 1), 10);\r\n\r\n      jQuery('.carousel-list ul').splitList(carNum, {\r\n        splitInto: 'rows'\r\n      }).children('div').addClass('clearfix row');\r\n    };\r\n    this.cycleItems = function() {\r\n      var effect = self.cycleEffect();\r\n      this.carousel.cycle({\r\n        after:  this.cycleAfter,\r\n        fx: effect,\r\n        next: '#carousel-controls-next a',\r\n        nowrap: 1,\r\n        prev: '#carousel-controls-prev a',\r\n        speed: 'fast',\r\n        timeout: 0\r\n      });\r\n    };\r\n    this.cycleAfter = function (curr, next, opts) {\r\n      if (opts === 'undefined') {\r\n        return;\r\n      }\r\n\r\n      var $next = jQuery('#carousel-controls-next'),\r\n        $prev = jQuery('#carousel-controls-prev'),\r\n        position = opts.currSlide;\r\n\r\n      if (NPS.utility.getIeVersion() < 9) {\r\n        jQuery.each(jQuery('.carousel-list ul:first').children(), function(index) {\r\n          if (this === next) {\r\n            position = index;\r\n          }\r\n        });\r\n      }\r\n\r\n      if (position === 0) {\r\n        $prev.addClass('prev-disabled');\r\n      } else {\r\n        $prev.removeClass('prev-disabled');\r\n      }\r\n\r\n      if ((position + 1) === opts.slideCount) {\r\n        $next.addClass('next-disabled');\r\n      } else {\r\n        $next.removeClass('next-disabled');\r\n      }\r\n\r\n      self.setCycleHeight(this);\r\n    };\r\n    this.init = function() {\r\n      this.contentsWrap();\r\n      this.addControls();\r\n      this.cycleItems();\r\n      this.cycleAfter();\r\n    };\r\n\r\n    this.init();\r\n  },\r\n  // Remove fade effect from cycle for IE7, IE8.\r\n  cycleEffect: function() {\r\n    var effect = 'fade';\r\n\r\n    if (NPS.utility.getIeVersion() < 9) {\r\n      effect = 'none';\r\n    }\r\n\r\n    return effect;\r\n  },\r\n  // Sets height of cycle containers.\r\n  setCycleHeight: function(element) {\r\n    var childHeight = 0,\r\n      height = 0;\r\n\r\n    jQuery.each(jQuery(element).children(), function(index) {\r\n      childHeight = jQuery(this).height() + 25;\r\n\r\n      if(childHeight > height) {\r\n        height = childHeight;\r\n      }\r\n    });\r\n    jQuery(element).parent().css('height', height);\r\n  }\r\n};\r\nNPS.display = {\r\n    \r\n  /**\r\n   * Setting up breadcrumbs on page\r\n   */\r\n  populateBreadcrumbs: function(breadcrumbsArr) {\r\n\r\n      if(breadcrumbsArr === undefined) {\r\n        if(jQuery('.breadcrumbSourceContainer').length){\r\n          breadcrumbsArr = NPS.display.recurseBreadcrumbs(jQuery(\".breadcrumbSourceContainer ul li.active\")); //after 30 days, this part is no longer needed -aR - 7/24/18 \r\n        }else{\r\n          breadcrumbsArr = NPS.display.recurseBreadcrumbs(jQuery(\"#npsNav ul li.isCurrentPage\"));   \r\n        }      \r\n      } \r\n      \r\n      var i;\r\n      if(breadcrumbsArr.length >= 1){\r\n        //show it\r\n        jQuery(\"ol.Breadcrumbs\").show();\r\n\r\n        var sectionHomeLI = jQuery(\"#LocalNav-mobile ul li:not(.SectionHeader-green):first:contains('Home')\"); \r\n\r\n        var navTypeTitle = jQuery(\"#LocalNav-mobile li.SectionHeader-green h3\").text();\r\n\r\n        //figure out \"home\" title\r\n        if (typeof navTypeTitle !== 'undefined' && navTypeTitle != '' && navTypeTitle != 'Explore This Park') {\r\n          var sectionHomeTitle = navTypeTitle;\r\n        }else{\r\n          var sectionHomeTitle = jQuery(sectionHomeLI).html();\r\n        }       \r\n\r\n        //loop items and add\r\n        for (i = 0; i <= breadcrumbsArr.length; i++) {  \r\n          if(i < breadcrumbsArr.length){\r\n            if(i == 0 && sectionHomeTitle != \"Home\" && sectionHomeTitle != \"Park Home\" && breadcrumbsArr[i].indexOf(\"> Home <\") > -1){\r\n              jQuery(\"ol.Breadcrumbs\").append(\"<li>\"+breadcrumbsArr[i].replace(\"Home\", sectionHomeTitle)+\"</li>\"); //if it's home on the first item, replace it with the section home title\r\n            }else{\r\n              jQuery(\"ol.Breadcrumbs\").append(\"<li>\"+breadcrumbsArr[i]+\"</li>\");  \r\n            }             \r\n          }\r\n        }   \r\n    \r\n        jQuery(\"ol.Breadcrumbs li:last\").addClass(\"active\").text(jQuery(\"ol.Breadcrumbs li:last a\").text());\r\n\r\n        //manually add home\r\n        if(jQuery(sectionHomeLI).html() && breadcrumbsArr[0].indexOf(jQuery(\"a\",sectionHomeLI).attr('href')) == -1 ){\r\n          // jQuery(\"ol.Breadcrumbs\").prepend('<li><a href=\"'+jQuery(\"a\",sectionHomeLI).attr('href')+'\">'+sectionHomeTitle+'</a>');\r\n\t\t  jQuery(\"ol.Breadcrumbs\").prepend('<li>' + sectionHomeTitle);\r\n        }else if(!jQuery(sectionHomeLI).html() && navTypeTitle == 'Explore This Park' && jQuery(\"a.Hero-title\").html()){  // if park and can't find 'home', make a guess\r\n          jQuery(\"ol.Breadcrumbs\").prepend('<li><a href=\"' + jQuery(\"a.Hero-title\").attr(\"href\") + '\">'+NPS.utility.getTranslation('Park Home')+'</a>');\r\n        }\r\n        \r\n        jQuery(\"ol.Breadcrumbs\").prepend('<li><a href=\"/\">NPS.gov</a></li>');         \r\n      } \r\n  },\r\n\r\n  /**\r\n   * Help with setting up breadcrumbs on page\r\n   */\r\n  recurseBreadcrumbs: function(thisLI,linkArray) {  \r\n    if(linkArray === undefined) {\r\n      linkArray = [];\r\n    }   \r\n    if(jQuery(thisLI).html()){\r\n      //reverse follow tree starting where li class='isCurrentPage'\r\n      linkArray.unshift(jQuery(\"a\",thisLI)[0].outerHTML); \r\n      directParent = jQuery(thisLI).parent(\"ul\").parent(\"li.has-sub\");\r\n\r\n      if(directParent.length > 0){    \r\n        linkArray = NPS.display.recurseBreadcrumbs(directParent,linkArray);\r\n      }\r\n    } \r\n    return linkArray;\r\n  },  \r\n  \r\n  \r\n  /**\r\n   * Wraps the dt and dd pair in each dl with a class of wrapper with a div\r\n   */\r\n  wrapdldt: function() {\r\n    jQuery('.wrapped dt').each(function() {\r\n      var jQuerycurElement = jQuery(this);\r\n      var jQueryselection = jQuery(this);\r\n\r\n      while (jQuerycurElement.next().is('dd')) {\r\n        jQuerycurElement = jQuerycurElement.next();\r\n        jQueryselection.push(jQuerycurElement[0]);\r\n      }\r\n\r\n      jQueryselection.wrapAll('<div class=\"dl-wrapper\">');\r\n    });\r\n  },\r\n  /**\r\n   * Setting up results show / hide functionality\r\n   */\r\n  showHide: function() {\r\n    jQuery('.show-hide a').click(function() {\r\n      if (jQuery(this).hasClass('read-more')) {\r\n        jQuery(this).removeClass('read-more').addClass('read-less').text('Read Less');\r\n        jQuery(this).parent().next().show();\r\n      } else {\r\n        jQuery(this).removeClass('read-less').addClass('read-more').text('Read More');\r\n        jQuery(this).parent().next().hide();\r\n      }\r\n    });\r\n  },\r\n  /**\r\n   * Setting up tabs functionality - relies on jQuery ui\r\n   */\r\n  tabsSetup: function() {\r\n    if (jQuery('.list-nav li').length) {\r\n      jQuery('.list-nav li:not(:first-child)').hide();\r\n      jQuery('.list-nav li:first-child').addClass('active');\r\n      jQuery('.list-nav li a').click(function() {\r\n        var jQuerythis = jQuery(this);\r\n        var jQuerylist = jQuery(this).parent().parent();\r\n\r\n        if (jQuerythis.parent().siblings(':visible').length === 0) {\r\n          jQuerythis.parent().siblings().show();\r\n        } else {\r\n          jQuerythis.parent().siblings().removeClass('active').end().addClass('active');\r\n\r\n          var move = jQuery(this).parent().detach();\r\n          move.prependTo(jQuerylist);\r\n          move = null;\r\n          jQuerythis.parent().siblings().hide();\r\n        }\r\n      });\r\n    }\r\n\r\n    if (jQuery('.content-viewer').length) {\r\n      jQuery( '.content-viewer').tabs();\r\n    }\r\n\r\n    if (jQuery('.tabbed').length) {\r\n      jQuery('.tabbed').tabs();\r\n    }\r\n  },\r\n  /**\r\n   * Show and hide global alert message\r\n   */\r\n  alert: function() {\r\n    if ((jQuery('#content-alert').length) && (jQuery('.alert-toggle').length)) {\r\n      jQuery('#content-alert').hide();\r\n      jQuery('.alert-toggle').click(function() {\r\n        if (jQuery('#content-alert').is(':visible')) {\r\n          jQuery('#content-alert').hide();\r\n          jQuery('#alert-toggle')[0].innerHTML = NPS.utility.getTranslation(\"Show Alerts\") + ' &raquo;';\r\n        } else{\r\n          jQuery('#content-alert').show();\r\n          jQuery('#alert-toggle')[0].innerHTML = NPS.utility.getTranslation(\"Hide Alerts\") + ' &raquo;';\r\n        }\r\n      });\r\n    }\r\n  },\r\n  /**\r\n   * Show and hide transcript controls\r\n   */\r\n  transcriptControls: function() {\r\n    if (jQuery('.transcript-control').length) {\r\n      jQuery('.transcript-control a').click(function() {\r\n        var transcript = jQuery(this).parent().next('.transcript');\r\n        var jQueryfact = jQuery('.adjusted-for-fact .fact');\r\n\r\n        if (transcript.is(':visible')) {\r\n          if (NPS.utility.getIeVersion() === 7) {\r\n            jQueryfact.hide();\r\n          }\r\n\r\n          transcript.hide();\r\n          jQuery(this).parent().removeClass('close').addClass('open');\r\n\r\n          if (NPS.utility.getIeVersion() === 7) {\r\n            jQueryfact.show();\r\n          }\r\n        } else {\r\n          if (NPS.utility.getIeVersion() === 7) {\r\n            jQueryfact.hide();\r\n          }\r\n\r\n          transcript.show();\r\n          jQuery(this).parent()\r\n            .removeClass('open')\r\n            .addClass('close');\r\n\r\n          if (NPS.utility.getIeVersion() === 7) {\r\n            jQueryfact.show();\r\n          }\r\n        }\r\n      });\r\n    }\r\n  },\r\n  /**\r\n   * hide and show full field trips\r\n   */\r\n  resultAlert: function() {\r\n    if (jQuery('#micro-filter-check').length) {\r\n      jQuery('#micro-filter-check').change(function() {\r\n        if (jQuery('#micro-filter-check').is(':checked')) {\r\n          jQuery(\"#display-list-view li\").has(\".alert-box\").show();\r\n        } else{\r\n          jQuery(\"#display-list-view li\").has(\".alert-box\").hide();\r\n        }\r\n      });\r\n    }\r\n  },\r\n  \r\n  \r\n  /**\r\n   * Add show-hide buttons to reviews\r\n   */\r\n  reviewShow: function(){\r\n    if(jQuery('.content .review-body').length) {\r\n      jQuery('.review-body').hide();\r\n      jQuery('.review-body').before('<div class=\"show-hide\"><a class=\"read-more\" href=\"javascript:;\">Read More</a></div>');\r\n      this.showHide();\r\n    }\r\n  },\r\n  /**\r\n   * Login/Logout/Siteadmin links only when in cms\r\n   */  \r\n  showAdminTools: function( user_id ) {\r\n  \r\n  url = window.location.pathname;\r\n  filename = url.replace(/^.*[\\\\\\/]/, '');  \r\n  \r\n  if ( (window.location.hostname.indexOf( 'cms.nps.doi.net' ) > -1 || window.location.hostname.indexOf( 'cms.nps.gov' ) > -1 ) && filename != 'index_parklist.htm') {\r\n  \r\n    html = '<div class=\"container\"><div class=\"row\"><div class=\"col-sm-12\">';\r\n    \r\n    if ( user_id > 0 ) {\r\n      html += '<a class=\"logout\" href=\"logout.cfm\"><strong>CMS Logout</strong></a> |'; \r\n      html += '<a class=\"siteadmin\" href=\"/siteadmin/index.htm\"><strong>Site Admin</strong></a>';\r\n    }\r\n    else {\r\n      html += '<a class=\"login\" href=\"login.cfm\"><strong>CMS Login</strong></a>';\r\n    }\r\n    \r\n    html += '</div></div></div>';\r\n    \r\n    jQuery( '#adminTools' ).html( html );\r\n  }\r\n  \r\n  },\r\n  /**\r\n   * Show Anniversary Banner\r\n   */    \r\n  displayAnniversaryBanner: function() {\r\n\t  \r\n\tif ( jQuery( '#anniversary_banner' ).length != 0 ) {\r\n\t\t\r\n\t\t\r\n\t\tsite_code = jQuery( '#anniversary_banner' ).data( 'sitecode' );\r\n\t\tsite_type = jQuery( '#anniversary_banner' ).data( 'sitetype' );\r\n\t\t\r\n\t\tif ( site_type == 'park' || site_type == 'subject' ) {\r\n\t\t\t\r\n\t\t\tjsonSrc = '/' + site_code + '/anniversary_banner_' + site_code + '.json';\r\n\t\t\t\r\n\t\t\tif ( location.href.indexOf('/locations/dc/') > -1 ) {\r\n\t\t\t\t//Special case for /locations/dc/ having a site code that does not match URL\r\n\t\t\t\tjsonSrc = '/locations/dc/anniversary_banner_' + site_code + '.json';\r\n\t\t\t\t\r\n\t\t\t} else if ( location.href.indexOf('/locations/') > -1 ) {\r\n\t\t\t\t\r\n\t\t\t\tjsonSrc = '/locations' + jsonSrc;\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t} else if ( site_type == 'subject' ) {\r\n\t\t\t\t\r\n\t\t\t\tjsonSrc = '/subjects' + jsonSrc;\r\n\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\r\n\t\t\tjQuery( '#anniversary_banner' ).delegate( '.js-dismiss', 'click', function( event ) {\r\n\t\t\t  \r\n\t\t\t  document.cookie = 'anniversaryBannerDismiss' + site_code + '=1; expires=0; path=/';\r\n\t\t\t  jQuery( '#anniversary_banner' ).hide();\r\n\t\t\t  \r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t// check for the cookie\r\n\t\t\tvar ca = document.cookie.split(';');\r\n\t\t\tvar abAuto = 1;\r\n\t\t  \r\n\t\t\tfor ( var ci = 0; ci < ca.length; ci++ ) {\r\n\t\t\t\r\n\t\t\t\tvar c = ca[ ci ];\r\n\t\t\t\twhile ( c.charAt(0) == ' ' ) c = c.substring( 1 );\r\n\t\t\t\tif ( c.indexOf( 'anniversaryBannerDismiss' + site_code + '=' ) != -1 ) {\r\n\t\t\t\t\tabAuto = 0;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t  \r\n\t\t\ttry {\r\n\t\t\t\t\r\n\t\t\t\tjQuery.ajax({\r\n\t\t\t\t\ttype: 'GET',\r\n\t\t\t\t\turl: jsonSrc, \r\n\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\tsuccess: function( data ) {\r\n\r\n\t\t\t\t\t\tif ( undefined !== data.title ) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ( data.title.length && abAuto == 1 ) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\thtml = '';\r\n\t\t\t\t\t\t\t\thtml += '<div class=\"container\">';\r\n\t\t\t\t\t\t\t\thtml += '<div class=\"AnniversaryBanner-content\">';\r\n\t\t\t\t\t\t\t\thtml += '<a href=\"' + data.ctaURL + '\">';\r\n\t\t\t\t\t\t\t\thtml += '<div class=\"AnniversaryBanner-left\"><img src=\"' + data.imgSrc + '\" alt=\"' + data.imgAlt +'\"></div>';\r\n\t\t\t\t\t\t\t\thtml += '<div class=\"AnniversaryBanner-center\">';\r\n\t\t\t\t\t\t\t\thtml += '<h2 class=\"AnniversaryBanner-title\">' + data.title + '</h2>';\r\n\t\t\t\t\t\t\t\thtml += '<span class=\"AnniversaryBanner-cta carrot-end\">' + data.ctaText + '</span>';\r\n\t\t\t\t\t\t\t\thtml += '</div>';\r\n\t\t\t\t\t\t\t\thtml += '</a>';\r\n\t\t\t\t\t\t\t\thtml += '<div class=\"AnniversaryBanner-right\">';\r\n\t\t\t\t\t\t\t\thtml += '<button class=\"js-dismiss\" data-close=\".AnniversaryBanner\">';\r\n\t\t\t\t\t\t\t\thtml += '<i class=\"fa fa-times-circle\" aria-hidden=\"true\"></i>';\r\n\t\t\t\t\t\t\t\thtml += '<span class=\"text\"> '+NPS.utility.getTranslation(\"Dismiss\")+'<span class=\"visuallyhidden\">'+NPS.utility.getTranslation(\"Promotion\")+'</span></span>';\r\n\t\t\t\t\t\t\t\thtml += '</button>';\r\n\t\t\t\t\t\t\t\thtml += '</div>';\r\n\t\t\t\t\t\t\t\thtml += '</div>';\r\n\t\t\t\t\t\t\t\thtml += '</div>';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tjQuery( '#anniversary_banner' ).append( html );\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t},\r\n\t\t\t\t\terror: function() { \r\n\t\t\t\t\t\t// do nothing \r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\t\t\r\n\t\t\tcatch ( err ) {\r\n\t\t\t\t// do nothing\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n  },\r\n\r\n  outputNav:function (rootSubsiteID,currentURL,mode){ \r\n\r\n    jQuery.getJSON(\"/layout/site_nav.json\", function( data ) {\r\n\r\n      var urlRoot = data.r;\r\n      jQuery(\"#npsNav ul\").append(NPS.display.outputNavLevel(data.p, urlRoot, currentURL));\r\n\r\n      //now call breadcrumbs\r\n      NPS.display.populateBreadcrumbs(); //from global.js\r\n\r\n      jQuery(\"#LocalNav-mobile ul li a\").wrapInner(\"<span></span>\");\r\n\r\n      jQuery(\"#LocalNav-desktop-nav ul:first-child > li:first-child a:contains('Park Home')\").parent().hide(); //hide \"Park Home\" li\r\n      jQuery(\"li#LocalNav-mobile ul:first-child > li:nth-child(2) a:contains('Park Home')\").parent().hide(); //hide \"Park Home\" li\r\n\r\n      if(!jQuery(\"li#LocalNav-mobile ul:first-child > li:nth-child(2) a:contains('Park Home')\").length){\r\n        jQuery(\"li#LocalNav-mobile li.SectionHeader-green h3\").text(\"Explore This Site\"); //change \"Explore This Park\" to \"Explore This Site\" on non-parks\r\n      }\r\n\r\n      //hide things beyond the 4th level\r\n      jQuery(\"#LocalNav-desktop-nav ul > li > ul > li > ul > li > ul > li > ul\").remove();\r\n      jQuery(\"#LocalNav-mobile ul > li > ul > li > ul > li > ul > li > ul\").remove();    \r\n      jQuery(\"#LocalNav-mobile ul > li > ul > li > ul > li > ul > li\").removeClass(\"has-sub\");\r\n      jQuery(\"#LocalNav-mobile ul > li > ul > li > ul > li > ul > li > a\").removeClass(\"has-sub\");\r\n\r\n      //hide hidden items (we used them for breadcrumbs and don't need them any more)\r\n      jQuery(\"#LocalNav-desktop-nav li.isHidden, #LocalNav-mobile li.isHidden\").remove();\r\n      jQuery(\"#LocalNav-desktop-nav ul:not(:has(li)), #LocalNav-mobile ul:not(:has(li))\").parent().removeClass(\"has-sub\").find(\"a\").removeClass(\"has-sub\"); //remove adjacent has-sub classes before removing empty ul\r\n      jQuery(\"#LocalNav-desktop-nav ul:not(:has(li)), #LocalNav-mobile ul:not(:has(li))\").remove(); //kill ul container, if empty     \r\n\r\n      // setup mobile nav functionality\r\n      var mobileNavTopLevelLinks = jQuery('#LocalNav-mobile > ul  > li.has-sub > a, #GlobalNav-mobile > ul > li.has-sub > a');\r\n      mobileNavTopLevelLinks.append('<span class=\"holder\"></span>');\r\n\r\n      var mobileNavLinks = jQuery('#LocalNav-mobile li.has-sub > a, #GlobalNav-mobile li.has-sub > a');\r\n      var mobileNavLinkTexts = jQuery('#LocalNav-mobile ul li.has-sub a > span, #GlobalNav-mobile ul li.has-sub a > span');\r\n\r\n      /*** remove the click handlers added in app.late.min.js. this is  unique to global.js ***/\r\n      mobileNavLinks.attr('onclick','').unbind('click');\r\n      mobileNavLinkTexts.attr('onclick','').unbind('click');\r\n\r\n      mobileNavLinks.on('click', function (e) { NPS.display.toggleMobileNavSubMenu(e) });\r\n      mobileNavLinkTexts.on('click', function (e) { NPS.display.followMobileNavLinkText(e) });\r\n\r\n      /* make sure that carets handle appropriately. this is  unique to global.js */\r\n      var holders= jQuery(\"#LocalNav-mobile span.holder, #GlobalNav-mobile span.holder\");\r\n      holders.attr('onclick','').unbind('click');\r\n      holders.on('click', function (e) { NPS.display.toggleMobileNavSubMenu(e) });\r\n\r\n      //setup content\r\n      jQuery(\"ul#LocalNav > li > a\").wrap(\"<div class='top-lvl-item-container'>\").wrap(\"<div class='top-lvl-item'>\");\r\n\r\n      //from app-late\r\n      //turn on smart menus\r\n      jQuery(\"#Subject-header\").length > 0 ? jQuery(\"#LocalNav\").smartmenus({\r\n        subIndicators: 1,\r\n        subIndicatorsText: \"\",\r\n        subMenusSubOffsetX: 0,\r\n        subMenusSubOffsetY: 36,\r\n        subMenusMaxWidth: 200,\r\n        mainMenuSubOffsetX: 0,\r\n        mainMenuSubOffsetY: 56,\r\n        keepInViewport: !0\r\n        }) : jQuery(\"#LocalNav\").smartmenus({\r\n            subIndicators: 1,\r\n            subIndicatorsText: \"\",\r\n            subMenusSubOffsetX: 0,\r\n            subMenusSubOffsetY: 36,\r\n            subMenusMaxWidth: 200,\r\n            mainMenuSubOffsetX: 0,\r\n            mainMenuSubOffsetY: 56,\r\n            keepInViewport: !1\r\n          })\r\n        , jQuery(\"#LocalNav\").smartmenus(\"keyboardSetHotkey\", 123, \"shiftKey\")\r\n\r\n        if(mode != 'read'){\r\n          // Add icons and messaging to action items\r\n          //adapted from render.cfc, remove it from there?\r\n          jQuery(\"#LocalNav a.isNotActive\").attr(\"title\",\"Add Page\").append('<img class=\"navHelperImg\" src=\"/ADF/apps/nps_nav/images/inactive.png\" alt=\"Page Is Not Active\" title=\"Page Is Not Active\" />');\r\n          jQuery(\"#LocalNav a.isHidden\").append('<img class=\"navHelperImg\" src=\"/ADF/apps/nps_nav/images/lightbulb_off.png\" alt=\"Page Is Not Active\" title=\"Page Is Hidden On Nav\" />');\r\n          jQuery(\"#LocalNav a.doesnotexist-addenabled\").append('<img class=\"navHelperImg\" src=\"/ADF/apps/nps_nav/images/page_white_add.png\" alt=\"Create Page\" title=\"Create Page\" />').attr(\"title\",\"Create Page\");\r\n          jQuery(\"#LocalNav a.doesnotexist-adddisabled\").append('<img class=\"navHelperImg\" src=\"/ADF/apps/nps_nav/images/page_white_add_grayed.png\" alt=\"Create Page Disabled\" title=\"Create Page Disabled At This Level - Click For Details\" />').attr(\"title\",\"Create Page Disabled At This Level - Click For Details\");\r\n        }\r\n\r\n      jQuery(\"ul#LocalNav > li:nth-child(1)\").trigger('click'); //overcoming weird bug where the nav doesnt expand until after the first mouseenter and mouseexit\r\n\r\n    });\r\n\r\n  },\r\n\r\n\r\n  outputNavLevel: function (itemData,urlRoot,currentURL){ // put this in a JS file\r\n\r\n    var navContent = \"\";\r\n\r\n    jQuery.each(itemData, function(key, val){\r\n\r\n      //check if this is the current page\r\n      if(currentURL == (urlRoot + val.u)){\r\n        if(!\"c\" in val){\r\n          val.c = \"isCurrentPage\";\r\n        }else{\r\n          val.c = val.c + \" isCurrentPage\";\r\n        }\r\n      }\r\n\r\n      if(val.u.indexOf('javascript:addPageCallback') !== -1) {\r\n        val.c = val.c + \" navLink-\" + val.u.split(\",\")[5].replace(/'/g, '').trim();\r\n      }\r\n\r\n      //output LI\r\n      navContent += \"<li\" + (\"c\" in val ? \" class='\"+val.c+\"'\":\"\") + \">\";\r\n\r\n      //output link\r\n      navContent += \"<a href='\" + (val.u.indexOf('javascript') !== -1 ? val.u.replace(/'/g, \"&quot;\") : urlRoot + val.u ) + \"'\" + (\"c\" in val ? \" class='\"+val.c+\"'\":\"\") +\">\" + val.t + \"</a>\";\r\n\r\n      //output children, if applicable  <ul>\r\n      if(\"p\" in val){\r\n        navContent += \"<ul>\";\r\n        navContent += NPS.display.outputNavLevel(val.p, urlRoot, currentURL);\r\n        navContent += \"</ul>\";          \r\n      }\r\n\r\n      //output /LI\r\n      navContent += \"</li>\";\r\n\r\n    });\r\n\r\n    return navContent;\r\n\r\n  },\r\n\r\n  toggleMobileNavSubMenu : function (e) { // DONT FORGET TO REMOVE THIS FROM ELSEWHERE\r\n    e.preventDefault();\r\n    var element = jQuery(e.currentTarget).parent('li');\r\n    if (element.hasClass('open')) {\r\n      element.removeClass('open');\r\n      element.find('li').removeClass('open');\r\n      element.find('ul').slideUp();\r\n    } else {\r\n      element.addClass('open');\r\n      element.children('ul').slideDown();\r\n      element.siblings('li').children('ul').slideUp();\r\n      element.siblings('li').removeClass('open');\r\n      element.siblings('li').find('li').removeClass('open');\r\n      element.siblings('li').find('ul').slideUp();\r\n    }\r\n  },\r\n\r\n  followMobileNavLinkText : function (e) {// DONT FORGET TO REMOVE THIS FROM ELSEWHERE\r\n    e.stopPropagation();\r\n    window.location.href = jQuery(e.currentTarget).parent('a').attr('href');\r\n  }\r\n\r\n\r\n};\r\nNPS.forms = {\r\n  /**\r\n   * Add placeholder support for older browsers\r\n   */\r\n  placeholder: function() {\r\n    jQuery('[placeholder]').focus(function() {\r\n      var input = jQuery(this);\r\n\r\n      if (input.val() === input.attr('placeholder')) {\r\n        input.val('');\r\n        input.removeClass('placeholder');\r\n      }\r\n    }).blur(function() {\r\n      var input = jQuery(this);\r\n\r\n      if (input.val() === '' || input.val() === input.attr('placeholder')) {\r\n        input.addClass('placeholder');\r\n        input.val(input.attr('placeholder'));\r\n      }\r\n    }).blur().parents('form').submit(function() {\r\n      jQuery(this).find('[placeholder]').each(function() {\r\n        var input = jQuery(this);\r\n\r\n        if (input.val() === input.attr('placeholder')) {\r\n          input.val('');\r\n        }\r\n      });\r\n    });\r\n  },\r\n  /**\r\n   * Submit drop down on click\r\n   */\r\n  searchDropdown: function() {\r\n    jQuery('#park-query').change(function() {\r\n      if (!!jQuery(this).val()) window.location = jQuery(this).val();\r\n      jQuery('#find_park_form').attr('action', jQuery(this).val());\r\n    });\r\n    jQuery('#subject-query').change(function() {\r\n      if (!!jQuery(this).val()) window.location = jQuery(this).val();\r\n    });\r\n  },\r\n  /**\r\n   * submit sort by\r\n   */\r\n  sortBySubmit: function() {\r\n    if(jQuery('.sort-by #sort-by-select').length) {\r\n      jQuery('.sort-by #sort-by-select').change(function(){\r\n        jQuery('.sort-by').submit();\r\n      });\r\n    }\r\n  },\r\n  /**\r\n   * Live search\r\n   */\r\n  liveSearch: function(){\r\n    jQuery('#global-search input').keyup(function() {\r\n      var searchVal = jQuery('#global-search input').val();\r\n      //get url\r\n      var url = document.location.href;\r\n      //split url\r\n      var urlparts = url.split('/');\r\n      //get the park\r\n      var park = urlparts[3];\r\n      var siteLimit = '';\r\n      //ensure that the park is 4 letters long\r\n      if(park.length == 4){\r\n        var siteLimit = 'www.nps.gov/' + park;\r\n      }\r\n\r\n      // added 2013-07-06 for orgs and subject site limits for search\r\n      if(park === 'subjects'){\r\n        var siteLimit = 'www.nps.gov/subjects/' +  urlparts[4];\r\n      }\r\n      if(park === 'orgs'){\r\n        var siteLimit = 'www.nps.gov/orgs/' +  urlparts[4];\r\n      }\r\n      \r\n      var subsites = window.location.pathname.split('/');\r\n      var searchTextGuidance = 'this site';\r\n        \r\n      if (subsites[1] == 'subjects') {\r\n        searchTextGuidance = 'this site';\r\n      } else if (subsites[1] == 'teachers') {\r\n        searchTextGuidance = 'this site';\r\n      }\r\n\t\t\t\r\n\t\t\tsearchTextGuidance = NPS.utility.getTranslation(searchTextGuidance);\r\n\r\n      jQuery('#result1')[0].innerHTML = '<a href=\"/search/index.htm?query=' + searchVal + '&sitelimit=' + siteLimit + '\">' + searchVal + ' ' + searchTextGuidance + '</a>';\r\n      jQuery('#result2')[0].innerHTML = '<a href=\"/search/index.htm?query=' + searchVal + '\">' + searchVal + ' in NPS.gov</a>';\r\n      jQuery('#search-results-container').show();\r\n      jQuery.ajax({\r\n        data:{\r\n          q: searchVal\r\n        },\r\n        dataType: 'jsonp',\r\n        url: 'http://search.usa.gov/sayt?aid=' + NPS.utility.params.saytId,\r\n        success: function(suggestions) {\r\n          if (suggestions.length !== 0) {\r\n            var i = 0;\r\n            //generate suggestions html\r\n            var html = jQuery('<ul>');\r\n            //var html = '<p>Suggestions</p><ul>';\r\n            jQuery.each(suggestions, function(index, suggestion) {\r\n              if(i < 3){\r\n                //debug here\r\n                html.append(jQuery('<li>').append(jQuery('<a>').attr('href', '/search/index.htm?query=' + suggestion).text(suggestion)));\r\n              }\r\n              i++;\r\n            });\r\n            html = jQuery('<p>').text('Suggestions').append(html);\r\n            jQuery('#search-results #suggestions').empty().html(html);\r\n          }\r\n\r\n          if (window.location.href.split('/').length - 1 === 3) {\r\n            jQuery('#result1').hide();\r\n          }\r\n        },\r\n        error: function() {\r\n          jQuery('#search-results #suggestions').empty();\r\n        }\r\n      });\r\n    });\r\n  }\r\n};\r\nNPS.gallery = {\r\n  /**\r\n  * tool tip\r\n  */\r\n  tooltip: function() { \r\n    if(jQuery('.tooltip').length) {\r\n      xOffset = 10;\r\n      yOffset = 20; \r\n      jQuery('.tooltip img').hover(function(e) {\r\n        //set empty title attribute for IE7\r\n        if(NPS.utility.getIeVersion() < 8){\r\n          jQuery(this).attr('title','');\r\n        }\r\n        jQuery('#tooltip').remove();\r\n        var text = jQuery(this).attr('alt');\r\n        if(text != undefined && text != '') {\r\n          jQuery('body').append('<p id=\"tooltip\">'+ jQuery(this).attr('alt') +'</p>');\r\n          jQuery('#tooltip')\r\n            .css('top',(e.pageY - xOffset) + 'px')\r\n            .css('left',(e.pageX + yOffset) + 'px')\r\n            .show();  \r\n        }\r\n        },\r\n      function() {\r\n        this.title = this.t;    \r\n        jQuery('#tooltip').remove();\r\n        }); \r\n      jQuery('.tooltip img').mousemove(function(e) {\r\n        jQuery('#tooltip')\r\n          .css('top',(e.pageY - xOffset) + 'px')\r\n          .css('left',(e.pageX + yOffset) + 'px');\r\n      });\r\n    }\r\n    if(jQuery('.gallery-content-tooltip').length) {\r\n      jQuery('.gallery-content-tooltip img').mouseenter(function(e) {\r\n        //set empty title attribute for IE7\r\n        if(NPS.utility.getIeVersion() < 8){\r\n          jQuery(this).attr('title','');\r\n        }\r\n        jQuery('.gallery-tooltip').hide();\r\n        var tooltip = jQuery(this).parents('.image').children('.gallery-tooltip');\r\n        if(tooltip.length && !tooltip.is(':visible')){\r\n          tooltip.show();\r\n        }\r\n        else{\r\n          var text = jQuery(this).attr('alt');\r\n          if(text != undefined && text != '') {\r\n            jQuery(this).parents('.image').append(jQuery('<div>').addClass('gallery-tooltip').append(jQuery('<div>').addClass('gallery-tooltip-arrow')).append(jQuery('<p>').text(text))).show();\r\n          }\r\n        }\r\n        });\r\n        jQuery('.gallery-content-tooltip img').mouseout(function(e) {\r\n          jQuery(this).parents('.image').children('.gallery-tooltip').hide();\r\n        });\r\n    } \r\n  },\r\n  /**\r\n   * photo gallery setup\r\n   */\r\n  photoGallery: function() {\r\n    if(jQuery('.gallery-views').length) {\r\n      var buildControl = jQuery('<div id=\"gallery-controls\"><ul class=\"view-controls\"><li class=\"active\"><a href=\"#\" class=\"list-view\">List View</a></li><li><a href=\"#\" class=\"grid-view\">Grid View</a></li></ul></div>');\r\n      jQuery('.gallery-views #gallery-top').append(buildControl);\r\n      NPS.gallery.galleryControls();\r\n    }\r\n    jQuery('#photo-gallery .description h3 a').click(function(e) {\r\n      e.preventDefault();\r\n      //simulate lightbox click\r\n      jQuery(this).parent().parent().prev().children('a').click();\r\n    });\r\n  },\r\n  /**\r\n   * switch between grid and list view\r\n   */\r\n  galleryControls: function() {\r\n    jQuery('.list-view, .grid-view').click(function(e){\r\n      e.preventDefault();\r\n      var jQuerythis = jQuery(this);\r\n      if(!jQuerythis.parent().hasClass('active')){\r\n        jQuerythis.parent().addClass('active');\r\n        jQuerythis.parent().prev().removeClass('active');\r\n        jQuerythis.parent().next().removeClass('active');\r\n        if(jQuery('#gallery-content').hasClass('list')){\r\n          jQuery('#gallery-content').removeClass('list').addClass('grid');\r\n        }\r\n        else if(jQuery('#gallery-content').hasClass('grid')){\r\n          jQuery('#gallery-content').removeClass('grid').addClass('list');\r\n        }\r\n      }\r\n    });\r\n  }\r\n};\r\nNPS.lightbox = {\r\n  lightboxTitle: function(title, currentArray, currentIndex, currentOpts) {\r\n    var index = (currentIndex + 1);\r\n    var html = jQuery('<div>').addClass('clearfix');\r\n    var disablePrev = '', disableNext = '';\r\n    if (currentArray.length > 1) {\r\n      if(index == 1) {\r\n        disablePrev = 'disable';\r\n      }\r\n        if(index == currentArray.length) {\r\n          disableNext = 'disable'\r\n        }\r\n        //create next and previous buttons\r\n        html.append(jQuery('<span>').attr('id','fancybox-prev').append(jQuery('<a>').addClass(disablePrev).attr('href','javascript:jQuery.fancybox.prev();').text('Previous')))\r\n        .append(jQuery('<span>').attr('id','fancybox-next').append(jQuery('<a>').addClass(disableNext).attr('href','javascript:jQuery.fancybox.next();').text('Previous')))\r\n      }\r\n      var altText = jQuery(currentArray[currentIndex]).children().attr('alt');\r\n      var linkText = jQuery(currentArray[currentIndex]).text();\r\n      if(altText != undefined && altText != '') {\r\n        title = altText;\r\n      }\r\n      else if(linkText != undefined && linkText != '') {\r\n        title = linkText;\r\n      }\r\n      html.append(jQuery('<div>').attr('id','fancybox-description').append(jQuery('<p>').text(title)));\r\n    return html;\r\n  },\r\n  /**\r\n  * lightbox gallery\r\n  */\r\n  lightbox: function() {\r\n    if (jQuery('a[data-rel=\"gallery1\"]').length) {\r\n      jQuery('a[data-rel=\"gallery1\"]').fancybox({\r\n        'titlePosition': 'inside',\r\n        'titleFormat': NPS.lightbox.lightboxTitle\r\n      });\r\n    }\r\n\r\n    //photo gallery\r\n    if (jQuery('#photo-gallery #gallery-content .image').length) {\r\n      jQuery('#photo-gallery #gallery-content .image a').fancybox({\r\n        'titlePosition': 'inside',\r\n        'titleFormat': NPS.lightbox.lightboxTitle\r\n      });\r\n    }\r\n\r\n    //slideshow\r\n    if (jQuery('#gallery-listing .slideshow').length) {\r\n      jQuery('#gallery-listing .view-slideshow').click(function() {\r\n        //remove relationship groupings\r\n        jQuery('#photo-galleries .slideshow li a').attr('rel','');\r\n        //add relationship grouping to this slideshow group\r\n        jQuery(this).parent().next().children('li').children('a').attr('rel','gallery-slideshow');\r\n        jQuery('a[rel=\"gallery-slideshow\"]').fancybox({\r\n          'titlePosition': 'inside',\r\n          'titleFormat': NPS.lightbox.lightboxTitle\r\n        });\r\n        //simulate click to start lightbox\r\n        jQuery(this).parent().next().children('li:first').children('a').click();\r\n      });\r\n    }\r\n  },\r\n  eventDetails: function(){\r\n    if(jQuery('.results .show-event').length) {\r\n      jQuery('.results .show-event').click(function(event) {\r\n        jQuerythis = jQuery(this);\r\n\r\n        if (!jQuerythis.hasClass('is-fancy')){\r\n          //stop event\r\n          event.preventDefault();\r\n          //add is-fancy class to link\r\n          jQuerythis.addClass('is-fancy');\r\n          //add print link\r\n          jQuery(this).parents('.wrapper').next().children().append(\r\n            jQuery('<a>').attr('href','#').addClass('print-event ir').text('Print')\r\n          );\r\n          //get event details content + add width/height, hide title, no transition, cleanup on close \r\n          jQuerythis.fancybox({\r\n            'content': jQuery(this).parents('.wrapper').next().children().css('width','475'),\r\n            'titleShow': false,\r\n            'transitionIn': 'none',\r\n            'transitionOut': 'none',\r\n            'onComplete': function() {\r\n              //add print style sheet\r\n              jQuery('<link rel=\"stylesheet\" media=\"print\" id=\"print-event\" href=\"../global/css/event-details-print.css\"/>').appendTo('head');\r\n              //add print click event\r\n              jQuery('#fancybox-content .print-event').click(function(e) {\r\n                e.preventDefault();\r\n                window.print();\r\n                return false;\r\n              });\r\n            },\r\n            'onCleanup': function() {\r\n              //remove print style sheet\r\n              jQuery('#print-event').remove();\r\n            }\r\n          });\r\n\r\n          //continue event\r\n          jQuerythis.trigger(event)\r\n        }\r\n      });\r\n      jQuery('.results .show-event-trigger').click(function(event) {\r\n        event.preventDefault();\r\n        jQuerythis = jQuery(this);\r\n        jQuerythis.parent('h3').siblings('.wrapper').find('.show-event').click();\r\n      });\r\n    }\r\n  },\r\n  /**\r\n   * iframe for rate button\r\n   */\r\n  rateBtn: function () {\r\n    var height = 805;\r\n\r\n    //ie 7 height\r\n  /* removed for RD\r\n    if (NPS.utility.getIeVersion() < 8) {\r\n      height = 855;\r\n    }\r\n\r\n    if (jQuery('.rate-btn').length) {\r\n      jQuery('.rate-btn').fancybox({\r\n        'width': 598,\r\n        'height': height,\r\n        'autoScale': false,\r\n        'type': 'iframe'\r\n      });\r\n    }\r\n  */\r\n  }\r\n};\r\n\r\nNPS.modals = {\r\n  _setModalParkMapHeight: function($body) {\r\n    $body.css({\r\n      height: jQuery(window).height() - 85\r\n    });\r\n  },\r\n  init: function() {\r\n    var me = this;\r\n\r\n    if (jQuery('#modal-park-map')) {\r\n      var $body = jQuery('#modal-park-map .modal-body'),\r\n        $iframe = jQuery('#modal-park-map-iframe'),\r\n        loaded = false;\r\n\r\n      jQuery('#modal-park-map').modal({\r\n        show: false\r\n      });\r\n      jQuery(window).resize(function() {\r\n        me._setModalParkMapHeight($body);\r\n      });\r\n      jQuery('#modal-park-map').on('show.bs.modal shown.bs.modal', function() {\r\n        if (!loaded) {\r\n          $iframe.attr('src', $iframe.attr('data-src'));\r\n          loaded = true;\r\n        }\r\n\r\n        me._setModalParkMapHeight($body);\r\n      });\r\n    \r\n    //this function attached to the window allows the interior iFrame close using 'esc' key even when it has focus\r\n      window.closeMapModal=function() {\r\n        if (jQuery('#modal-park-map')) {\r\n          jQuery('#modal-park-map').modal('hide');\r\n        }\r\n      };\r\n    \r\n    }\r\n  }\r\n};\r\n\r\n\r\n\r\nNPS.newContent = {\r\n  addPrintLink: function() {\r\n    jQuery('.addthis_toolbox')\r\n      .before(jQuery('<li>')\r\n      .addClass('print')\r\n      .append(jQuery('<a>')\r\n        .attr('href','javascript:void(0);')\r\n        .text('print')\r\n      ));\r\n    jQuery('.print a').click(function() {\r\n      window.print();\r\n      return false;\r\n    });\r\n  },\r\n  // Popup window for webcam.\r\n  webcamLink: function() {\r\n    jQuery('.webcam-link').click(function(e) {\r\n      e.preventDefault();\r\n\r\n      if (window.focus) {\r\n        window.open(jQuery(this).attr('href'),'','height=800,width=960,scrollbars=yes').focus();\r\n      }\r\n    });\r\n  },\r\n  // Simple function that adds the double right brackets to the links with the .more class.\r\n  moreLinks: function () {\r\n    if (NPS.utility.getIeVersion() < 8) {\r\n      var $this = jQuery(this);\r\n\r\n      jQuery('.more').each(function() {\r\n        $this[0].innerHTML = $this.text() + '&nbsp;&raquo;';\r\n      });\r\n      jQuery('.back').each(function() {\r\n        $this = jQuery(this);\r\n        $this[0].innerHTML = '&laquo;&nbsp;' + $this.text();\r\n      });\r\n    }\r\n  },\r\n  // Twitter.\r\n  getTweets: function (username, tweetNum, container) {\r\n    if (container && container.length) {\r\n      container.append(jQuery('<span>').addClass('loading'));\r\n\r\n      jQuery.getJSON('http://twitter.com/statuses/user_timeline.json?screen_name=' + username + '&count=' + tweetNum + '&callback=?', function(data) {\r\n        var tweet = data[0].text;\r\n\r\n        tweet = tweet.replace(/(\\b(https?|ftp|file):\\/\\/[-A-Z0-9+&@#\\/%?=~_|!:,.;]*[-A-Z0-9+&@#\\/%=~_|])/ig, function(url) {\r\n          return '<a href=\"' + url + '\">'+url+'</a>';\r\n        }).replace(/B@([_a-z0-9]+)/ig, function(reply) {\r\n          return  reply.charAt(0)+'<a href=\"http://twitter.com/' + reply.substring(1) + '\">' + reply.substring(1) + '</a>';\r\n        });\r\n        container\r\n          .empty()\r\n          .append(jQuery('<p>').append(tweet));\r\n      });\r\n    } \r\n  },\r\n  \r\n  placeAlerts: function (parkCode,jsonSrc,isParkHomepage) {\r\n\t\r\n\tvar dt = new Date().getTime();\r\n\t\r\n    jQuery.getJSON(jsonSrc + '?dt=' + dt, function( data ) { \r\n    \r\n\t\tvar show_alerts = 0;\r\n\t\tvar num_alerts = 0;\r\n\t\tvar danger_count = 0;\r\n\t\tvar closure_count = 0;\r\n\t\tvar window_width = jQuery( window ).width();\r\n\t\tvar danger_exists = 0;\r\n\t\tvar active_alerts = [];\r\n\t\r\n\t\tif ( 'CEDATA' in data ) {\r\n\t\t\t\t\r\n\t\t  if(data.CEDATA.length > 0){ \r\n\t\t  \r\n\t\t\tvar alert_html = \"\";\r\n\t\t\tvar alert_more = \"\";\r\n\t\t\tvar today = new Date();\r\n\t\t\t\r\n\t\t\tactive_alerts = data.CEDATA.filter( function( a ) {\t\t\r\n\r\n\t\t\t\t// if alert structure has no start date key in it, pass it along as is\r\n\t\t\t\tif (typeof a.FIC_start_date == 'undefined'){\r\n\t\t\t\t\treturn a;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Otherwise we have date keys with which to work, so set default start/end times\r\n\t\t\t\tif (a.FIC_start_date.length){\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar start_date  = new Date( a.FIC_start_date.replace( \" \", \"T\" ) );\r\n\t\t\t\t\tstart_date.setHours( 0 );\r\n\t\t\t\t\tstart_date.setMinutes( 0 );\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (a.FIC_end_date.length){\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar end_date  = new Date( a.FIC_end_date.replace( \" \", \"T\" ) );\r\n\t\t\t\t\tend_date.setHours( 23 );\r\n\t\t\t\t\tend_date.setMinutes( 59 );\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Next we return an alert, unless it has a future start date or has already expired\r\n\t\t\t\t\r\n\t\t\t\t// if alert has both start and end dates, check for both future start date and expiration\r\n\t\t\t\tif ( a.FIC_start_date.length && a.FIC_end_date.length ) {\r\n\t\t\t\t\tif ( start_date <= today && end_date >= today ){\r\n\t\t\t\t\t\treturn a;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t// if the alert has only a start date, check for only future start date\r\n\t\t\t\tif ( a.FIC_start_date.length && a.FIC_end_date.length == 0 ) {\r\n\t\t\t\t\tif ( start_date <= today ) {\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn a;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t// if alert has only an end date\r\n\t\t\t\tif ( a.FIC_start_date.length == 0 && a.FIC_end_date.length ) {\r\n\t\t\t\t\tif ( end_date >= today ){\r\n\t\t\t\t\t\treturn a;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t// if there is no start AND no end date, just return it as is\r\n\t\t\t\tif (a.FIC_start_date.length == 0 && a.FIC_end_date.length == 0){\r\n\t\t\t\t\treturn a;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t});\t  \r\n\t\t  \r\n\t\t  num_alerts = active_alerts.length;      \r\n\t\t  \r\n\t\t  jQuery( '#alerts-toggle span.UtilityNav-badge' ).text( num_alerts );\r\n\t\t  if (num_alerts > 0) {\r\n\t\t\tjQuery( '#alerts-toggle span.UtilityNav-badge' ).show();\r\n\t\t  }\r\n\r\n\t\t  alerts_more = '<li class=\"Alert-item\" id=\"alerts-more\">';\r\n\t\t  alerts_more += '<i class=\"fa fa-plus\"></i>';\r\n\t\t  alerts_more += '<div class=\"Alert-itemContent\">';\r\n\t\t  alerts_more += '<a class=\"Alerts-conditions-link\" href=\"/' + parkCode + '/planyourvisit/conditions.htm\" tabindex=\"-1\" />';\r\n\t\t  // this link text gets over-ridden down below, after danger alerts have been prepended. Not sure why. \r\n\t\t  // alerts_more += NPS.utility.getTranslation('additional alerts and conditions information') + '...</a>';\t\r\n\t\t  alerts_more += '</a>';\t\t\t\t\t\r\n\t\t  alerts_more += '</div>';\r\n\t\t  alerts_more += '</li>';\r\n\t\t  \r\n\t\t  // tally up danger and closure counts, set appropriate flag values\r\n\t\t  jQuery.each( active_alerts, function(i, v) {\r\n\t\t\t\r\n\t\t\tswitch (v.FIC_category){\r\n\t\t\t\t\r\n\t\t\t\tcase 'Danger':\r\n\t\t\t\t\tdanger_exists = 1;\r\n\t\t\t\t\tshow_alerts = 1;\r\n\t\t\t\t\tdanger_count = danger_count + 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase 'Park Closure':\r\n\t\t\t\t\tshow_alerts = 1;\r\n\t\t\t\t\tclosure_count = closure_count + 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t  \r\n\t\t  });\r\n\t\t  \r\n\t\t  // sift through all alerts, create HTML output for only the Park Closure alerts \r\n\t\t  jQuery.each( active_alerts, function(i, v) {\t\t\t\t\r\n\t\t\t\r\n\t\t\tif (v.FIC_category == \"Park Closure\") {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\tif ( closure_count == 1 ) {\r\n\t\t\t\t\t\r\n\t\t\t\t  if ( danger_exists == 1 ) {  alert_html += '<hr class=\"Alerts-severity-separator hr clearfix\">'; }\r\n\t\t\t\t  \r\n\t\t\t\t  alert_html += '<div class=\"Alerts-severity-header Alerts-severity-header--closure\">' + NPS.utility.getTranslation(\"Park Closures\") + '</div>';\r\n\t\t\t\t  alert_html += '<ul>';\r\n\t\t\t\t  \r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\talert_html += '<li class=\"Alert-item Alert-closure\">';\r\n\t\t\t\talert_html += '<svg tabindex=\"-1\" aria-hidden=\"true\" class=\"icon\" title=\"' + NPS.utility.getTranslation(\"Alert Level Park Closure\") + '\" role=\"img\">';\r\n\t\t\t\talert_html += '<use tabindex=\"-1\" aria-hidden=\"true\" xlink:href=\"/layout/sprite.symbol.svg#alert-closure\"></use>';\r\n\t\t\t\talert_html += '</svg>';\r\n\t\t\t\talert_html += ' <div class=\"Alert-itemContent\">';\r\n\t\t\t\talert_html += '<h3 tabindex=\"-1\" aria-hidden=\"true\" class=\"Alert-title\">';\r\n\t\t\t\talert_html += decodeURIComponent( v.FIC_title );\r\n\t\t\t\talert_html += '</h3>';\r\n\t\t\t\talert_html += '<a tabindex=\"-1\" href=\"javascript:;\" class=\"screen-reader\" style=\"max-height:0px; overflow: hidden; display:block;\" aria-hidden=\"false\">Alert 1 , Severity ,closure ,,'\r\n\t\t\t\talert_html += decodeURIComponent( v.FIC_title ) + '</a>';\r\n\t\t\t\talert_html += '<span tabindex=\"-1\">';\r\n\t\t\t\talert_html += decodeURIComponent( v.FIC_description );\r\n\t\t\t\t\t  \r\n\t\t\t\tif ( v.FIC_internal_link.length ) {\r\n\t\t\t\t\talert_html += '<br /><a href=\"' + decodeURIComponent( v.FIC_internal_link ) + '\" title=\"' + decodeURIComponent( v.FIC_title ) + '\" class=\"carrot-end\">' + NPS.utility.getTranslation('more') +'</a>';\r\n\t\t\t\t}\r\n\t\t\t\telse if  ( v.FIC_linkURL.length ) {\r\n\t\t\t\t\talert_html += '<br /><a href=\"' + decodeURIComponent( v.FIC_linkURL ) + '\" title=\"' + decodeURIComponent( v.FIC_title ) + '\" class=\"carrot-end\">' + NPS.utility.getTranslation('more') +'</a>';\r\n\t\t\t\t}\r\n\t\t\t\t\t  \r\n\t\t\t\talert_html += '</span>';\r\n\t\t\t\talert_html += '</div>';\r\n\t\t\t\talert_html += '</li>';\r\n\t\t\t\t  \r\n\t\t\t\treturn;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t  });      \r\n\r\n\t\t  // if we have any closure alerts, tack on the alerts_more code, close out the unordered list, then drop in place\r\n\t\t  if ( closure_count > 0 ){\r\n\t\t\talert_html += alerts_more;\r\n\t\t\talert_html += '</ul>';\r\n\t\t\tjQuery( '#Alert-list' ).prepend( alert_html );\r\n\t\t  }\t\t  \r\n\t\t  \r\n\t\t  // reset alert_html value to deal with danger alerts next\r\n\t\t  alert_html = '';\r\n\t\t  \r\n\t\t  // sift through all alerts, build HTML output for only Danger alerts this time\r\n\t\t  jQuery.each( active_alerts, function(i, v) {\r\n\t\t  \r\n\t\t\tif (v.FIC_category == \"Danger\") {\r\n\t\t\t\t\r\n\t\t\t\tif ( danger_count == 1 ) {\r\n\t\t\t\t\t\r\n\t\t\t\t  //alert_html += '<hr class=\"Alerts-severity-separator hr clearfix\">';\r\n\t\t\t\t  alert_html += '<div class=\"Alerts-severity-header Alerts-severity-header--danger\">' + NPS.utility.getTranslation(\"Danger\") + '</div>';\r\n\t\t\t\t  alert_html += '<ul>';\r\n\t\t\t\t  \r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\talert_html += '<li class=\"Alert-item Alert-danger\">';\r\n\t\t\t\t\talert_html += '<svg tabindex=\"-1\" aria-hidden=\"true\" class=\"icon\" title=\"' + NPS.utility.getTranslation(\"Alert Level danger\") + '\" role=\"img\">';\r\n\t\t\t\t\talert_html += '<use tabindex=\"-1\" aria-hidden=\"true\" xlink:href=\"/layout/sprite.symbol.svg#alert-danger\"></use>';\r\n\t\t\t\t\talert_html += '</svg>';\r\n\t\t\t\t\talert_html += ' <div class=\"Alert-itemContent\">';\r\n\t\t\t\t\talert_html += '<h3 tabindex=\"-1\" aria-hidden=\"true\" class=\"Alert-title\">';\r\n\t\t\t\t\talert_html += decodeURIComponent( v.FIC_title );\r\n\t\t\t\t\talert_html += '</h3>';\r\n\t\t\t\t\talert_html += '<a tabindex=\"-1\" href=\"javascript:;\" class=\"screen-reader\" style=\"max-height:0px; overflow: hidden; display:block;\" aria-hidden=\"false\">Alert 1 , Severity ,danger ,,'\r\n\t\t\t\t\talert_html += decodeURIComponent( v.FIC_title ) + '</a>';\r\n\t\t\t\t\talert_html += '<span tabindex=\"-1\">';\r\n\t\t\t\t\talert_html += decodeURIComponent( v.FIC_description );\r\n\t\t\t\t\t  \r\n\t\t\t\t\tif ( v.FIC_internal_link.length ) {\r\n\t\t\t\t\t\talert_html += '<br /><a href=\"' + decodeURIComponent( v.FIC_internal_link ) + '\" title=\"' + decodeURIComponent( v.FIC_title ) + '\" class=\"carrot-end\">' + NPS.utility.getTranslation('more') +'</a>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if  ( v.FIC_linkURL.length ) {\r\n\t\t\t\t\t\talert_html += '<br /><a href=\"' + decodeURIComponent( v.FIC_linkURL ) + '\" title=\"' + decodeURIComponent( v.FIC_title ) + '\" class=\"carrot-end\">' + NPS.utility.getTranslation('more') +'</a>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t  \r\n\t\t\t\talert_html += '</span>';\r\n\t\t\t\talert_html += '</div>';\r\n\t\t\t\talert_html += '</li>';\r\n\t\t\t\t  \r\n\t\t\t\treturn;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t  }); \r\n\r\n\t\t  // if there are danger alerts and no closures, add alerts_more block to end of danger alert html \r\n\t\t  if ( danger_count > 0 && closure_count == 0 ) {\r\n\t\t\talert_html += alerts_more;\t\t\t\r\n\t\t  }\r\n\t\t\t\t\r\n\t\t  // whether we have closures or not, close out danger html unordered list, and drop in place\r\n\t\t  if ( danger_count > 0 ) {\r\n\t\t\talert_html += '</ul>';\r\n\t\t\tjQuery( '#Alert-list' ).prepend( alert_html );\r\n\t\t  }\t  \r\n\r\n\t\t  // dynamically alter text of alert_more link, based on total num vs. what's been shown\r\n\t\t  if ( ( num_alerts - danger_count - closure_count ) > 0 ) {\r\n\t\t\tjQuery( 'a.Alerts-conditions-link' ).text( ( num_alerts - danger_count - closure_count ) + ' ' + NPS.utility.getTranslation('more non-emergency alert notifications') + '...' );\r\n\t\t  }\r\n\t\t  else{\r\n\t\t\tjQuery( 'a.Alerts-conditions-link' ).text( NPS.utility.getTranslation('more information on current conditions...') );  \r\n\t\t  }\r\n\t\t  \r\n\t\t  // if we have danger or closure alerts, make it possible for user to dismiss them by setting a cookie\r\n\t\t  if ( danger_count > 0 || closure_count > 0 ) {\r\n\t\t\t\r\n\t\t\tjQuery( 'a.Alerts-header-dismiss-button' ).on( 'click', function() {\r\n\t\t\t  \r\n\t\t\t  document.cookie = 'alertDismiss' + parkCode + '=1; path=/';\r\n\t\t\t  \r\n\t\t\t});\r\n\t\t  }\r\n\t\t  \r\n\t\t  // retrieve and parse cookie, to see if alerts have already been dismissed\r\n\t\t  var ca = document.cookie.split(';');\r\n\t\t  var alertsAuto = 1;\r\n\t\t  \r\n\t\t  for ( var ci = 0; ci < ca.length; ci++ ) {\r\n\t\t\t\r\n\t\t\tvar c = ca[ ci ];\r\n\t\t\twhile ( c.charAt(0) == ' ' ) c = c.substring( 1 );\r\n\t\t\tif ( c.indexOf( 'alertDismiss' + parkCode + '=' ) != -1 ) {\r\n\t\t\t  alertsAuto = 0;\r\n\t\t\t}\r\n\t\t  }\r\n\t\t  \r\n\t\t  if ( show_alerts == 1 && alertsAuto == 1 ) {\r\n\t\t\t\r\n\t\t\tjQuery( '#alerts-toggle' ).trigger( 'click' );\r\n\t\t\twindow.autoAlertsRunning=true;\r\n\t\t  }\r\n\r\n\t\t  }\r\n\t\t}\r\n\t\t\r\n\t\t// alert icon should always go to conditions page (see NPSWSD-7600)\r\n\t\tjQuery( '#alerts-toggle' ).on( 'click', function() {\t\r\n\t\t\tdocument.location = '/'+parkCode+'/planyourvisit/conditions.htm';\r\n\t\t});\r\n    \r\n\t\t// if we aren't showing alerts, hide the div container for them\r\n\t\tif ( show_alerts == 0 ) {\r\n\t\t  jQuery( '#Alerts-ParkHeader' ).hide();\r\n\t\t}\r\n    \r\n    });   \r\n  }\r\n  \r\n};\r\nNPS.slick = {\r\n  setup: function() {\r\n    jQuery('.responsive').slick({\r\n      dots: true,\r\n      draggable: false,\r\n      infinite: false,\r\n      speed: 300,\r\n      slidesToShow: 3,\r\n      slidesToScroll: 3,\r\n      responsive: [{\r\n        breakpoint: 992,\r\n        settings: {\r\n          dots: true,\r\n          slidesToScroll: 3,\r\n          slidesToShow: 3\r\n        }\r\n      },{\r\n        breakpoint: 768,\r\n        settings: {\r\n          slidesToShow: 2,\r\n          slidesToScroll: 2\r\n        }\r\n      },{\r\n        breakpoint: 600,\r\n        settings: {\r\n          slidesToShow: 1,\r\n          slidesToScroll: 1\r\n        }\r\n      }]\r\n    });\r\n  }\r\n};\r\nNPS.text = {\r\n  // Resizes the container to the width of the child image.\r\n  resizeToImage: function() {\r\n    if (jQuery('.resize-to-image img').length) {\r\n      jQuery.each(jQuery('.resize-to-image'), function(index, val) {\r\n        $this = jQuery(this);\r\n\r\n        $this.children('img').load(function() {\r\n          $this.width($this.children('img').width());\r\n        });\r\n      });\r\n    }\r\n  },\r\n  // Update text controls.\r\n  textSizes: function() {\r\n    var self = this;\r\n\r\n    jQuery('.utils .text-sizes a').click(function() {\r\n      var activeSize = jQuery('.utils .text-sizes .active').parent().attr('class'),\r\n        size = jQuery(this).parent().attr('class');\r\n\r\n      jQuery('.utils .text-sizes a').removeClass('active');\r\n      jQuery(this).addClass('active');\r\n      self.textResize(activeSize, size);\r\n\r\n      if (jQuery('.carousel-list').length) {\r\n        NPS.cycle.setCycleHeight('.carousel-list .row');\r\n      }\r\n    });\r\n  },\r\n  // Resize text by - or + 2 pixels.\r\n  textResize: function(activeSize, size) {\r\n    var value = 0;\r\n\r\n    switch (activeSize) {\r\n    case 'large':\r\n      switch (size) {\r\n      case 'medium':\r\n        value = -2;\r\n        break;\r\n      case 'small':\r\n        value = -4;\r\n        break;\r\n      }\r\n      break;\r\n    case 'medium':\r\n      switch (size) {\r\n      case 'large':\r\n        value = 2;\r\n        break;\r\n      case 'small':\r\n        value = -2;\r\n        break;\r\n      }\r\n      break;\r\n    case 'small':\r\n      switch (size) {\r\n      case 'medium':\r\n        value = 2;\r\n        break;\r\n      case 'large':\r\n        value = 4;\r\n        break;\r\n      }\r\n      break;\r\n    }\r\n\r\n    jQuery.each(NPS.utility.params.resize, function(index, elementType) {\r\n      jQuery(elementType).each(function() {\r\n        var $this = jQuery(this);\r\n\r\n        if (!$this.parents('.bap').length && !$this.parents('.navbar').length) {\r\n          $this.css('font-size', (parseInt(jQuery.trim($this.css('font-size').replace('px', '')), 10) + value) + 'px');\r\n        }\r\n      });\r\n    });\r\n  }\r\n};\r\nNPS.utility = {\r\n  // Global parameters.\r\n  params: {\r\n    resize : [\r\n      'h1',\r\n      'h2',\r\n      'h3',\r\n      'h4',\r\n      'h5',\r\n      'h6',\r\n      'p',\r\n      'ol',\r\n      'ul',\r\n      'dt',\r\n      'dd'\r\n    ],\r\n    preloadChrome: [\r\n      ['/common/commonspot/templates/images/chrome/bg/results.png'],\r\n      ['/common/commonspot/templates/images/chrome/bg/results-bottom.png'],\r\n      ['/common/commonspot/templates/images/chrome/bg/results-top.png'],\r\n      ['/common/commonspot/templates/images/chrome/bg/nav-dd-edges.png']\r\n    ],\r\n    saytId: '277',\r\n\t\ttranslationCache: [],\r\n\t\ttranslationLanguageTags: '',\t\t\t\r\n\t\ttranslationSiteLanguageTag: 'en-us',\t\t\r\n\t\ttranslationSeedLanguageTag: 'en-us'\r\n  },\r\n  // Detect versions of IE.\r\n  getIeVersion: function() {\r\n    if (this.ieVersion === 'undefined') {\r\n      var div = document.createElement('div'),\r\n        all = div.getElementsByTagName('i'),\r\n        v = 3,\r\n        undef;\r\n\r\n      while (\r\n        div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',\r\n        all[0]\r\n      );\r\n\r\n      if (v > 4) {\r\n        this.ieVersion = v;\r\n      } else {\r\n        this.ieVersion = NaN;\r\n      }\r\n    }\r\n    return this.ieVersion;\r\n  },\r\n  // Checks to see if a value is an integer.\r\n  isInt: function(value) {\r\n    if ((parseFloat(value) === parseInt(value, 10)) && !isNaN(value)) {\r\n      return true;\r\n    } else {\r\n      return false;\r\n    }\r\n  },\r\n  pageSetups: function(value) {\r\n    jQuery('#site-map-container').hide();\r\n    jQuery('#sm-control a').removeClass('expanded');\r\n    jQuery('.content-container .utils').css('visibility', 'visible');\r\n    jQuery('.search-control input[type=submit]').hide();\r\n    jQuery('html').removeClass('no-js').addClass('js');\r\n  },\r\n  // Image preload.\r\n  preload: function(arrayOfImages) {\r\n    jQuery(arrayOfImages).each(function() {\r\n      jQuery('<img/>')[0].src = this;\r\n    });\r\n  },\r\n\tinitTranslation: function() {\r\n\t\tvar languageTagList = ['de-de','fr-ca','es-es','zh-hans','ru-ru'];\r\n\t\tvar languageTagListLength = languageTagList.length;\r\n\t\tvar bAltLangSite = false;\r\n\t\tfor (var i = 0; i < languageTagListLength; i++) {\r\n\t\t\tif(window.location.href.indexOf(languageTagList[i]) > -1) {\r\n\t\t\t\tbAltLangSite = true;\r\n\t\t\t\ti = languageTagListLength;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( bAltLangSite ) {\r\n\t\t\tjQuery.ajax({\r\n\t\t\t\turl: \"/customcf/translation/translationJSON.cfm\",\r\n\t\t\t\tdataType: 'json',\r\n\t\t\t\tasync: false,\r\n\t\t\t\tsuccess: function(data) {\r\n\t\t\t\t\tNPS.utility.params.translationCache = data.translationCache;\r\n\t\t\t\t\tNPS.utility.params.translationLanguageTags = data.languageTagList;\r\n\t\t\t\t\tif((typeof commonspot.csPage.subsiteRoot != 'undefined') && (commonspot.csPage.subsiteRoot != \"/\")){\r\n\t\t\t\t\t\tif(NPS.utility.params.translationLanguageTags.indexOf(commonspot.csPage.subsiteRoot.split(\"/\")[1]) >= 0){\r\n\t\t\t\t\t\t\tNPS.utility.params.translationSiteLanguageTag = commonspot.csPage.subsiteRoot.split(\"/\")[1];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t//NPS.utility.params.translationSiteLanguageTag = \"es-es\"; //REMOVE THIS AFTER TESTING -AR\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tgetTranslation:function(txt,languageTag){\t\r\n\t\tif(Object.keys(NPS.utility.params.translationCache).length < 1) NPS.utility.initTranslation();\t\r\n\t\tif (typeof languageTag === 'undefined') languageTag = NPS.utility.params.translationSiteLanguageTag;\r\n\t\tif(languageTag != NPS.utility.params.translationSeedLanguageTag){\r\n\t\t\ttxt = jQuery('<div />').html(txt).text(); //unescape html\r\n\t\t\tif(txt in NPS.utility.params.translationCache && languageTag in NPS.utility.params.translationCache[txt]){\r\n\t\t\t\ttxt = NPS.utility.params.translationCache[txt][languageTag];\r\n\t\t\t\ttxt = jQuery('<div />').text(txt).html(); //escape html\r\n\t\t\t\t/*return \"&#8482; \" + txt;\r\n\t\t\t}else{\r\n\t\t\t\treturn \"&#9524; \" + txt;//UPDATE THIS WHEN DONE*/\r\n\t\t\t}\r\n\t\t}\t\r\n    return txt;\t\r\n\t}\r\n};\r\n\r\nNPS.loadPlugins = function() {\r\n  jQuery.fn.mousehold = function(timeout, f) {\r\n    if (timeout && typeof timeout === 'function') {\r\n      f = timeout;\r\n      timeout = 100;\r\n    }\r\n\r\n    if (f && typeof f === 'function') {\r\n      var fireStep = 0,\r\n        timer = 0;\r\n\r\n      return this.each(function() {\r\n        function clearMousehold() {\r\n          clearInterval(timer);\r\n\r\n          if (fireStep === 1) {\r\n            f.call(this, 1);\r\n          }\r\n\r\n          fireStep = 0;\r\n        }\r\n\r\n        jQuery(this)\r\n          .mousedown(function() {\r\n            var ctr = 0,\r\n              t = this;\r\n\r\n            fireStep = 1;\r\n            timer = setInterval(function() {\r\n              ctr++;\r\n              f.call(t, ctr);\r\n              fireStep = 2;\r\n            }, timeout);\r\n          })\r\n          .mouseout(clearMousehold)\r\n          .mouseup(clearMousehold);\r\n      });\r\n    }\r\n  };\r\n\r\n  \r\n  jQuery.fn.slidebox = function() {\r\n    var slidebox = this,\r\n      open = false,\r\n      originalPosition = slidebox.css('right'),\r\n      boxAnimations;\r\n\r\n    if (Modernizr.cssanimations) {\r\n      boxAnimations = {\r\n        open: function() {\r\n          slidebox.addClass('open');\r\n        },\r\n        close: function() {\r\n          slidebox.removeClass('open');\r\n        }\r\n      };\r\n    } else {\r\n      boxAnimations = {\r\n        open: function() {\r\n          slidebox.animate({\r\n            right: '10px'\r\n          }, 300);\r\n        },\r\n        close: function() {\r\n          slidebox.stop(true).animate({\r\n            right: originalPosition\r\n          }, 100);\r\n        }\r\n      };\r\n    }\r\n\r\n    jQuery(window).scroll(function() {\r\n      var distanceTop = jQuery('#content-bottom').offset().top - jQuery(window).height() - 80;\r\n\r\n      if (jQuery(window).scrollTop() > distanceTop) {\r\n        if (!open) {\r\n          open = true;\r\n          boxAnimations.open();\r\n        }\r\n      } else {\r\n        open = false;\r\n        boxAnimations.close();\r\n      }\r\n    });\r\n    slidebox.find('.close').click(function() {\r\n      jQuery(this).parent().parent().remove();\r\n    });\r\n  };\r\n  /** \r\n   * jQuery split a list into multiple rows or columns\r\n   *   Usage: \r\n   *     jQuery(\".dropdown ul\").splitList(3);\r\n   *     jQuery(\".dropdown ul\").splitList(3, { wrapClass: \"div_class_name\" });\r\n   *     jQuery(\".dropdown ul\").splitList(3, { splitInto: \"div_class_name\" });\r\n   */\r\n  jQuery.fn.splitList = function(n, options) {\r\n    settings = jQuery.extend({\r\n      wrapClass: false,\r\n      splitInto: 'cols'\r\n    }, options);\r\n\r\n    return this.each(function(){\r\n      var intoCols = (settings.splitInto === 'cols'),\r\n        w = '<div' + (settings.wrapClass ? ' class=\"' + settings.wrapClass + '\"' : '' ) + '></div>';\r\n\r\n      jQuerylis = jQuery(this).find('> li');\r\n      jQueryinc = intoCols ? parseInt((jQuerylis.length/n) + (jQuerylis.length % n > 0 ), 10) : n;\r\n\r\n      for (var i = 0; i < (intoCols ? n : Math.ceil(jQuerylis.length/n)); i++) {\r\n        jQuerylis.slice(jQueryinc*i, jQueryinc*(i+1)).wrapAll(w);\r\n      }\r\n    });\r\n  };\r\n\r\n};\r\n\r\nNPS.outdatedModal = {\r\n  display:function() {\r\n    if (document.all && !window.atob && jQuery('#outdated-browser').length) {\r\n      var s='';\r\n      s+='<div class=\"modal-dialog\" role=\"document\" aria-labelledby=\"myModalLabel\">';\r\n      s+='<div class=\"modal-content\">';\r\n      s+='<div class=\"modal-header\">';\r\n      s+='<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">\u00d7</span></button>';\r\n      s+='<h4 class=\"modal-title\" id=\"myModalLabel\">Did you know that your Internet browser is out of date?</h4>';\r\n      s+='</div>';\r\n      s+='<div class=\"modal-body\">';\r\n      s+='<p>To ensure that all features of NPS.gov work as they\\'re supposed to, please upgrade to the latest version of one of these web browsers. Just click on one of the icons to go to the download page for that browser.</p>';\r\n      s+='<ul class=\"browser-links\">';\r\n      s+='<li class=\"browser-link\"><a href=\"https://www.google.com/chrome/\"><div class=\"chrome\"></div>Chrome</a></li>';\r\n      s+='<li class=\"browser-link\"><a href=\"https://www.mozilla.org/en-US/firefox/\"><div class=\"firefox\"></div>Firefox</a></li>';\r\n      s+='<li class=\"browser-link\"><a href=\"http://windows.microsoft.com/en-us/internet-explorer/download-ie\"><div class=\"internet-explorer\"></div>Internet Explorer</a></li>';\r\n      s+='<li class=\"browser-link\"><a href=\"https://www.apple.com/safari/\"><div class=\"safari\"></div>Safari</a></li>';\r\n      s+='<li class=\"browser-link\"><a href=\"https://www.opera.com/\"><div class=\"opera\"></div>Opera</a></li>';\r\n      s+='</ul>';\r\n      s+='<p style=\"font-size: 11px;\">';\r\n      s+='Special note for Internet Explorer users: This site will only be fully functional on version 11 with compatibility mode turned off. If you\\'re using version 11 and seeing this message, compatibility is turned on in your browser. If you need compatibility mode turned on to use other sites or applications, you\\'ll need to use another browser to see the full NPS.gov site.</p>';\r\n      s+='<p><a data-dismiss=\"modal\" aria-label=\"Close\" href=\"javascript:;\">Close This Window</a> *<br/><div style=\"font-size:10px\">* By closing this window, you acknowledge that your experience on this website may be degraded.</div></p>';\r\n      s+='</div>';\r\n      s+='</div>';\r\n      s+='</div>';\r\n      jQuery('#outdated-browser').html(s).modal();\r\n    }\r\n  }\r\n}\r\n\r\n\r\nNPS.globalNav = {\r\n  display:function(featureData) {  \r\n    jQuery.getJSON(\"/layout/headerData.txt\", function(data) {\r\n          \r\n     /* check for dismiss coookie */\r\n     var ca = document.cookie.split(';');\r\n     var promoDismissed = 0;\r\n      \r\n     for ( var ci = 0; ci < ca.length; ci++ ) {     \r\n    var c = ca[ ci ];\r\n    while ( c.charAt(0) == ' ' ) c = c.substring( 1 );\r\n      if ( c.indexOf( 'promoDismissed=' ) != -1 ) {\r\n        promoDismissed = 1;\r\n      }\r\n    }\r\n\r\n    /* render standard global nav */\r\n    var d3=data.navigation;\r\n    // mobile nav\r\n    s3='<li id=\"GlobalNav-mobile\"><ul>';\r\n    s3+='<li class=\"SectionHeader-blue\"><h3>'+NPS.utility.getTranslation('Explore the National Park Service')+'</h3>';\r\n\t/*if(NPS.utility.params.translationLanguageTags.indexOf(commonspot.csPage.subsiteRoot.split(\"/\")[1]) > 0){\r\n\t\ts3+='<p style=\"margin: -4px 0 4px 16px; text-transform:uppercase; font-size:11px; color:#999;\">'+NPS.utility.getTranslation('These links provide information in English only.')+'</p>';\r\n\t}*/\r\n\ts3+='</li>';\r\n    for ( nv = 0; nv < d3.length; nv++ ) {\r\n    s3+='<li class=\"has-sub\"><a href=\"'+d3[nv].link+'\"><span>'+NPS.utility.getTranslation(d3[nv].title)+'</span></a>';  \r\n    \r\n    d4=d3[nv].children;\r\n    s3+='<ul>';\r\n    for ( sb = 0; sb < d4.length; sb++ ) {\r\n      s3+='<li><a href=\"'+d4[sb].link+'\"><span>'+NPS.utility.getTranslation(d4[sb].title)+'</span></a></li>';\r\n    }\r\n    s3+='</ul></li>';\r\n    }\r\n    s3+='</ul></li>'; \r\n    \r\n    // desktop nav\r\n    for ( nv = 0; nv < d3.length; nv++ ) {\r\n    s3+='<li class=\"GlobalNav-desktop '+d3[nv].class+'\"><a href=\"'+d3[nv].link+'\"><span>'+NPS.utility.getTranslation(d3[nv].title)+'</span></a>'; \r\n    \r\n    d4=d3[nv].children;\r\n    s3+='<ul>';\r\n    for ( sb = 0; sb < d4.length; sb++ ) {\r\n      s3+='<li class=\"GlobalNav-lvl-2\"><a href=\"'+d4[sb].link+'\"><span>'+NPS.utility.getTranslation(d4[sb].title)+'</span></a></li>';\r\n    }\r\n    s3+='</ul></li>';\r\n    }\r\n    s3+='<li id=\"globalNavFeature\" style=\"display:none;\" class=\"GlobalNav-desktop GlobalNav-find_your_park\"></li>';\r\n    jQuery(\"ul.GlobalNav\").append(s3);\r\n\r\n      /*  First let's do the dynamic pieces of the global Nav */\r\n\t\t\tif(NPS.utility.params.translationSiteLanguageTag == \"en-us\"){ //only show for english sites\r\n\t\t\t\tvar d=data.globalNavFeature;\r\n\t\t\t\tvar s = ' <a id=\"globalNavFeatureImgLink\" class=\"globalNavFeature\" href=\"'+d.link+'\" title=\"'+NPS.utility.getTranslation(d.altText)+'\">';\r\n          s +='  <img id=\"globalNavFeatureImg\" src=\"'+d.imgSrc+'\" alt=\"'+NPS.utility.getTranslation(d.altText)+'\">';\r\n          s +=' </a>';\r\n          if (d.subtext.length > 0) {\r\n            s +=' <a id=\"globalNavFeatureSubtext\" class=\"globalNavFeature\" title=\"'+NPS.utility.getTranslation(d.subtext)+'\" href=\"'+d.link+'\"><h4>'+NPS.utility.getTranslation(d.subtext)+'</h4></a>';\r\n          }\r\n          s +=' <a id=\"globalNavFeatureCallToAction\" href=\"'+d.link+'\" title=\"'+NPS.utility.getTranslation(d.callToActionText)+'\" class=\"globalNavFeature carrot-end\">'+NPS.utility.getTranslation(d.callToActionText)+'</a>';\r\n\t\t\t\tjQuery(\"li#globalNavFeature\").html(s).css(\"display\",\"\");\r\n\t\t\t}\r\n     \r\n       /* and now the content promo - REMOVED\r\n      var d2=data.contentPromo;\r\n\t  d2.enabled = 0;\r\n\t  \r\n      if (d2.enabled && promoDismissed == 0) {\r\n        s2='<div class=\"container\">';\r\n        s2+='<div class=\"PromoBanner-content\">';\r\n        s2+='<a title=\"'+NPS.utility.getTranslation(d2.imgAlt)+'\" href=\"' + d2.link +'\">';\r\n        s2+='<div class=\"PromoBanner-left\">';\r\n        s2+='<img id=\"PromoBannerImg\" src=\"'+d2.imgSrc+'\" alt=\"'+NPS.utility.getTranslation(d2.imgAlt)+'\">';\r\n        s2+='<div class=\"PromoBanner-divider\"></div>';\r\n        s2+='</div>';\r\n        s2+='<div class=\"PromoBanner-center\">';\r\n        s2+='<h2 class=\"PromoBanner-title\">'+NPS.utility.getTranslation(d2.title)+'</h2>';\r\n        s2+='<span class=\"PromoBanner-cta carrot-end\">'+NPS.utility.getTranslation(d2.subtitle)+'</span>';\r\n        s2+='</div>';\r\n        s2+='</a>';\r\n        s2+='<div class=\"PromoBanner-right\">';\r\n        //can't use data-close=\".PromoBanner\" because that is 'assigned' at load time, so we do onclick inline\r\n        s2+='<button onClick=\"jQuery(\\'div.PromoBanner\\').slideUp(300);NPS.globalNav.setPromoCookie();\"  ><i class=\"fa fa-times-circle\" aria-hidden=\"true\"></i><span class=\"text\"> '+NPS.utility.getTranslation(\"Dismiss\")+' <span class=\"visuallyhidden\">'+NPS.utility.getTranslation(\"Promotion\")+'</span></span></button>';\r\n        s2+='</div>';\r\n        s2+='</div>';\r\n        s2+='</div>';\r\n        s2+='</div>';\r\n        jQuery(\"div.PromoBanner\").html(s2).css(\"display\",\"\");\r\n      }\r\n\t  */\r\n\t  \r\n      /**** NOTE: this code is currently a duplicate of code that is in app.late.min.js - it should probably be removed there ****/\r\n      /**** the reason it's duplicate is because we're populating the global nav w/ ajax now so the timing of assigning click handlers has changed ****/\r\n      /**** BEGIN DUPLICATE CODE FROM APP.MIN.JS ****/\r\n      var mobileNavTopLevelLinks = jQuery('#LocalNav-mobile > ul  > li.has-sub > a, #GlobalNav-mobile > ul > li.has-sub > a');\r\n      mobileNavTopLevelLinks.append('<span class=\"holder\"></span>');\r\n\r\n      var mobileNavLinks = jQuery('#LocalNav-mobile li.has-sub > a, #GlobalNav-mobile li.has-sub > a');\r\n      var mobileNavLinkTexts = jQuery('#LocalNav-mobile ul li.has-sub a > span, #GlobalNav-mobile ul li.has-sub a > span');\r\n      \r\n      /*** remove the click handlers added in app.late.min.js. this is  unique to global.js ***/\r\n      mobileNavLinks.attr('onclick','').unbind('click');\r\n      mobileNavLinkTexts.attr('onclick','').unbind('click');\r\n      \r\n      mobileNavLinks.on('click', function (e) { toggleMobileNavSubMenu(e) });\r\n      mobileNavLinkTexts.on('click', function (e) { followMobileNavLinkText(e) });\r\n\r\n      /* make sure that carets handle appropriately. this is  unique to global.js */\r\n      var holders= jQuery(\"#LocalNav-mobile span.holder, #GlobalNav-mobile span.holder\");\r\n      holders.attr('onclick','').unbind('click');\r\n      holders.on('click', function (e) { toggleMobileNavSubMenu(e) });\r\n\r\n      var toggleMobileNavSubMenu = function (e) {\r\n      //  console.log(\"toggleMobileNavSubMenu2\");\r\n        e.preventDefault();\r\n        var element = jQuery(e.currentTarget).parent('li');\r\n        if (element.hasClass('open')) {\r\n          element.removeClass('open');\r\n          element.find('li').removeClass('open');\r\n          element.find('ul').slideUp();\r\n        } else {\r\n          element.addClass('open');\r\n          element.children('ul').slideDown();\r\n          element.siblings('li').children('ul').slideUp();\r\n          element.siblings('li').removeClass('open');\r\n          element.siblings('li').find('li').removeClass('open');\r\n          element.siblings('li').find('ul').slideUp();\r\n        }\r\n      }\r\n\r\n      var followMobileNavLinkText = function (e) {\r\n    //    console.log(\"followMobileNavLinkText\");\r\n        e.stopPropagation();\r\n        window.location.href = jQuery(e.currentTarget).parent('a').attr('href');\r\n      }\r\n      /**** END DUPLICATE CODE FROM APP.MIN.JS ****/\r\n      \r\n      /*** hide blue bar if there is no park menu ***/\r\n      if (jQuery(\"#LocalNav-mobile li.has-sub > a\").length ==0) {\r\n        jQuery(\"li#GlobalNav-mobile li.SectionHeader-blue\").css('border-top','none');\r\n      }\r\n\r\n    });\r\n  },\r\n  setPromoCookie: function() {\r\n  document.cookie = 'promoDismissed=1; expires=0; path=/';\r\n  }\r\n}\r\n\r\n/* Global Alert Message for entire NPS Website */\r\nNPS.globalAlert = {\r\n\r\n  display:function() {\t  \r\n\t\t\r\n\t\tvar s = document.body.firstChild;\r\n\t\tvar alertDiv = document.createElement('div');\t\t\r\n\t\talertDiv.className = 'ShutdownBanner';\r\n\t\t\r\n\t\tvar bannerContent = '';\r\n\t\tbannerContent += '<div class=\"container\"><div class=\"row\"><div class=\"ShutdownBanner__Icon col-xs-1\">';\r\n\t\tbannerContent += '<svg width=\"30px\" height=\"30px\" viewBox=\"0 0 30 30\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">';\r\n\t\tbannerContent += '<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">';\r\n\t\tbannerContent += '<g id=\"HomePages-1\" transform=\"translate(-338.000000, -34.000000)\" fill=\"#FFFFFF\">';\r\n\t\tbannerContent += '<g id=\"report\" transform=\"translate(338.000000, 34.000000)\">';\r\n\t\tbannerContent += '<path d=\"M21.0497238,0 L8.78453039,0 L0,8.68611111 L0,20.9777778 L8.78453039,29.5 L21.2154696,29.5 L30,20.8138889 L30,8.68611111 L21.0497238,0 L21.0497238,0 Z M14.9171271,23.4361111 C13.7569061,23.4361111 12.7624309,22.4527778 12.7624309,21.3055556 C12.7624309,20.1583333 13.7569061,19.175 14.9171271,19.175 C16.0773481,19.175 17.0718232,20.1583333 17.0718232,21.3055556 C17.0718232,22.4527778 16.0773481,23.4361111 14.9171271,23.4361111 L14.9171271,23.4361111 Z M16.5745856,16.3888889 L13.2596685,16.3888889 L13.2596685,6.55555556 L16.5745856,6.55555556 L16.5745856,16.3888889 L16.5745856,16.3888889 Z\" id=\"Shape\"></path>';\r\n\t\tbannerContent += '</g></g></g></svg>';\r\n\t\tbannerContent += '</div><div class=\"col-xs-10\">';\r\n\t\tbannerContent += '<h4 class=\"ShutdownBanner__Heading\">Resuming Operations</h2>';\r\n\t\tbannerContent += '<div class=\"ShutdownBanner__Description\">With the enactment of the continuing resolution, the National Park Service is preparing to resume regular operations though the schedule for individual parks may vary depending on staff size and complexity of operations. Many parks which have been accessible throughout the lapse in appropriations remain accessible with basic services. Visitors should contact individual parks or visit park websites for the latest information opening schedules and accessibility and visitor services. Some parks which have been closed throughout the lapse in appropriations may not reopen immediately.</div>';\r\n\t\tbannerContent += '</div></div></div>';\r\n\t\t\r\n\t\talertDiv.innerHTML = bannerContent;\r\n\t\t\r\n\t\ts.parentNode.insertBefore( alertDiv, s );\r\n\t  \r\n  }\r\n  \r\n}\r\n\r\njQuery(document).ready(function() {\r\n\t\t\r\n  /*\r\n  NPS.utility.pageSetups();\r\n\r\n  if (jQuery('#search-results-container').length) {\r\n    NPS.utility.preload(NPS.utility.params.preloadChrome);\r\n  }\r\n\r\n  NPS.loadPlugins();\r\n  NPS.text.resizeToImage();\r\n\r\n  if (navigator.userAgent.toLowerCase().indexOf('chrome') >= 0) {\r\n    jQuery('#global-search').attr('autocomplete', 'off'); \r\n  }\r\n\r\n  NPS.display.wrapdldt();\r\n  NPS.display.reviewShow();\r\n  NPS.display.resultAlert();\r\n  NPS.display.tabsSetup();\r\n  NPS.display.alert();\r\n  NPS.text.textSizes();\r\n  NPS.newContent.webcamLink();\r\n  NPS.newContent.moreLinks();\r\n  NPS.newContent.getTweets(\"CivilWarReportr\", 1, jQuery('#tweet'));\r\n  NPS.newContent.addPrintLink();\r\n  NPS.forms.searchDropdown();\r\n  NPS.forms.liveSearch();\r\n  NPS.forms.placeholder();\r\n  NPS.forms.sortBySubmit();\r\n  // NPS.cycle.bapSlider();\r\n  //NPS.cycle.carousel();\r\n  NPS.lightbox.lightbox();\r\n  NPS.lightbox.rateBtn();\r\n  NPS.lightbox.eventDetails();\r\n  //NPS.modals.init();\r\n  NPS.gallery.tooltip();\r\n  NPS.gallery.photoGallery();\r\n \r\n  //NPS.slick.setup();\r\n  \r\n  if (jQuery('#slidebox').length) {\r\n    jQuery('#slidebox').slidebox();\r\n  }\r\n\r\n  if (jQuery('#alert-box').text() === '') {\r\n    jQuery('#alert-box').text('There are park alerts in effect.');\r\n  }\r\n  */\r\n  NPS.display.transcriptControls();\r\n\r\n  if(jQuery('.breadcrumbSourceContainer').length){\r\n    NPS.display.populateBreadcrumbs();\r\n  } //after 30 days, this can go away. aR 7/25/2018  \r\n  \r\n  //NPS.display.displayAnniversaryBanner();\r\n  \r\n  NPS.globalNav.display();\r\n\r\n  NPS.outdatedModal.display();\r\n  \r\n  // NPS.globalAlert.display();\r\n    \r\n    // Translate date of \"Last Updated:\" line on Spanish sites\r\n    if (window.location.href.indexOf(\"es-es\") > -1) {\r\n        var date_last_mod_text = jQuery(\"p:contains('\u00daltima actualizaci\u00f3n:')\").text();\r\n        date_last_mod_text = date_last_mod_text.replace(\",\",\"\");\r\n        var res = date_last_mod_text.split(\" \");\r\n        var new_date_last_mod = res[0]+\" \"+res[1]+\" \"+res[3]+\" de \"+NPS.utility.getTranslation(res[2])+\" del \"+res[4];\r\n        jQuery(\"p:contains('\u00daltima actualizaci\u00f3n:')\").text(new_date_last_mod);\r\n    }\r\n\r\n});\r\n\r\n/* CFI WebMon Script */\r\n(function() {\t\r\n\t// if we're on public web server, load the cfi group script\r\n\tif (document.location.hostname === \"www.nps.gov\"){\r\n\t\tvar a = document.createElement('script');\r\n\t\ta.type = 'text/javascript';\r\n\t\ta.async = true;\r\n\t\tvar url = '//cdnmon.cfigroup.com/source/webmon/69cae42e7d1066/webmon.js';\r\n\t\tvar https = document.URL.indexOf('https');\r\n\t\tif (https != -1) { \r\n\t\turl =  url.replace('http://', 'https://');\r\n\t\t}\r\n\t\ta.src = url;\r\n\t\tvar b = document.getElementsByTagName('script')[0];\r\n\t\tb.parentNode.insertBefore(a, b);\r\n\t}\r\n})();\r\n", "content_type": "application/javascript", "method": "GET", "host": "52.149.222.62", "path": "/layout/js/global.js", "header": {"accept_ranges": "bytes", "content_length": "74693", "content_security_policy": "default-src https 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' www.nps.gov www.googletagmanager.com www.google-analytics.com; connect-src 'self' https://www.google-analytics.com/; style-src 'self' 'unsafe-inline'; font-src 'self' fonts.gstatic.com; img-src 'self' data:;", "content_type": "application/javascript", "date": "Thu, 02 May 2024 08:15:56 GMT", "etag": "\"eea4280c673d61:0\"", "last_modified": "Sun, 16 Aug 2020 12:08:49 GMT", "server": "Microsoft-IIS/10.0", "strict_transport_security": "max-age=31536000; includeSubDomains; preload", "x_content_type_options": "nosniff", "x_frame_options": "deny", "x_xss_protection": "1;mode=block"}, "raw_header": "HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Length: 74693\r\nAccept-Ranges: bytes\r\nContent-Security-Policy: default-src https 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' www.nps.gov www.googletagmanager.com www.google-analytics.com; connect-src 'self' https://www.google-analytics.com/; style-src 'self' 'unsafe-inline'; font-src 'self' fonts.gstatic.com; img-src 'self' data:;\r\nContent-Type: application/javascript\r\nDate: Thu, 02 May 2024 08:15:56 GMT\r\nEtag: \"eea4280c673d61:0\"\r\nLast-Modified: Sun, 16 Aug 2020 12:08:49 GMT\r\nServer: Microsoft-IIS/10.0\r\nStrict-Transport-Security: max-age=31536000; includeSubDomains; preload\r\nX-Content-Type-Options: nosniff\r\nX-Frame-Options: deny\r\nX-Xss-Protection: 1;mode=block\r\n\r\n", "request": "GET /layout/js/global.js HTTP/1.1\r\nHost: smokiespermits.nps.gov\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.2151.97\r\nAccept-Charset: utf-8\r\nAccept-Encoding: gzip\r\n\r\n", "time": "463.832607ms", "a": ["52.149.222.62"], "words": 13653, "lines": 2038, "status_code": 200, "content_length": 74693, "failed": false, "header-dict": {"connection": "close", "content-length": "74693", "accept-ranges": "bytes", "content-security-policy": "default-src https 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' www.nps.gov www.googletagmanager.com www.google-analytics.com; connect-src 'self' https://www.google-analytics.com/; style-src 'self' 'unsafe-inline'; font-src 'self' fonts.gstatic.com; img-src 'self' data:;", "content-type": "application/javascript", "date": "Thu, 02 May 2024 08:15:56 GMT", "etag": "\"eea4280c673d61:0\"", "last-modified": "Sun, 16 Aug 2020 12:08:49 GMT", "server": "Microsoft-IIS/10.0", "strict-transport-security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", "x-frame-options": "deny", "x-xss-protection": "1;mode=block"}}, "web_spider_distance": 1, "scope_distance": 0, "scan": "SCAN:ece9675afde8fc294d4fca36ad4eebe827311aa6", "timestamp": 1714630557.470481, "resolved_hosts": ["52.149.222.62"], "source": "URL:2e070e2bd5675f9acb5b3257df7e77c2ef4f5435", "tags": ["endpoint", "ip-52-149-222-62", "in-scope", "cloud-azure", "status-200", "extension-js"], "module": "httpx", "module_sequence": "httpx"}

{"type": "URL", "id": "URL:2e070e2bd5675f9acb5b3257df7e77c2ef4f5435", "data": "https://smokiespermits.nps.gov/layout/js/global.js", "web_spider_distance": 1, "scope_distance": 0, "scan": "SCAN:ece9675afde8fc294d4fca36ad4eebe827311aa6", "timestamp": 1714630557.469934, "resolved_hosts": ["52.149.222.62"], "source": "URL:e8b9531dcbd7ab372b49adac87a950cd2c7733d7", "tags": ["ip-52-149-222-62", "endpoint", "in-scope", "cloud-azure", "status-200", "extension-js"], "module": "httpx", "module_sequence": "gowitness->httpx"}

@amiremami amiremami added the bug Something isn't working label May 7, 2024
@liquidsec
Copy link
Collaborator

Hey @amiremami , were you running paramminer on that scan?

@amiremami
Copy link
Contributor Author

Hey : ) Yes, here is my debug.log if it's useful.
debug.log

@stryker2k2
Copy link
Collaborator

stryker2k2 commented May 9, 2024

I am just glancing quickly to see where I would start on his adventure.

Are you thinking that, for the first line "HTTP_RESPONSE" in the first snippet, that the url of "https://irmaservices.nps.gov/arcgis/rest/%E2%80%9Dhttps:/www.nps.gov/lib/bootstrap/3.3.2/css/nps-bootstrap.min.css%22" is the wrong format?

If so, then... yes... I would agree.

After throwing that string into a URL Decoder, I get...

"https://irmaservices.nps.gov/arcgis/rest/”https:/www.nps.gov/lib/bootstrap/3.3.2/css/nps-bootstrap.min.css""

The URL Encoded string of %E2%80%9D and %22 are both equivilant to ". So, either we need to account for that on our end. or there is something fishy with your bbot -t target.txt text file. But, that's just me glancing at this and thinking out loud.

Has it happened since? Do you have a debug.log that correlates with those snippets? I tried grepping through that debug.log but I couldn't find %E2%80%9D anywhere.

After thought (thanks to Paul):
The "module_sequence" is "httpx"... so that concatenation of those urls would be on our side. I'll dive into it.

@amiremami
Copy link
Contributor Author

@stryker2k2 thank you so much 🙏 You can find these in output.ndjson which I uploaded here:

https://drive.proton.me/urls/8KTKPZ8D04#MNYh5yfHn2IM

@TheTechromancer
Copy link
Collaborator

TheTechromancer commented May 13, 2024

This may be a symptom of the recursive decoding we're doing prior to URL excavation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants