var $j=jQuery.noConflict();
var volcanoes2 =
{"type":"Topology","arcs":[],"objects":{"volcanoes":{"type":"GeometryCollection","geometries":[
    {"type":"Point","coordinates":[-121.852446,48.76446], "properties": {"name": "Mount Baker"}},
    {"type":"Point","coordinates":[-121.112838,48.114517], "properties": {"name": "Glacier Peak"}},
    {"type":"Point","coordinates":[-121.756943,46.852669], "properties": {"name": "Mount Rainier"}},
    {"type":"Point","coordinates":[-122.188323,46.198372], "properties": {"name": "Mount St. Helens"}},
    {"type":"Point","coordinates":[-121.493611,46.204603], "properties": {"name": "Mount Adams"}}
]}}};

var volcanoes = [[{"Volcano":"Glacier Peak","Category":"Be Prepared","Agency":"Washington Geology Survey","Description":"Emergency Preparedness","ResourceLink":"http://www.dnr.wa.gov/programs-and-services/geology/geologic-hazards/emergency-preparedness","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/dnr.png","LogoLink":"http://www.dnr.wa.gov/programs-and-services/geology/geologic-hazards/emergency-preparedness"},
    {"Volcano":"Mount Adams","Category":"Be Prepared","Agency":"Washington Geology Survey","Description":"Emergency Preparedness","ResourceLink":"http://www.dnr.wa.gov/programs-and-services/geology/geologic-hazards/emergency-preparedness","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/dnr.png","LogoLink":"http://www.dnr.wa.gov/programs-and-services/geology/geologic-hazards/emergency-preparedness"},
    {"Volcano":"Mount Adams","Category":"Be Prepared","Agency":"Skamania County","Description":"Emergency Preparedness","ResourceLink":"http://www.skamania-dem.org/Preparedness.html","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/skamania_county.png","LogoLink":"http://www.skamania-dem.org/Preparedness.html"},
    {"Volcano":"Mount Baker","Category":"Be Prepared","Agency":"Washington Geology Survey","Description":"Emergency Preparedness","ResourceLink":"http://www.dnr.wa.gov/programs-and-services/geology/geologic-hazards/emergency-preparedness","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/dnr.png","LogoLink":"http://www.dnr.wa.gov/programs-and-services/geology/geologic-hazards/emergency-preparedness"},
    {"Volcano":"Mount Rainier","Category":"Be Prepared","Agency":"Washington Geology Survey","Description":"Emergency Preparedness","ResourceLink":"http://www.dnr.wa.gov/programs-and-services/geology/geologic-hazards/emergency-preparedness","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/dnr.png","LogoLink":"http://www.dnr.wa.gov/programs-and-services/geology/geologic-hazards/emergency-preparedness"},
    {"Volcano":"Mount St. Helens","Category":"Be Prepared","Agency":"Washington Geology Survey","Description":"Emergency Preparedness","ResourceLink":"http://www.dnr.wa.gov/programs-and-services/geology/geologic-hazards/emergency-preparedness","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/dnr.png","LogoLink":"http://www.dnr.wa.gov/programs-and-services/geology/geologic-hazards/emergency-preparedness"},
    {"Volcano":"Mount St. Helens","Category":"Be Prepared","Agency":"Skamania County","Description":"Emergency Preparedness","ResourceLink":"http://www.skamania-dem.org/Preparedness.html","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/skamania_county.png","LogoLink":"http://www.skamania-dem.org/Preparedness.html"},
    {"Volcano":"Mount St. Helens","Category":"Be Prepared","Agency":"Lewis County","Description":"Emergency Preparedness","ResourceLink":"http://lewiscountywa.gov/emergency-preparedness","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/lewis_county.png","LogoLink":"http://lewiscountywa.gov/emergency-preparedness"},
    {"Volcano":"Mount Baker","Category":"Be Prepared","Agency":"Washington State Emergency Management Division","Description":"Emergency Preparedness","ResourceLink":"http://mil.wa.gov/emergency-management-division/preparedness/personal","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/waemd.png","LogoLink":"http://mil.wa.gov/emergency-management-division/preparedness/personal"},
    {"Volcano":"Glacier Peak","Category":"Be Prepared","Agency":"Washington State Emergency Management Division","Description":"Emergency Preparedness","ResourceLink":"http://mil.wa.gov/emergency-management-division/preparedness/personal","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/waemd.png","LogoLink":"http://mil.wa.gov/emergency-management-division/preparedness/personal"},
    {"Volcano":"Mount Rainier","Category":"Be Prepared","Agency":"Washington State Emergency Management Division","Description":"Emergency Preparedness","ResourceLink":"http://mil.wa.gov/emergency-management-division/preparedness/personal","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/waemd.png","LogoLink":"http://mil.wa.gov/emergency-management-division/preparedness/personal"},
    {"Volcano":"Mount St. Helens","Category":"Be Prepared","Agency":"Washington State Emergency Management Division","Description":"Emergency Preparedness","ResourceLink":"http://mil.wa.gov/emergency-management-division/preparedness/personal","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/waemd.png","LogoLink":"http://mil.wa.gov/emergency-management-division/preparedness/personal"},
    {"Volcano":"Mount Adams","Category":"Be Prepared","Agency":"Washington State Emergency Management Division","Description":"Emergency Preparedness","ResourceLink":"http://mil.wa.gov/emergency-management-division/preparedness/personal","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/waemd.png","LogoLink":"http://mil.wa.gov/emergency-management-division/preparedness/personal"},
    {"Volcano":"Mount Baker","Category":"Be Prepared","Agency":"American Red Cross","Description":"Emergency Preparedness","ResourceLink":"http://www.redcross.org/get-help/prepare-for-emergencies/be-red-cross-ready","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/red_cross.png","LogoLink":"http://www.redcross.org/get-help/prepare-for-emergencies/be-red-cross-ready"},
    {"Volcano":"Glacier Peak","Category":"Be Prepared","Agency":"American Red Cross","Description":"Emergency Preparedness","ResourceLink":"http://www.redcross.org/get-help/prepare-for-emergencies/be-red-cross-ready","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/red_cross.png","LogoLink":"http://www.redcross.org/get-help/prepare-for-emergencies/be-red-cross-ready"},
    {"Volcano":"Mount Rainier","Category":"Be Prepared","Agency":"American Red Cross","Description":"Emergency Preparedness","ResourceLink":"http://www.redcross.org/get-help/prepare-for-emergencies/be-red-cross-ready","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/red_cross.png","LogoLink":"http://www.redcross.org/get-help/prepare-for-emergencies/be-red-cross-ready"},
    {"Volcano":"Mount St. Helens","Category":"Be Prepared","Agency":"American Red Cross","Description":"Emergency Preparedness","ResourceLink":"http://www.redcross.org/get-help/prepare-for-emergencies/be-red-cross-ready","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/red_cross.png","LogoLink":"http://www.redcross.org/get-help/prepare-for-emergencies/be-red-cross-ready"},
    {"Volcano":"Mount Adams","Category":"Be Prepared","Agency":"American Red Cross","Description":"Emergency Preparedness","ResourceLink":"http://www.redcross.org/get-help/prepare-for-emergencies/be-red-cross-ready","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/red_cross.png","LogoLink":"http://www.redcross.org/get-help/prepare-for-emergencies/be-red-cross-ready"},
    {"Volcano":"Mount St. Helens","Category":"Be Prepared","Agency":"U.S. Geological Survey","Description":"Emergency Preparedness","ResourceLink":"https://volcanoes.usgs.gov/vhp/preparedness.html","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"https://volcanoes.usgs.gov/vhp/preparedness.html"},
    {"Volcano":"Mount Baker","Category":"Be Prepared","Agency":"U.S. Geological Survey","Description":"Emergency Preparedness","ResourceLink":"https://volcanoes.usgs.gov/vhp/preparedness.html","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"https://volcanoes.usgs.gov/vhp/preparedness.html"},
    {"Volcano":"Mount Rainier","Category":"Be Prepared","Agency":"U.S. Geological Survey","Description":"Emergency Preparedness","ResourceLink":"https://volcanoes.usgs.gov/vhp/preparedness.html","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"https://volcanoes.usgs.gov/vhp/preparedness.html"},
    {"Volcano":"Mount Adams","Category":"Be Prepared","Agency":"U.S. Geological Survey","Description":"Emergency Preparedness","ResourceLink":"https://volcanoes.usgs.gov/vhp/preparedness.html","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"https://volcanoes.usgs.gov/vhp/preparedness.html"},
    {"Volcano":"Glacier Peak","Category":"Be Prepared","Agency":"U.S. Geological Survey","Description":"Emergency Preparedness","ResourceLink":"https://volcanoes.usgs.gov/vhp/preparedness.html","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"https://volcanoes.usgs.gov/vhp/preparedness.html"}],

    [{"Volcano":"Glacier Peak","Category":"Get Notified","Agency":"Snohomish County","Description":"Alert Notification System","ResourceLink":"http://public.alertsense.com/SignUp/?regionID=1129","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/snohomish_county.png","LogoLink":"http://snohomishcountywa.gov/180/Emergency-Management"},
        {"Volcano":"Glacier Peak","Category":"Get Notified","Agency":"U.S. Geological Survey","Description":"Alert Notification System","ResourceLink":"http://volcanoes.usgs.gov/observatories/cvo/cvo_volcano_updates.html ","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://volcanoes.usgs.gov/observatories/cvo/cvo_volcano_updates.html"},
        {"Volcano":"Mount Adams","Category":"Get Notified","Agency":"U.S. Geological Survey","Description":"Alert Notification System","ResourceLink":"http://volcanoes.usgs.gov/observatories/cvo/cvo_volcano_updates.html ","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://volcanoes.usgs.gov/observatories/cvo/cvo_volcano_updates.html"},
        {"Volcano":"Mount Adams","Category":"Get Notified","Agency":"Yakima County","Description":"Alert Notification System","ResourceLink":"https://member.everbridge.net/index/453003085612758#/login","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/yakima_county.png","LogoLink":"https://member.everbridge.net/index/453003085612758#/login"},
        {"Volcano":"Mount Baker","Category":"Get Notified","Agency":"U.S. Geological Survey","Description":"Alert Notification System","ResourceLink":"http://volcanoes.usgs.gov/observatories/cvo/cvo_volcano_updates.html ","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://volcanoes.usgs.gov/observatories/cvo/cvo_volcano_updates.html"},
        {"Volcano":"Mount Rainier","Category":"Get Notified","Agency":"U.S. Geological Survey","Description":"Alert Notification System","ResourceLink":"http://volcanoes.usgs.gov/observatories/cvo/cvo_volcano_updates.html ","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://volcanoes.usgs.gov/observatories/cvo/cvo_volcano_updates.html"},
        {"Volcano":"Mount St. Helens","Category":"Get Notified","Agency":"U.S. Geological Survey","Description":"Alert Notification System","ResourceLink":"http://volcanoes.usgs.gov/observatories/cvo/cvo_volcano_updates.html ","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://volcanoes.usgs.gov/observatories/cvo/cvo_volcano_updates.html"},
        {"Volcano":"Mount Adams","Category":"Get Notified","Agency":"Klickitat County","Description":"Alert Notification System","ResourceLink":"https://member.everbridge.net/index/1772417038942633#/login","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/klickitat_county.png","LogoLink":"https://member.everbridge.net/index/1772417038942633#/login"},
        {"Volcano":"Glacier Peak","Category":"Get Notified","Agency":"Skagit County","Description":"Emergency Alert Registration","ResourceLink":"https://mystateusa.com/alertSignup.aspx?region=1157","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/skagit_county.png","LogoLink":"https://mystateusa.com/alertSignup.aspx?region=1157"},
        {"Volcano":"Mount Baker","Category":"Get Notified","Agency":"Skagit County","Description":"Emergency Alert Registration","ResourceLink":"https://mystateusa.com/alertSignup.aspx?region=1157","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/skagit_county.png","LogoLink":"https://mystateusa.com/alertSignup.aspx?region=1157"},
        {"Volcano":"Mount Baker","Category":"Get Notified","Agency":"Whatcom Unified Emergency Management","Description":"Public Emergency Alert","ResourceLink":"http://www.whatcomready.org/public-alerts/","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/whatcom_unified.png","LogoLink":"http://www.whatcomready.org/public-alerts/"},
        {"Volcano":"Mount Rainier","Category":"Get Notified","Agency":"King County","Description":"Regional Public Information & Notification","ResourceLink":"http://www.kingcounty.gov/safety/prepare/RPIN.aspx","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/king_county.png","LogoLink":"http://www.kingcounty.gov/safety/prepare/RPIN.aspx"},
        {"Volcano":"Mount Rainier","Category":"Get Notified","Agency":"Pierce County","Description":"Pierce County Alert","ResourceLink":"http://www.co.pierce.wa.us/index.aspx?nid=921","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/pierce_county.png","LogoLink":"http://www.co.pierce.wa.us/index.aspx?nid=921"},
        {"Volcano":"Mount Rainier","Category":"Get Notified","Agency":"City of Tacoma","Description":"Alert Notification System","ResourceLink":"https://tacomawa.my.gov-i.com/signup","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/city_of_tacoma.png","LogoLink":"https://tacomawa.my.gov-i.com/signup"}],



    [{"Volcano":"Mount Baker","Category":"Get the Facts","Agency":"U.S. Geological Survey","Description":"Fact Sheet","ResourceLink":"http://mil.wa.gov/uploads/pdf/emergency-management/volcano/mtbaker.pdf","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://mil.wa.gov/uploads/pdf/emergency-management/volcano/mtbaker.pdf"},
        {"Volcano":"Mount Rainier","Category":"Get the Facts","Agency":"U.S. Geological Survey","Description":"Fact Sheet","ResourceLink":"http://mil.wa.gov/uploads/pdf/emergency-management/volcano/mtrainier.pdf","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://mil.wa.gov/uploads/pdf/emergency-management/volcano/mtrainier.pdf"},
        {"Volcano":"Mount Rainier","Category":"Get the Facts","Agency":"Pierce County","Description":"Hazard Maps","ResourceLink":"http://www.co.pierce.wa.us/index.aspx?NID=3800","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/pierce_county.png","LogoLink":"http://www.co.pierce.wa.us/index.aspx?NID=3800"},
        {"Volcano":"Glacier Peak","Category":"Get the Facts","Agency":"Pacific Northwest Seismic Network","Description":"Recent Seismicity","ResourceLink":"https://www.pnsn.org/volcanoes/glacier-peak","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/pnsn.png","LogoLink":"https://www.pnsn.org/volcanoes/glacier-peak"},
        {"Volcano":"Mount Adams","Category":"Get the Facts","Agency":"Pacific Northwest Seismic Network","Description":"Recent Seismicity","ResourceLink":"https://www.pnsn.org/volcanoes/mount-adams","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/pnsn.png","LogoLink":"https://www.pnsn.org/volcanoes/mount-adams"},
        {"Volcano":"Mount Baker","Category":"Get the Facts","Agency":"Pacific Northwest Seismic Network","Description":"Recent Seismicity","ResourceLink":"https://www.pnsn.org/volcanoes/mount-baker","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/pnsn.png","LogoLink":"https://www.pnsn.org/volcanoes/mount-baker"},
        {"Volcano":"Mount Rainier","Category":"Get the Facts","Agency":"Pacific Northwest Seismic Network","Description":"Recent Seismicity","ResourceLink":"https://www.pnsn.org/volcanoes/mount-rainier","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/pnsn.png","LogoLink":"https://www.pnsn.org/volcanoes/mount-rainier"},
        {"Volcano":"Mount St. Helens","Category":"Get the Facts","Agency":"Pacific Northwest Seismic Network","Description":"Recent Seismicity","ResourceLink":"https://www.pnsn.org/volcanoes/mount-st-helens","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/pnsn.png","LogoLink":"https://www.pnsn.org/volcanoes/mount-st-helens"},
        {"Volcano":"Glacier Peak","Category":"Get the Facts","Agency":"U.S. Geological Survey","Description":"Simplified Hazard Map","ResourceLink":"http://volcanoes.usgs.gov/vsc/images/image_mngr/1100-1199/img1125_900w_613h.jpg","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://volcanoes.usgs.gov/vsc/images/image_mngr/1100-1199/img1125_900w_613h.jpg"},
        {"Volcano":"Mount Adams","Category":"Get the Facts","Agency":"U.S. Geological Survey","Description":"Simplified Hazard Map","ResourceLink":"http://volcanoes.usgs.gov/vsc/images/image_mngr/1100-1199/img1124_900w_611h.jpg","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://volcanoes.usgs.gov/vsc/images/image_mngr/1100-1199/img1124_900w_611h.jpg"},
        {"Volcano":"Mount Baker","Category":"Get the Facts","Agency":"U.S. Geological Survey","Description":"Simplified Hazard Map","ResourceLink":"http://volcanoes.usgs.gov/vsc/images/image_mngr/1100-1199/img1106.jpg","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://volcanoes.usgs.gov/vsc/images/image_mngr/1100-1199/img1106.jpg"},
        {"Volcano":"Mount Rainier","Category":"Get the Facts","Agency":"U.S. Geological Survey","Description":"Simplified Hazard Map","ResourceLink":"http://volcanoes.usgs.gov/vsc/images/image_mngr/300-399/img350.jpg","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://volcanoes.usgs.gov/vsc/images/image_mngr/300-399/img350.jpg"},
        {"Volcano":"Mount St. Helens","Category":"Get the Facts","Agency":"U.S. Geological Survey","Description":"Simplified Hazard Map","ResourceLink":"http://volcanoes.usgs.gov/vsc/images/image_mngr/1000-1099/img1003_900w_609h.jpg","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://volcanoes.usgs.gov/vsc/images/image_mngr/1000-1099/img1003_900w_609h.jpg"},
        {"Volcano":"Glacier Peak","Category":"Get the Facts","Agency":"Skagit County","Description":"Volcano Information","ResourceLink":"http://www.skagitcounty.net/Departments/EmergencyManagement/volcano.htm","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/skagit_county.png","LogoLink":"http://www.skagitcounty.net/Departments/EmergencyManagement/volcano.htm"},
        {"Volcano":"Mount Baker","Category":"Get the Facts","Agency":"Skagit County","Description":"Volcano Information","ResourceLink":"http://www.skagitcounty.net/Departments/EmergencyManagement/volcano.htm","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/skagit_county.png","LogoLink":"http://www.skagitcounty.net/Departments/EmergencyManagement/volcano.htm"},
        {"Volcano":"Mount Baker","Category":"Get the Facts","Agency":"Whatcom County","Description":"Volcano Information","ResourceLink":"http://whatcomcounty.us/2030/Volcano","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/whatcom_county.png","LogoLink":"http://whatcomcounty.us/2030/Volcano"},
        {"Volcano":"Glacier Peak","Category":"Get the Facts","Agency":"U.S. Geological Survey","Description":"Fact Sheet","ResourceLink":"http://pubs.usgs.gov/fs/2000/fs058-00/","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://pubs.usgs.gov/fs/2000/fs058-00/"},
        {"Volcano":"Mount St. Helens","Category":"Get the Facts","Agency":"U.S. Geological Survey","Description":"Fact Sheet","ResourceLink":"https://pubs.er.usgs.gov/publication/fs20133014","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"https://pubs.er.usgs.gov/publication/fs20133014"}],

    [{"Volcano":"Mount Rainier","Category":"Evacuate","Agency":"Pierce County","Description":"Evacuation Routes","ResourceLink":"http://www.co.pierce.wa.us/index.aspx?NID=3814","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/pierce_county.png","LogoLink":"http://www.co.pierce.wa.us/index.aspx?NID=3814"},
        {"Volcano":"Glacier Peak","Category":"Evacuate","Agency":"Washington State Emergency Management Division","Description":"Mount Baker and Glacier Peak Coordination Plan","ResourceLink":"https://mil.wa.gov/asset/5ba420023d962","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/waemd.png","LogoLink":"http://mil.wa.gov/uploads/pdf/PLANS/mount%20baker%20glacier%20peak%20coordination%20plan.pdf"},
        {"Volcano":"Mount Baker","Category":"Evacuate","Agency":"Washington State Emergency Management Division","Description":"Mount Baker and Glacier Peak Coordination Plan","ResourceLink":"https://mil.wa.gov/asset/5ba420023d962","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/waemd.png","LogoLink":"http://mil.wa.gov/uploads/pdf/PLANS/mount%20baker%20glacier%20peak%20coordination%20plan.pdf"},
        {"Volcano":"Mount Adams","Category":"Evacuate","Agency":"Washington State Emergency Management Division","Description":"Mount St. Helens  and Mount Adams Coordination Plan","ResourceLink":"http://volcanoes.usgs.gov/vsc/file_mngr/file-132/mount-st.-helens---mount-adams-volcanic-region-coordination-plan-october-2014.pdf","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/waemd.png","LogoLink":"http://volcanoes.usgs.gov/vsc/file_mngr/file-132/mount-st.-helens---mount-adams-volcanic-region-coordination-plan-october-2014.pdf"},
        {"Volcano":"Mount St. Helens","Category":"Evacuate","Agency":"Washington State Emergency Management Division","Description":"Mount St. Helens  and Mount Adams Coordination Plan","ResourceLink":"http://volcanoes.usgs.gov/vsc/file_mngr/file-132/mount-st.-helens---mount-adams-volcanic-region-coordination-plan-october-2014.pdf","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/waemd.png","LogoLink":"http://volcanoes.usgs.gov/vsc/file_mngr/file-132/mount-st.-helens---mount-adams-volcanic-region-coordination-plan-october-2014.pdf"}],

    [{"Volcano":"Mount St. Helens","Category":"Check it Out","Agency":"Visit Mt. St. Helens","Description":"VolcanoCam","ResourceLink":"http://www.visitmtsthelens.com/volcanocam.html","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/cowlitz_county.png","LogoLink":"http://www.visitmtsthelens.com/volcanocam.html"},
        {"Volcano":"Mount Adams","Category":"Check it Out","Agency":"U.S. Geological Survey","Description":"Webcams","ResourceLink":"http://volcanoes.usgs.gov/volcanoes/adams/multimedia_webcams.html","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://volcanoes.usgs.gov/volcanoes/adams/multimedia_webcams.html"},
        {"Volcano":"Mount Baker","Category":"Check it Out","Agency":"U.S. Geological Survey","Description":"Webcams","ResourceLink":"http://volcanoes.usgs.gov/volcanoes/baker/multimedia_webcams.html","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://volcanoes.usgs.gov/volcanoes/baker/multimedia_webcams.html"},
        {"Volcano":"Mount Rainier","Category":"Check it Out","Agency":"U.S. Geological Survey","Description":"Webcams","ResourceLink":"http://volcanoes.usgs.gov/volcanoes/mount_rainier/multimedia_webcams.html","AgencyLogo":"https://fortress.wa.gov/dnr/geologydata/photos/web_images/usgs.png","LogoLink":"http://volcanoes.usgs.gov/volcanoes/mount_rainier/multimedia_webcams.html"},
        {"Volcano":"Glacier Peak","Category":"Check it Out","Agency":"www.skimountaineer.com","Description":"Webcams","ResourceLink":"http://www.skimountaineer.com/WebCam/WebCam.html","AgencyLogo":"","LogoLink":""}]
];




function volcanoInfo() {
    var width = d3.select("#volcanoInfo").style("width"),
        height = 420,
        scale;
    width = width.substring(0, width.length-2);
    if (width < 400) scale= 3000;
    else if (width >=400 && width < 500) scale= 4200;
    else if (width >=500 && width < 550) scale= 5100;
    else if(width >=550 && width < 700) scale= 5600;
    else if(width >=700 && width < 1000) scale= 6200;
    else if(width >=1000 && width < 1500) scale = 6500;
    else if(width >=1500) scale = 6700;
    var projection = d3.geo.conicConformal()
        .rotate([120.5, 0])
        .center([0, 47.3])
        .parallels([45.83, 47.33])
        .scale(scale)
        .translate([width / 2, height / 2])
        .precision(.1);
    var path = d3.geo.path()
        .projection(projection);
    var svg = d3.select("#volcanoInfo").append("svg")
        .attr("width", width)
        .attr("height", height);
    var g = svg.append("g");
    var tooltip = d3.select("#volcanoInfo")
        .append("div")
        .attr("class", "tip" + " " + "volcanoInfo")
        .style("opacity", 0)
        .style("pointer-events", "none");

    //creates the close button
    tooltip.append("div")
        .attr("class", "close")
        .html("Close");
    //appends text to the tooltip
    var tipHeader = tooltip.append("div").attr("class", "volcanoHeader");
    var text = tooltip.append("div").attr("class", "volcanoScroll");

    d3.select(window).on('scroll', function () {
        d3.selectAll(".tip").style("opacity", 0).style("pointer-events", "none");
    }).on('hashchange', function () {
        d3.selectAll(".tip").style("opacity", 0).style("pointer-events", "none");
    });

    queue()
        .defer(d3.json, "https://s3-us-west-2.amazonaws.com/geolpublist/json/counties.json")
        .defer(d3.json, "https://s3-us-west-2.amazonaws.com/geolpublist/json/cities.json")
        .await(drawMap);
    function drawMap(error, wa, cities) {
        g.append("g")
            .attr("id", "volcanostate")
            .selectAll("path")
            .data(topojson.feature(wa, wa.objects.counties).features)
            .enter().append("path")
            .attr("d", path);

        g.append("g")
            .attr("id", "volcanocities")
            .selectAll("path")
            .data(topojson.feature(cities, cities.objects.cities).features)
            .enter().append("path")
            .attr("d", path.pointRadius(3))
            .attr("class", "volcanocity");
        g.append("g")
            .attr("id", "volcanonames")
            .selectAll("volcanolabels")
            .data(topojson.feature(cities, cities.objects.cities).features)
            .enter().append("text")
            .attr("transform", function (d) {
                return "translate(" + projection(d.geometry.coordinates) + ")";
            })
            .attr("dy", -5)
            .attr("dx", function(d){
                var name = d.properties.label;
                if(name.length > 8 && name.length < 10) return -50;
                else if(name.length >= 10 && name.length < 12) return -60;
                else if(name.length >=12) return -70;
                else if(name.length==8) return -40;
                else return -35;
            })
            .text(function (d) {
                return d.properties.label;
            })
            .attr("class", "volcanolabels");
        g.append("g")
            .attr("id", "volcanoesGroup")
            .selectAll("path")
            .data(topojson.feature(volcanoes2, volcanoes2.objects.volcanoes).features)
            .enter().append("image")
            .attr("x", function(d){
                return projection(d.geometry.coordinates)[0] -20
            })
            .attr("y", function(d){
                return projection(d.geometry.coordinates)[1] -24
            })
            .attr('width', "60px")
            .attr('height', "60px")
            .attr("xlink:href", function(d){
                if(d.properties.name == "Mount Adams"){
                    return "https://fortress.wa.gov/dnr/geologydata/photos/web_images/Adams_circle-01.png"
                } else if(d.properties.name == "Mount Rainier"){
                    return "https://fortress.wa.gov/dnr/geologydata/photos/web_images/Rainier_circle-01.png"
                } else if (d.properties.name == "Mount St. Helens"){
                    return "https://fortress.wa.gov/dnr/geologydata/photos/web_images/Helens_circle-01.png"
                } else if (d.properties.name == "Glacier Peak"){
                    return "https://fortress.wa.gov/dnr/geologydata/photos/web_images/Glacier_circle-01.png"
                } else if (d.properties.name == "Mount Baker"){
                    return "https://fortress.wa.gov/dnr/geologydata/photos/web_images/Baker_circle-01.png"
                }
            })
            .attr('class', 'volcanoes')
            .on('click', function(d){
                tooltip.style("pointer-events", "all");
                tooltip.style("opacity", "1");

                var str;
                if(d.properties.name == "Mount Adams"){
                    str = "<div class='volcanoTitle'><img style='width: 100px' src='https://fortress.wa.gov/dnr/geologydata/photos/web_images/Adams_circle-01.png'><strong class=header>" + d.properties.name + " Volcano Hazard Information</strong></div>";
                } else if(d.properties.name == "Mount Rainier"){
                    str = "<div class='volcanoTitle'><img style='width: 100px' src='https://fortress.wa.gov/dnr/geologydata/photos/web_images/Rainier_circle-01.png'><strong class='header'>" + d.properties.name + " Volcano Hazard Information</strong></div>";
                } else if (d.properties.name == "Mount St. Helens"){
                    str = "<div class='volcanoTitle'><img style='width: 100px' src='https://fortress.wa.gov/dnr/geologydata/photos/web_images/Helens_circle-01.png'><strong class='header'>" + d.properties.name + " Volcano Hazard Information</strong></div>";
                } else if (d.properties.name == "Glacier Peak"){
                    str = "<div class='volcanoTitle'><img style='width: 100px' src='https://fortress.wa.gov/dnr/geologydata/photos/web_images/Glacier_circle-01.png'><strong class='header'>" + d.properties.name + " Volcano Hazard Information</strong></div>";
                } else if (d.properties.name == "Mount Baker"){
                    str = "<div class='volcanoTitle'><img style='width: 100px' src='https://fortress.wa.gov/dnr/geologydata/photos/web_images/Baker_circle-01.png'></td><td><strong class='header'>" + d.properties.name + " Volcano Hazard Information</strong></div>";
                }
                tipHeader.html(str);
                str = "";
                for(var i = 0; volcanoes.length>i;i++){
                    var flag = false;
                    for(var j = 0;volcanoes[i].length>j;j++){
                        if(volcanoes[i][j].Volcano == d.properties.name){
                            if(flag== false){
                                str = str + "<div class='headerRows'>"+ volcanoes[i][j].Category +"</div><div class='accordionClosed'>";
                                flag = true;
                            }
                            str = str + "<div class='tableCell'><a href='" + volcanoes[i][j].LogoLink + "' target='_blank'><img style='width: 75px;' src='" + volcanoes[i][j].AgencyLogo + "'></a>";
                            str = str + "<div class='tipLink'><a href='"+ volcanoes[i][j].ResourceLink + "' target='_blank'>" + volcanoes[i][j].Description +"</a></div></div>"
                        }
                    }
                    str = str + "</div>";
                }
                str = str + "</div>";


                //close button turns the tip off
                d3.selectAll(".tip").selectAll(".close").on("mousedown", function(){
                    d3.selectAll(".tip").transition().style("opacity", 0).style("pointer-events", "none");
                });
                text.html(str);

                $j(".headerRows").on('click',function(){
                    $j(this).next().slideToggle();
                    $j(this).toggleClass("headerRowsClick");
                });
            });

        g.append("g")
            .attr("id", "volcanolabels")
            .selectAll("volcanoNames")
            .data(topojson.feature(volcanoes2, volcanoes2.objects.volcanoes).features)
            .enter().append("text")
            .attr("transform", function(d){
                return "translate(" + projection(d.geometry.coordinates) + ")";
            })
            .attr("dy", -20)
            .attr("dx", function(d){
                var name = d.properties.name;
                if(name.length >=15) return -55;
                else return 5;
            })
            .text(function(d){
                return d.properties.name;
            }).attr("class", "volcanoNames");

        //stop scrolling in parent window
        $j('.volcanoScroll').on('DOMMouseScroll mousewheel', function(ev) {
            var $this = $j(this),
                scrollTop = this.scrollTop,
                scrollHeight = this.scrollHeight,
                height = $this.height(),
                delta = (ev.type == 'DOMMouseScroll' ?
                ev.originalEvent.detail * -40 :
                    ev.originalEvent.wheelDelta),
                up = delta > 0;

            var prevent = function() {
                ev.stopPropagation();
                ev.preventDefault();
                ev.returnValue = false;
                return false;
            };

            if (!up && -delta > scrollHeight - height - scrollTop) {
                // Scrolling down, but this will take us past the bottom.
                $this.scrollTop(scrollHeight);
                return prevent();
            } else if (up && delta > scrollTop) {
                // Scrolling up, but this will take us past the top.
                $this.scrollTop(0);
                return prevent();
            }
        });
    }
}
volcanoInfo();