function addMarkers(){ mySelect = document.getElementById('selection'); Demarest = [];Paramuus = [];Oakland = [];Oradell = [];Haworth = [];Teaneck = [];Paramus = [];Ramsey = [];Englewood = [];Lodi = [];Fort_Lee = [];Waldwick = [];Hackensack = [];Garfield = [];Ridgewood = [];New_Milford = [];Dumont = [];North_Arlington = [];Saddle_River = [];Rochelle_Park = [];Montvale = [];Rutherford = [];mySelect.options[mySelect.options.length] = new Option("Demarest schools",'all=Demarest'); mySelect.options[mySelect.options.length] = new Option("Dumont schools",'all=Dumont'); mySelect.options[mySelect.options.length] = new Option("Englewood schools",'all=Englewood'); mySelect.options[mySelect.options.length] = new Option("Fort Lee schools",'all=Fort_Lee'); mySelect.options[mySelect.options.length] = new Option("Garfield schools",'all=Garfield'); mySelect.options[mySelect.options.length] = new Option("Hackensack schools",'all=Hackensack'); mySelect.options[mySelect.options.length] = new Option("Haworth schools",'all=Haworth'); mySelect.options[mySelect.options.length] = new Option("Lodi schools",'all=Lodi'); mySelect.options[mySelect.options.length] = new Option("Montvale schools",'all=Montvale'); mySelect.options[mySelect.options.length] = new Option("New Milford schools",'all=New_Milford'); mySelect.options[mySelect.options.length] = new Option("North Arlington schools",'all=North_Arlington'); mySelect.options[mySelect.options.length] = new Option("Oakland schools",'all=Oakland'); mySelect.options[mySelect.options.length] = new Option("Oradell schools",'all=Oradell'); mySelect.options[mySelect.options.length] = new Option("Paramus schools",'all=Paramus'); mySelect.options[mySelect.options.length] = new Option("Paramuus schools",'all=Paramuus'); mySelect.options[mySelect.options.length] = new Option("Ramsey schools",'all=Ramsey'); mySelect.options[mySelect.options.length] = new Option("Ridgewood schools",'all=Ridgewood'); mySelect.options[mySelect.options.length] = new Option("Rochelle Park schools",'all=Rochelle_Park'); mySelect.options[mySelect.options.length] = new Option("Rutherford schools",'all=Rutherford'); mySelect.options[mySelect.options.length] = new Option("Saddle River schools",'all=Saddle_River'); mySelect.options[mySelect.options.length] = new Option("Teaneck schools",'all=Teaneck'); mySelect.options[mySelect.options.length] = new Option("Waldwick schools",'all=Waldwick'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Demarest[Demarest.length] = createMarker(new GPoint(-73.94215700,40.94299200),"
Academy Of The Holy Angels
315 Hillside Avenue
Demarest, NJ 07627
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Academy Of The Holy Angels",'Demarest=' + Demarest.length); Paramuus[Paramuus.length] = createMarker(new GPoint(-74.08907900,40.97876400),"
Alpine Learning Group, Inc
777 Paramus Rd
Paramuus, NJ 07652
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alpine Learning Group, Inc",'Paramuus=' + Paramuus.length); Oakland[Oakland.length] = createMarker(new GPoint(-74.24853800,41.00477200),"
Barnstable Academy
8 Wright Way
Oakland, NJ 07436
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Barnstable Academy",'Oakland=' + Oakland.length); Oradell[Oradell.length] = createMarker(new GPoint(-74.04938300,40.95909600),"
Bergen Catholic High School
1040 Oradell Avenue
Oradell, NJ 07649
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bergen Catholic High School",'Oradell=' + Oradell.length); Haworth[Haworth.length] = createMarker(new GPoint(-73.99126200,40.96002700),"
Bergen Center For Child Development
140 Park St
Haworth, NJ 07641
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bergen Center For Child Development",'Haworth=' + Haworth.length); Teaneck[Teaneck.length] = createMarker(new GPoint(-74.00213600,40.89295500),"
Community High School
1135 Teaneck Road
Teaneck, NJ 07666
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Community High School",'Teaneck=' + Teaneck.length); Paramus[Paramus.length] = createMarker(new GPoint(-74.06006800,40.94301400),"
The David Gregory School
347 Farview Avenue North
Paramus, NJ 07652
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The David Gregory School",'Paramus=' + Paramus.length); Ramsey[Ramsey.length] = createMarker(new GPoint(-74.13678300,41.07224600),"
Don Bosco Prep
492 N. Franklin Turnpike
Ramsey, NJ 07446
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Don Bosco Prep",'Ramsey=' + Ramsey.length); Englewood[Englewood.length] = createMarker(new GPoint(-73.96360800,40.88772800),"
Dwight-englewood School
315 E Palisade Avenue
Englewood, NJ 07631
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dwight-englewood School",'Englewood=' + Englewood.length); Lodi[Lodi.length] = createMarker(new GPoint(-71.09340400,42.26080600),"
The Felician School For Except
260 S Main Street
Lodi, NJ 07644
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Felician School For Except",'Lodi=' + Lodi.length); Fort_Lee[Fort_Lee.length] = createMarker(new GPoint(-73.96394200,40.86312600),"
Fort Lee Education Center
2300 3rd Street
Fort Lee, NJ 07024
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fort Lee Education Center",'Fort_Lee=' + Fort_Lee.length); Waldwick[Waldwick.length] = createMarker(new GPoint(-74.12895100,41.01009800),"
The Forum School
107 Wyckoff Ave
Waldwick, NJ 07463
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Forum School",'Waldwick=' + Waldwick.length); Paramus[Paramus.length] = createMarker(new GPoint(-74.08017200,40.93417300),"
The Frisch School
120 West Century Road
Paramus, NJ 07652
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Frisch School",'Paramus=' + Paramus.length); Hackensack[Hackensack.length] = createMarker(new GPoint(-74.04230100,40.89209900),"
Hackensack Christian Schools
15 Conklin Place
Hackensack, NJ 07601
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hackensack Christian Schools",'Hackensack=' + Hackensack.length); Garfield[Garfield.length] = createMarker(new GPoint(-74.10282600,40.86532500),"
Heritage Christian School
41 Marsellus Place
Garfield, NJ 07026
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian School",'Garfield=' + Garfield.length); Lodi[Lodi.length] = createMarker(new GPoint(-74.08533400,40.87367800),"
High Point School Of Bergen County
46 Spring Street
Lodi, NJ 07644
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("High Point School Of Bergen County",'Lodi=' + Lodi.length); Ridgewood[Ridgewood.length] = createMarker(new GPoint(-74.11226500,40.97801000),"
Holmstead School
14 Hope Street
Ridgewood, NJ 07450
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holmstead School",'Ridgewood=' + Ridgewood.length); Teaneck[Teaneck.length] = createMarker(new GPoint(-74.02472300,40.88767900),"
Ief-al-ghazaly High School
441 North Street
Teaneck, NJ 07666
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ief-al-ghazaly High School",'Teaneck=' + Teaneck.length); Lodi[Lodi.length] = createMarker(new GPoint(-74.09324900,40.86586200),"
Immaculate Conception High School
258 S Main Street
Lodi, NJ 07644
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Immaculate Conception High School",'Lodi=' + Lodi.length); New_Milford[New_Milford.length] = createMarker(new GPoint(-74.01283900,40.94035200),"
Institute For Educaltional Ach
381 Madison Ave
New Milford, NJ 07646
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Institute For Educaltional Ach",'New_Milford=' + New_Milford.length); Teaneck[Teaneck.length] = createMarker(new GPoint(-74.00235500,40.90720200),"
Ma'ayanot Yeshiva High School For Girls
1650 Palisade Avenue
Teaneck, NJ 07666
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ma'ayanot Yeshiva High School For Girls",'Teaneck=' + Teaneck.length); Dumont[Dumont.length] = createMarker(new GPoint(-73.99558900,40.93478000),"
Newbury Academy
httpwww.newburyacademy.com
Dumont, NJ 07621
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Newbury Academy",'Dumont=' + Dumont.length); Paramus[Paramus.length] = createMarker(new GPoint(-74.04676100,40.94403900),"
Palisades Learning Center
304 E Midland Avenue
Paramus, NJ 07652
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Palisades Learning Center",'Paramus=' + Paramus.length); Paramus[Paramus.length] = createMarker(new GPoint(-74.09404500,40.95586000),"
Paramus Catholic High School
425 Paramus Road
Paramus, NJ 07652
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Paramus Catholic High School",'Paramus=' + Paramus.length); North_Arlington[North_Arlington.length] = createMarker(new GPoint(-74.13180900,40.78662800),"
Queen Of Peace High School
191 Rutherford Place
North Arlington, NJ 07031
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Queen Of Peace High School",'North_Arlington=' + North_Arlington.length); Saddle_River[Saddle_River.length] = createMarker(new GPoint(-74.08464600,41.03015600),"
Saddle River Day School
147 Chestnut Ridge Road
Saddle River, NJ 07458
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Saddle River Day School",'Saddle_River=' + Saddle_River.length); Rochelle_Park[Rochelle_Park.length] = createMarker(new GPoint(-74.07748400,40.90550400),"
Sage Day Schools, @ Rochelle Park; @ Mahwah; @Boonton
295 Rochelle Ave
Rochelle Park, NJ 07662
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sage Day Schools, @ Rochelle Park; @ Mahwah; @Boonton",'Rochelle_Park=' + Rochelle_Park.length); Montvale[Montvale.length] = createMarker(new GPoint(-74.06991200,41.05036500),"
St. Joseph Regional High School
40 Chestnut Ridge Road
Montvale, NJ 07645
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St. Joseph Regional High School",'Montvale=' + Montvale.length); Rutherford[Rutherford.length] = createMarker(new GPoint(-74.10444600,40.82940600),"
St. Mary High School
64 Chestnut Street
Rutherford, NJ 07070
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary High School",'Rutherford=' + Rutherford.length); Teaneck[Teaneck.length] = createMarker(new GPoint(-74.00884300,40.88493200),"
Schechter Regional High School
800 Broad Street
Teaneck, NJ 07666
Co-ed school, 9-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Schechter Regional High School",'Teaneck=' + Teaneck.length); Teaneck[Teaneck.length] = createMarker(new GPoint(-73.99905700,40.90183000),"
Sinai Schools
1485 Teaneck Rd suite 304
Teaneck, NJ 07666
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sinai Schools",'Teaneck=' + Teaneck.length); New_Milford[New_Milford.length] = createMarker(new GPoint(-74.01726000,40.93821700),"
Solomon Schechter Day School of Bergen County
275 McKinley Avenue
New Milford, NJ 07646
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Solomon Schechter Day School of Bergen County",'New_Milford=' + New_Milford.length); Waldwick[Waldwick.length] = createMarker(new GPoint(-74.12565800,41.00896200),"
Waldwick Sda Jr Academy
70 Wyckoff Avenue
Waldwick, NJ 07463
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Waldwick Sda Jr Academy",'Waldwick=' + Waldwick.length); Englewood[Englewood.length] = createMarker(new GPoint(-73.98444100,40.88769900),"
Yeshiva Ohr Hatalmud Of Englewood
101 W Forest Avenue
Englewood, NJ 07631
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Yeshiva Ohr Hatalmud Of Englewood",'Englewood=' + Englewood.length); } // End addStateMarkers JavaScript Function // Takes an array of markers and centers/zooms map based on marker range function centerByArray(myArray, recenter, newMaxMin) { if (newMaxMin == true) reMaxMin(myArray); for (var i = 0; i < myArray.length; i++) { var markLng = myArray[i].getPoint().x; var markLat = myArray[i].getPoint().y; if (markLat > maxLat) maxLat = markLat; if (markLng > maxLng) maxLng = markLng; if (markLat < minLat) minLat = markLat; if (markLng < minLng) minLng = markLng; } if (recenter) reCenterMap(); } // Reinit max/mins function reMaxMin(myArray) { maxLng = myArray[0].getPoint().x; maxLat = myArray[0].getPoint().y; minLng = myArray[0].getPoint().x; minLat = myArray[0].getPoint().y; } // Recenter map based on global max/mins function reCenterMap() { var bounds = new GLatLngBounds(); bounds.extend(new GLatLng(minLat, minLng)); bounds.extend(new GLatLng(maxLat, maxLng)); var center_lat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) / 2.0; var center_lng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) / 2.0; var center = new GLatLng(center_lat, center_lng); var zoom = map.getBoundsZoomLevel(bounds); map.setCenter(center,zoom); //map.setCenter(center,11); /* var center = new GPoint( (maxLng + minLng)/2, (maxLat+minLat)/2 ); var delta = new GSize(maxLng - minLng, maxLat - minLat); var minZoom = map.spec.getLowestZoomLevel(center, delta, map.viewSize); if (minZoom < 4) minZoom = 4; // Lowest possible zoom is 4 map.centerAndZoom(center, minZoom); */ } // Fires when drop down list of schools changes function selectChange(selection) { var myVal = selection.options[selection.selectedIndex].value; map.closeInfoWindow(); // Add entire array based on variable type if (myVal.indexOf('all') != -1 && myVal != 'all') { var temp = myVal.split('='); var showArray = temp[1]; // If Array is > X amount of markers, then open in a new page if (eval(showArray).length > 20) // New window depends on whether or not we're on the search page if (location.href.indexOf('nearby_schools.php') == -1) window.open(location.href + '/map/' + showArray); else window.open('/search/////2/' + showArray); map.removeOverlays(Demarest); map.removeOverlays(Dumont); map.removeOverlays(Englewood); map.removeOverlays(Fort_Lee); map.removeOverlays(Garfield); map.removeOverlays(Hackensack); map.removeOverlays(Haworth); map.removeOverlays(Lodi); map.removeOverlays(Montvale); map.removeOverlays(New_Milford); map.removeOverlays(North_Arlington); map.removeOverlays(Oakland); map.removeOverlays(Oradell); map.removeOverlays(Paramus); map.removeOverlays(Paramuus); map.removeOverlays(Ramsey); map.removeOverlays(Ridgewood); map.removeOverlays(Rochelle_Park); map.removeOverlays(Rutherford); map.removeOverlays(Saddle_River); map.removeOverlays(Teaneck); map.removeOverlays(Waldwick); map.addOverlays(eval(showArray)); centerByArray(eval(showArray), true, true); // Center and zoom on set of markers } // Add individual markers if (myVal.indexOf('all') == -1 && myVal != 'all' && myVal.length) { var temp = myVal.split('='); var myArray = temp[0]; var myIndex = parseInt(temp[1]) - 1; document.getElementById('map').width = "750"; map.removeOverlay(eval(myArray)[myIndex]); map.addOverlay(eval(myArray)[myIndex]); GEvent.trigger(eval(myArray)[myIndex],'click'); } // Show all markers if (myVal == 'all') { cntMarker = 0; reMaxMin(Demarest);map.removeOverlays(Demarest); map.removeOverlays(Dumont); map.removeOverlays(Englewood); map.removeOverlays(Fort_Lee); map.removeOverlays(Garfield); map.removeOverlays(Hackensack); map.removeOverlays(Haworth); map.removeOverlays(Lodi); map.removeOverlays(Montvale); map.removeOverlays(New_Milford); map.removeOverlays(North_Arlington); map.removeOverlays(Oakland); map.removeOverlays(Oradell); map.removeOverlays(Paramus); map.removeOverlays(Paramuus); map.removeOverlays(Ramsey); map.removeOverlays(Ridgewood); map.removeOverlays(Rochelle_Park); map.removeOverlays(Rutherford); map.removeOverlays(Saddle_River); map.removeOverlays(Teaneck); map.removeOverlays(Waldwick); map.addOverlays(Demarest); centerByArray(Demarest, false, false); cntMarker += Demarest.length; map.addOverlays(Dumont); centerByArray(Dumont, false, false); cntMarker += Dumont.length; map.addOverlays(Englewood); centerByArray(Englewood, false, false); cntMarker += Englewood.length; map.addOverlays(Fort_Lee); centerByArray(Fort_Lee, false, false); cntMarker += Fort_Lee.length; map.addOverlays(Garfield); centerByArray(Garfield, false, false); cntMarker += Garfield.length; map.addOverlays(Hackensack); centerByArray(Hackensack, false, false); cntMarker += Hackensack.length; map.addOverlays(Haworth); centerByArray(Haworth, false, false); cntMarker += Haworth.length; map.addOverlays(Lodi); centerByArray(Lodi, false, false); cntMarker += Lodi.length; map.addOverlays(Montvale); centerByArray(Montvale, false, false); cntMarker += Montvale.length; map.addOverlays(New_Milford); centerByArray(New_Milford, false, false); cntMarker += New_Milford.length; map.addOverlays(North_Arlington); centerByArray(North_Arlington, false, false); cntMarker += North_Arlington.length; map.addOverlays(Oakland); centerByArray(Oakland, false, false); cntMarker += Oakland.length; map.addOverlays(Oradell); centerByArray(Oradell, false, false); cntMarker += Oradell.length; map.addOverlays(Paramus); centerByArray(Paramus, false, false); cntMarker += Paramus.length; map.addOverlays(Paramuus); centerByArray(Paramuus, false, false); cntMarker += Paramuus.length; map.addOverlays(Ramsey); centerByArray(Ramsey, false, false); cntMarker += Ramsey.length; map.addOverlays(Ridgewood); centerByArray(Ridgewood, false, false); cntMarker += Ridgewood.length; map.addOverlays(Rochelle_Park); centerByArray(Rochelle_Park, false, false); cntMarker += Rochelle_Park.length; map.addOverlays(Rutherford); centerByArray(Rutherford, false, false); cntMarker += Rutherford.length; map.addOverlays(Saddle_River); centerByArray(Saddle_River, false, false); cntMarker += Saddle_River.length; map.addOverlays(Teaneck); centerByArray(Teaneck, false, false); cntMarker += Teaneck.length; map.addOverlays(Waldwick); centerByArray(Waldwick, false, false); cntMarker += Waldwick.length; centerByArray(Demarest,true, false); if (cntMarker > 20) // New window depends on whether or not we're on the search page if (location.href.indexOf('schools-by-distance') == -1) window.open(location.href + '/map/all'); else window.open('/search////all'); //window.open('/map.php?type=1&schools=&school_level=2&radius=&zipcode=&school_type_search=&school_type_code='); } } function createMarker(point, label, icon) { var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }