//Javascript
var mapArray = Array();
var map;
function markerIcon(type) {
var markerIcon = new GIcon();
if(type=='basic') {
markerIcon.image = "http://waterfalls.jacobemerick.com/images/blue-pushpin.png";
markerIcon.shadow = "http://waterfalls.jacobemerick.com/images/pushpin_shadow.png";}
if(type=='poi') {
markerIcon.image = "http://waterfalls.jacobemerick.com/images/flag.png";
markerIcon.shadow = "http://waterfalls.jacobemerick.com/images/flags.png";}
if(type=='drop') {
markerIcon.image = "http://waterfalls.jacobemerick.com/images/waterfall.png";
markerIcon.shadow = "http://waterfalls.jacobemerick.com/images/waterfalls.png";}
if(type=='parking') {
markerIcon.image = "http://waterfalls.jacobemerick.com/images/parkinglot.png";
markerIcon.shadow = "http://waterfalls.jacobemerick.com/images/parkinglots.png";}
markerIcon.iconAnchor = new GPoint(16,32);
markerIcon.infoWindowAnchor = new GPoint(16,1);
return markerIcon;}
function markerInfo(marker,mapArray) {
var mapData = mapArray.split(',');
if(mapData[2]=='point') {
GEvent.addListener(marker,"click",function() {
marker.openInfoWindowHtml('
');});}
else {
GEvent.addListener(marker,"click",function() {
marker.openInfoWindowHtml(''+mapData[2]+' Falls

');});}}
function load() {
if(GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.removeMapType(G_HYBRID_MAP);
map.addMapType(G_PHYSICAL_MAP);
map.addMapType(WMS_TOPO_MAP);
createArray();
displayArray();
}}
function WMSCreateMap(name,copyright,baseUrl,layer,minResolution,maxResolution,urlArg) {
var cr = new GCopyright(1,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),0,copyright);
var crc = new GCopyrightCollection();
crc.addCopyright(cr);
var tileLayer = new GTileLayer(crc,minResolution,maxResolution);
tileLayer.baseUrl = baseUrl;
tileLayer.layer = layer;
tileLayer.getTileUrl = WMSGetTileUrl;
var tileLayers = [tileLayer];
return new GMapType(tileLayers,G_SATELLITE_MAP.getProjection(),name,{errorMessage:'',urlArg:'o'});}
function WMSGetTileUrl(tile,zoom) {
var southWestPixel = new GPoint(tile.x*256,(tile.y+1)*256);
var northEastPixel = new GPoint((tile.x+1)*256,tile.y*256);
var southWestCoords = G_NORMAL_MAP.getProjection().fromPixelToLatLng(southWestPixel,zoom);
var northEastCoords = G_NORMAL_MAP.getProjection().fromPixelToLatLng(northEastPixel,zoom);
var bbox = southWestCoords.lng()+','+southWestCoords.lat()+','+northEastCoords.lng()+','+northEastCoords.lat();
return this.baseUrl+'?VERSION=1.1.1&REQUEST=GetMap&LAYERS='+this.layer+'&STYLES=&SRS=EPSG:4326&BBOX='+bbox+'&WIDTH=256&HEIGHT=256&FORMAT=image/jpeg&BGCOLOR=0xCCCCCC&EXCEPTIONS=INIMAGE';}
var WMS_TOPO_MAP = WMSCreateMap('Topo','Imagery by USGS / Web Service by TerraServer','http://www.terraserver-usa.com/ogcmap6.ashx','DRG',4,17,'t');
function createArray() { mapArray[0] = "47.231518,-88.149017,Tobacco,tobacco,1212954793.jpg,6/8/08,june-08-2008";
mapArray[1] = "47.381817,-88.029457,Haven,haven,1240188279.jpg,4/19/09,april-19-2009";
mapArray[2] = "47.392540,-87.841400,Lower Montreal,lower-montreal,1222296413.jpg,9/24/08,september-24-2008";
mapArray[3] = "46.752476,-88.452774,Falls River,falls-river,1228343461.jpg,12/3/08,december-03-2008";
mapArray[4] = "46.736977,-88.444359,Power House,power-house,1239147146.jpg,4/7/09,april-07-2009";
mapArray[5] = "46.642864,-88.694130,Sturgeon River,sturgeon-river,1225575354.jpg,11/1/08,november-01-2008";
mapArray[6] = "46.622089,-88.477020,Canyon River,canyon-river,1228338328.jpg,12/3/08,december-03-2008";
mapArray[7] = "47.148933,-88.764191,Redridge Dam,redridge-dam,1214263672.jpg,6/23/08,june-23-2008";
mapArray[8] = "47.171482,-88.446632,Hungarian,hungarian,1240688476.jpg,4/25/09,april-25-2009";
mapArray[9] = "46.793552,-88.336197,Lower Silver,lower-silver,1226863934.jpg,11/16/08,november-16-2008";
mapArray[10] = "46.758915,-88.358444,Gomanche,gomanche,1225558798.jpg,11/1/08,november-01-2008";
mapArray[11] = "46.761089,-88.360977,Middle Silver,middle-silver,1240845200.jpg,4/27/09,april-27-2009";
mapArray[12] = "46.788700,-88.241768,Quartzite,quartzite,1223750803.jpg,10/11/08,october-11-2008";
mapArray[13] = "46.787312,-88.239128,Black Slate,black-slate,1223749764.jpg,10/11/08,october-11-2008";
mapArray[14] = "46.774876,-88.165840,Unnamed Ravine River,unnamed-ravine-river,1214612338.jpg,6/27/08,june-27-2008";
mapArray[15] = "46.830811,-88.251587,Slate River,slate-river,1226869488.jpg,11/16/08,november-16-2008";
mapArray[16] = "46.827518,-88.248581,Ecstasy,ecstasy,1226872257.jpg,11/16/08,november-16-2008";
mapArray[17] = "46.709885,-88.422173,Dault's,dault's,1239148424.jpg,4/7/09,april-07-2009";
mapArray[18] = "46.645813,-88.507530,Ogemaw,ogemaw,1239149685.jpg,4/7/09,april-07-2009";
mapArray[19] = "46.579926,-88.588554,Tibbet's,tibbet's,1214763790.jpg,6/29/08,june-29-2008";
mapArray[20] = "46.451283,-88.913597,Jumbo,jumbo,1240859617.jpg,4/27/09,april-27-2009";
mapArray[21] = "46.480724,-89.090279,Agate,agate,1214776706.jpg,6/29/08,june-29-2008";
mapArray[22] = "46.651550,-89.151756,O Kun De Kun,o-kun-de-kun,1226249815.jpg,11/9/08,november-09-2008";
mapArray[23] = "46.890430,-88.878914,Wyandotte,wyandotte,1240867332.jpg,4/27/09,april-27-2009";
mapArray[24] = "46.722858,-88.791931,West Branch Sturgeon,west-branch-sturgeon,1238681362.jpg,4/2/09,april-02-2009";
mapArray[25] = "46.723507,-88.806091,Hogger,hogger,1238684297.jpg,4/2/09,april-02-2009";
mapArray[26] = "47.132519,-88.555168,Ripley,ripley,1240871315.jpg,4/27/09,april-27-2009";
mapArray[27] = "47.151962,-88.471268,Quincy,quincy,1238285674.jpg,3/28/09,march-28-2009";
mapArray[28] = "46.811604,-88.753906,Otter,otter,1239370357.jpg,4/10/09,april-10-2009";
mapArray[29] = "47.329849,-88.433678,Upper Gratiot,upper-gratiot,1215725204.jpg,7/10/08,july-10-2008";
mapArray[30] = "47.335258,-88.443802,Lower Gratiot,lower-gratiot,1215730137.jpg,7/10/08,july-10-2008";
mapArray[31] = "47.207005,-88.427582,Douglass Houghton,douglass-houghton,1215736685.jpg,7/10/08,july-10-2008";
mapArray[32] = "47.397449,-88.330894,Silver Creek,silver-creek,1215970417.jpg,7/13/08,july-13-2008";
mapArray[33] = "47.397362,-88.284340,Ten Foot,ten-foot,1215971507.jpg,7/13/08,july-13-2008";
mapArray[34] = "47.411854,-88.296265,Eagle River,eagle-river,1223136941.jpg,10/4/08,october-04-2008";
mapArray[35] = "47.427738,-88.237556,Jacob's,jacob's,1240160537.jpg,4/19/09,april-19-2009";
mapArray[36] = "47.463493,-88.072929,Silver River,silver-river,1239631299.jpg,4/13/09,april-13-2009";
mapArray[37] = "47.461960,-87.878998,Manganese Gorge,manganese-gorge,1239629518.jpg,4/13/09,april-13-2009";
mapArray[38] = "46.686718,-88.322182,Harley,harley,1239829781.jpg,4/15/09,april-15-2009";
mapArray[39] = "46.650230,-88.439941,Plumbago,plumbago,1240836160.jpg,4/27/09,april-27-2009";
mapArray[40] = "46.574467,-88.340851,Tioga Park,tioga-park,1216397685.jpg,7/18/08,july-18-2008";
mapArray[41] = "46.592697,-88.348831,Tioga,tioga,1216400991.jpg,7/18/08,july-18-2008";
mapArray[42] = "46.864620,-88.083229,Big Erick's,big-erick's,1216491376.jpg,7/19/08,july-19-2008";
mapArray[43] = "46.849506,-88.063873,East Branch Huron River,east-branch-huron-river,1216494202.jpg,7/19/08,july-19-2008";
mapArray[44] = "46.832687,-87.978943,Cliff,cliff,1240078558.jpg,4/18/09,april-18-2009";
mapArray[45] = "46.817303,-87.951736,Cedar,cedar,1240063330.jpg,4/18/09,april-18-2009";
mapArray[46] = "46.806610,-88.087219,Erick's,erick's,1239812117.jpg,4/15/09,april-15-2009";
mapArray[47] = "46.790337,-88.095505,Lower Leatherby,lower-leatherby,1239805739.jpg,4/15/09,april-15-2009";
mapArray[48] = "46.680801,-88.329903,Upper Silver,upper-silver,1239836402.jpg,4/15/09,april-15-2009";
mapArray[49] = "47.403591,-88.292732,Fenner's,fenner's,1226093481.jpg,11/7/08,november-07-2008";
mapArray[50] = "47.430698,-88.196266,Copper,copper,1240171788.jpg,4/19/09,april-19-2009";
mapArray[51] = "47.366386,-88.132797,Eister,eister,1240186138.jpg,4/19/09,april-19-2009";
mapArray[52] = "47.397709,-87.836464,Upper Montreal,upper-montreal,1222299317.jpg,9/24/08,september-24-2008";
mapArray[53] = "46.712032,-87.704201,Big Pup,big-pup,1217186301.jpg,7/27/08,july-27-2008";
mapArray[54] = "46.728596,-87.706902,Yellow Dog,yellow-dog,1217188167.jpg,7/27/08,july-27-2008";
mapArray[55] = "46.735538,-87.693855,Bushy Creek,bushy-creek,1217191631.jpg,7/27/08,july-27-2008";
mapArray[56] = "46.706116,-87.806641,Pinnacle,pinnacle,1225036473.jpg,10/26/08,october-26-2008";
mapArray[57] = "46.820503,-88.195366,Ravine River,ravine-river,1217378948.jpg,7/29/08,july-29-2008";
mapArray[58] = "46.409664,-89.132469,Bond,bond,1226266484.jpg,11/9/08,november-09-2008";
mapArray[59] = "46.570278,-88.985138,Onion,onion,1239031110.jpg,4/6/09,april-06-2009";
mapArray[60] = "46.693047,-89.166115,Sandstone Creek,sandstone-creek,1239377266.jpg,4/10/09,april-10-2009";
mapArray[61] = "46.826817,-88.248024,Slide,slide,1226872713.jpg,11/16/08,november-16-2008";
mapArray[62] = "46.825817,-88.246475,Kukuck's,kukuck's,1226873982.jpg,11/16/08,november-16-2008";
mapArray[63] = "46.838238,-88.070183,Big,big,1218385517.jpg,8/10/08,august-10-2008";
mapArray[64] = "46.839233,-88.090652,West Branch Huron River,west-branch-huron-river,1239815931.jpg,4/15/09,april-15-2009";
mapArray[65] = "46.767765,-88.108681,Leatherby,leatherby,1239804571.jpg,4/15/09,april-15-2009";
mapArray[66] = "46.725124,-88.669579,Prickett Dam,prickett-dam,1220210759.jpg,8/31/08,august-31-2008";
mapArray[67] = "47.134010,-88.495216,Gooseneck Creek,gooseneck-creek,1240678694.jpg,4/25/09,april-25-2009";
mapArray[68] = "46.695816,-89.174568,Plover,plover,1223224344.jpg,10/5/08,october-05-2008";
mapArray[69] = "46.686779,-89.228981,Victoria Dam,victoria-dam,1239050911.jpg,4/6/09,april-06-2009";
mapArray[70] = "46.722359,-87.962677,West Branch Yellow Dog,west-branch-yellow-dog,1223818186.jpg,10/12/08,october-12-2008";
mapArray[71] = "46.715885,-87.951607,Bulldog,bulldog,1223822351.jpg,10/12/08,october-12-2008";
mapArray[72] = "46.683922,-87.826294,Mulligan,mulligan,1241025801.jpg,4/29/09,april-29-2009";
mapArray[73] = "46.615723,-88.395309,No Name,no-name,1224113103.jpg,10/15/08,october-15-2008";
mapArray[74] = "46.807110,-87.848053,Hogback,hogback,1224430461.jpg,10/19/08,october-19-2008";
mapArray[75] = "46.781853,-87.707474,Alder,alder,1224439282.jpg,10/19/08,october-19-2008";
mapArray[76] = "46.567829,-88.036797,Dee Lundeen,dee-lundeen,1224450946.jpg,10/19/08,october-19-2008";
mapArray[77] = "46.718716,-87.855530,Wylie Dam,wylie-dam,1225042399.jpg,10/26/08,october-26-2008";
mapArray[78] = "46.617786,-88.292480,Upper Sturgeon,upper-sturgeon,1225547168.jpg,11/1/08,november-01-2008";
mapArray[79] = "46.817390,-89.570457,Bonanza,bonanza,1226257537.jpg,11/9/08,november-09-2008";
mapArray[80] = "46.565735,-87.445122,Lower Dead River,lower-dead-river,1226678780.jpg,11/14/08,november-14-2008";
mapArray[81] = "46.552090,-87.519600,Mc Clure Dam,mc-clure-dam,1239236488.jpg,4/8/09,april-08-2009";
mapArray[82] = "46.551926,-87.516747,Upper Dead River,upper-dead-river,1239235392.jpg,4/8/09,april-08-2009";
mapArray[83] = "46.554523,-87.507195,Trestle,trestle,1239232404.jpg,4/8/09,april-08-2009";
mapArray[84] = "46.522221,-87.471245,Morgan Meadows,morgan-meadows,1226699178.jpg,11/14/08,november-14-2008";
mapArray[85] = "46.433369,-87.599068,Warner,warner,1238869707.jpg,4/5/09,april-05-2009";
mapArray[86] = "46.407360,-87.596359,Schweitzer,schweitzer,1238871929.jpg,4/5/09,april-05-2009";
mapArray[87] = "46.393448,-87.785912,Black River,black-river,1239213475.jpg,4/8/09,april-08-2009";
mapArray[88] = "46.521660,-87.576469,Upper Carp River,upper-carp-river,1227455421.jpg,11/23/08,november-23-2008";
mapArray[89] = "46.571724,-87.410530,Tourist Park Dam,tourist-park-dam,1239221779.jpg,4/8/09,april-08-2009";
mapArray[90] = "46.566887,-87.478806,Dead River,dead-river,1227467272.jpg,11/23/08,november-23-2008";
mapArray[91] = "47.274513,-88.389816,Queen Anne's,queen-anne's,1239643978.jpg,4/13/09,april-13-2009";
mapArray[92] = "47.257477,-88.368576,Trap Rock River,trap-rock-river,1227563252.jpg,11/24/08,november-24-2008";
mapArray[93] = "47.116402,-88.586456,Huron Creek,huron-creek,1238544373.jpg,3/31/09,march-31-2009";
mapArray[94] = "46.573540,-87.476967,Reany,reany,1238850684.jpg,4/5/09,april-05-2009";
mapArray[95] = "46.575562,-87.503784,Upper Reany,upper-reany,1238853610.jpg,4/5/09,april-05-2009";
mapArray[96] = "46.577831,-87.496964,Holyoke,holyoke,1238856946.jpg,4/5/09,april-05-2009";
mapArray[97] = "46.691074,-89.557159,Little Trap,little-trap,1239045242.jpg,4/6/09,april-06-2009";
mapArray[98] = "46.43829,-87.68676,Ely,ely,1239218392.jpg,4/8/09,april-08-2009";
mapArray[99] = "46.56872,-87.45409,Forestville Dam,forestville-dam,1239224943.jpg,4/8/09,april-08-2009";
mapArray[100] = "47.22897,-88.40890,St Louis,st-louis,1239646991.jpg,4/13/09,april-13-2009";
mapArray[101] = "46.76291,-88.10829,Upper Leatherby,upper-leatherby,1239802868.jpg,4/15/09,april-15-2009";
mapArray[102] = "46.82693,-87.94680,Turkey Neck,turkey-neck,1240066678.jpg,4/18/09,april-18-2009";
mapArray[103] = "47.43741,-88.19627,Copper Adit,copper-adit,1240174759.jpg,4/19/09,april-19-2009";
mapArray[104] = "46.38988,-87.71901,White City,white-city,1240409035.jpg,4/22/09,april-22-2009";
mapArray[105] = "46.69267,-87.58730,Birch Creek,birch-creek,1240418762.jpg,4/22/09,april-22-2009";
mapArray[106] = "46.66681,-87.57932,Little Garlic,little-garlic,1240427155.jpg,4/22/09,april-22-2009";
mapArray[107] = "46.68177,-87.57305,Big Garlic,big-garlic,1240432007.jpg,4/22/09,april-22-2009";
mapArray[108] = "46.50346,-87.44671,Carp River,carp-river,1240442816.jpg,4/22/09,april-22-2009";
mapArray[109] = "46.49498,-87.46132,Carp River Dam,carp-river-dam,1240446428.jpg,4/22/09,april-22-2009";
mapArray[110] = "46.41274,-88.91140,Duppy,duppy,1240857033.jpg,4/27/09,april-27-2009";
}
function displayArray() {
if(mapArray.length) {
var points = [];
for(var i=0;i<(mapArray.length);i++) {
var mapData = mapArray[i].split(',');
var point = new GLatLng(mapData[0],mapData[1]);
var marker = new GMarker(point,markerIcon('basic'));
map.addOverlay(marker);
markerInfo(marker,mapArray[i]);
points.push(point);}
positionFinder(points);
}}
function displayPoints() {
mapArray[0] = ",,point,,";
var bounds = new GLatLngBounds();
var points = [];
for(var i=0;i<(mapArray.length);i++) {
var mapData = mapArray[i].split(',');
var point = new GLatLng(mapData[0],mapData[1]);
var marker = new GMarker(point,markerIcon(mapData[3]));
map.addOverlay(marker);
markerInfo(marker,mapArray[i]);
points.push(point);}
positionFinder(points);}
function positionFinder(array) {
var bounds = new GLatLngBounds();
for(var i=0;i