function addMarkers(){ mySelect = document.getElementById('selection'); York = [];Dover = [];Seven_Valleys = [];Delta = [];Dallastown = [];Spring_Grove = [];Hanover = [];Shrewsbury = [];Red_Lion = [];New_Freedom = [];Thomasville = [];Glen_Rock = [];Airville = [];mySelect.options[mySelect.options.length] = new Option("Airville schools",'all=Airville'); mySelect.options[mySelect.options.length] = new Option("Dallastown schools",'all=Dallastown'); mySelect.options[mySelect.options.length] = new Option("Delta schools",'all=Delta'); mySelect.options[mySelect.options.length] = new Option("Dover schools",'all=Dover'); mySelect.options[mySelect.options.length] = new Option("Glen Rock schools",'all=Glen_Rock'); mySelect.options[mySelect.options.length] = new Option("Hanover schools",'all=Hanover'); mySelect.options[mySelect.options.length] = new Option("New Freedom schools",'all=New_Freedom'); mySelect.options[mySelect.options.length] = new Option("Red Lion schools",'all=Red_Lion'); mySelect.options[mySelect.options.length] = new Option("Seven Valleys schools",'all=Seven_Valleys'); mySelect.options[mySelect.options.length] = new Option("Shrewsbury schools",'all=Shrewsbury'); mySelect.options[mySelect.options.length] = new Option("Spring Grove schools",'all=Spring_Grove'); mySelect.options[mySelect.options.length] = new Option("Thomasville schools",'all=Thomasville'); mySelect.options[mySelect.options.length] = new Option("York schools",'all=York'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); York[York.length] = createMarker(new GPoint(-76.67130500,39.96964800),"
1st Church Of Brethren Cdc
2710 Kingston Road
York, PA 17402
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("1st Church Of Brethren Cdc",'York=' + York.length); Dover[Dover.length] = createMarker(new GPoint(-76.88171400,39.97367200),"
Bairs Codorus Mennonite School
5035 Biesecker Road
Dover, PA 17315
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bairs Codorus Mennonite School",'Dover=' + Dover.length); Seven_Valleys[Seven_Valleys.length] = createMarker(new GPoint(-76.79280400,39.83963200),"
Bairs Codorus Mennonite School
2279 Panther Hill Rd
Seven Valleys, PA 17360
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bairs Codorus Mennonite School",'Seven_Valleys=' + Seven_Valleys.length); York[York.length] = createMarker(new GPoint(-76.69961300,39.98115000),"
Bethel Christian Academy
1550 11th Avenue
York, PA 17402
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethel Christian Academy",'York=' + York.length); York[York.length] = createMarker(new GPoint(-76.76728000,40.05067000),"
Bible Baptist Christian Academy
4190 N Susquehanna Trail
York, PA 17404
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bible Baptist Christian Academy",'York=' + York.length); Delta[Delta.length] = createMarker(new GPoint(-76.33850000,39.75230000),"
Blue Bird Meadow School
157 Sinclair Road
Delta, PA 17314
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blue Bird Meadow School",'Delta=' + Delta.length); Delta[Delta.length] = createMarker(new GPoint(-76.29604100,39.77281100),"
Cherry Ridge School
339 Cold Cabin Road
Delta, PA 17314
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cherry Ridge School",'Delta=' + Delta.length); Dallastown[Dallastown.length] = createMarker(new GPoint(-76.64726200,39.90141400),"
Christ Lutheran Child Development Center
126 W Main Street
Dallastown, PA 17313
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ Lutheran Child Development Center",'Dallastown=' + Dallastown.length); York[York.length] = createMarker(new GPoint(-76.76994100,39.99450100),"
Christian School Of York
907 Greenbriar Rd
York, PA 17404
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian School Of York",'York=' + York.length); York[York.length] = createMarker(new GPoint(-76.73822100,39.98830300),"
The Early Learning Center
101 Webster Avenue
York, PA 17404
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Early Learning Center",'York=' + York.length); Spring_Grove[Spring_Grove.length] = createMarker(new GPoint(-76.89678600,39.85735600),"
Garbers Mennonite School
6082 Old Hanover Road
Spring Grove, PA 17362
Co-ed school, 1-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Garbers Mennonite School",'Spring_Grove=' + Spring_Grove.length); York[York.length] = createMarker(new GPoint(-76.63713300,39.96604600),"
Grace Academy For Christian Discipleship
3930 Farm Drive
York, PA 17402
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Academy For Christian Discipleship",'York=' + York.length); Hanover[Hanover.length] = createMarker(new GPoint(-76.97440500,39.81888100),"
Hanover Christian Academy
927 Broadway
Hanover, PA 17331
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hanover Christian Academy",'Hanover=' + Hanover.length); Hanover[Hanover.length] = createMarker(new GPoint(-77.02304800,39.72186300),"
Hanover Mennonite School
190 Maple Grove Road
Hanover, PA 17331
Co-ed school, 1-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hanover Mennonite School",'Hanover=' + Hanover.length); York[York.length] = createMarker(new GPoint(-76.69760300,39.96157000),"
Jack & Jill Nursery & Kindergarten
505 S Ogontz Street
York, PA 17403
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jack & Jill Nursery & Kindergarten",'York=' + York.length); Shrewsbury[Shrewsbury.length] = createMarker(new GPoint(-76.67594200,39.76967800),"
Kiddie Academy Child Care
87 E Forrest Avenue
Shrewsbury, PA 17361
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kiddie Academy Child Care",'Shrewsbury=' + Shrewsbury.length); York[York.length] = createMarker(new GPoint(-76.76275200,39.97740300),"
Kinder Care Learning Center 1284
1540 Rodney Rd
York, PA 17404
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kinder Care Learning Center 1284",'York=' + York.length); York[York.length] = createMarker(new GPoint(-76.67304200,39.97440800),"
Kindercare Learning Center
120 S Northern Way
York, PA 17402
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kindercare Learning Center",'York=' + York.length); Red_Lion[Red_Lion.length] = createMarker(new GPoint(-76.59890000,39.90270000),"
The Light House
Po Box 345 147 First Avenue
Red Lion, PA 17356
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Light House",'Red_Lion=' + Red_Lion.length); York[York.length] = createMarker(new GPoint(-76.72428900,39.96453500),"
Logos Academy
340 E. Market Street, P.O. Box 1272
York, PA 17405
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Logos Academy",'York=' + York.length); York[York.length] = createMarker(new GPoint(-76.77306100,39.97736500),"
Magic Years
1675 Kenneth Rd
York, PA 17404
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Magic Years",'York=' + York.length); Hanover[Hanover.length] = createMarker(new GPoint(-76.98354100,39.79251000),"
Magic Years Child Care And Lrn
500 Boundary Ave
Hanover, PA 17331
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Magic Years Child Care And Lrn",'Hanover=' + Hanover.length); Hanover[Hanover.length] = createMarker(new GPoint(-76.98232700,39.77351700),"
Missionary Bible Baptist Academy
920 Beck Mill Road
Hanover, PA 17331
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Missionary Bible Baptist Academy",'Hanover=' + Hanover.length); York[York.length] = createMarker(new GPoint(-76.65730100,39.98031600),"
Montessori Chldrn High Schoole York
3417 E Market St
York, PA 17402
Co-ed school, 1-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Chldrn High Schoole York",'York=' + York.length); New_Freedom[New_Freedom.length] = createMarker(new GPoint(-76.68190000,39.75050000),"
New Freedom Christian School
Po Box 519
New Freedom, PA 17349
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Freedom Christian School",'New_Freedom=' + New_Freedom.length); Spring_Grove[Spring_Grove.length] = createMarker(new GPoint(-76.91833100,39.88388800),"
Pleasant Hill Christian School
9002 Orchard Road
Spring Grove, PA 17362
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pleasant Hill Christian School",'Spring_Grove=' + Spring_Grove.length); Red_Lion[Red_Lion.length] = createMarker(new GPoint(-76.59429900,39.89018300),"
Red Lion Christian School
105 Springvale Road
Red Lion, PA 17356
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Red Lion Christian School",'Red_Lion=' + Red_Lion.length); Dover[Dover.length] = createMarker(new GPoint(-76.82135500,39.98443200),"
Robins Nest Daycare & Preschool
3350 Alta Vista Road
Dover, PA 17315
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Robins Nest Daycare & Preschool",'Dover=' + Dover.length); York[York.length] = createMarker(new GPoint(-76.66700400,39.97008300),"
St. Joseph School
2945 Kingston Road
York, PA 17402
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph School",'York=' + York.length); Dallastown[Dallastown.length] = createMarker(new GPoint(-76.63844700,39.90013400),"
St. Joseph School
271 E Main Street
Dallastown, PA 17313
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph School",'Dallastown=' + Dallastown.length); York[York.length] = createMarker(new GPoint(-76.72786300,39.95861600),"
St. Patrick School
235 S Beaver Street
York, PA 17401
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Patrick School",'York=' + York.length); Thomasville[Thomasville.length] = createMarker(new GPoint(-76.85875700,39.93157900),"
St. Rose Of Lima School
115 N Biesecker Road
Thomasville, PA 17364
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Rose Of Lima School",'Thomasville=' + Thomasville.length); Hanover[Hanover.length] = createMarker(new GPoint(-76.96676100,39.81729100),"
The Shepherd's Fold
603 Wilson Avenue
Hanover, PA 17331
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Shepherd's Fold",'Hanover=' + Hanover.length); New_Freedom[New_Freedom.length] = createMarker(new GPoint(-76.66437500,39.74685300),"
Shrewsbury Christian Academy
701 Windy Hill Rd
New Freedom, PA 17349
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shrewsbury Christian Academy",'New_Freedom=' + New_Freedom.length); Glen_Rock[Glen_Rock.length] = createMarker(new GPoint(-76.66895200,39.81926900),"
Shrewsbury Dunkard Breth School
1947 Potosi Road
Glen Rock, PA 17327
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shrewsbury Dunkard Breth School",'Glen_Rock=' + Glen_Rock.length); Airville[Airville.length] = createMarker(new GPoint(-76.37737400,39.79625600),"
Singing Meadow Amish School
33 Parlett Road Fisher
Airville, PA 17302
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Singing Meadow Amish School",'Airville=' + Airville.length); York[York.length] = createMarker(new GPoint(-76.66657500,39.95943900),"
Small Steps Day Care School
1050 Plymouth Road
York, PA 17402
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Small Steps Day Care School",'York=' + York.length); York[York.length] = createMarker(new GPoint(-76.68070300,39.90886000),"
Small Steps Daycare School South
2709 S Queen Street
York, PA 17403
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Small Steps Daycare School South",'York=' + York.length); Spring_Grove[Spring_Grove.length] = createMarker(new GPoint(-76.86493300,39.88437400),"
Small World Day Care Center
41 Roth Church Road
Spring Grove, PA 17362
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Small World Day Care Center",'Spring_Grove=' + Spring_Grove.length); York[York.length] = createMarker(new GPoint(-76.67630300,39.95878800),"
St John Lutheran School
2580 Mount Rose Avenue
York, PA 17402
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John Lutheran School",'York=' + York.length); Hanover[Hanover.length] = createMarker(new GPoint(-76.98015100,39.79785500),"
St Joseph School
236 Baltimore Street
Hanover, PA 17331
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Joseph School",'Hanover=' + Hanover.length); Hanover[Hanover.length] = createMarker(new GPoint(-76.99551100,39.80463200),"
St Vincent De Paul School
224 3rd Street
Hanover, PA 17331
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Vincent De Paul School",'Hanover=' + Hanover.length); York[York.length] = createMarker(new GPoint(-76.74974300,40.00304000),"
Stillmeadow Nazarene Ccc
400 Stillmeadow Lane
York, PA 17404
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Stillmeadow Nazarene Ccc",'York=' + York.length); Airville[Airville.length] = createMarker(new GPoint(-76.40850000,39.80740000),"
Sunnyburn School
33 Parlett Road
Airville, PA 17302
school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sunnyburn School",'Airville=' + Airville.length); York[York.length] = createMarker(new GPoint(-76.71987500,39.96255300),"
Tidings of Peace Christian School
329 E. Poplar Street
York, PA 17403
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tidings of Peace Christian School",'York=' + York.length); York[York.length] = createMarker(new GPoint(-76.70923400,39.87584000),"
Tlc Montessori
6434 Susquehanna Trail
York, PA 17407
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tlc Montessori",'York=' + York.length); Hanover[Hanover.length] = createMarker(new GPoint(-76.96039900,39.75959200),"
West Manheim Little People Day
71 Fairview Drive
Hanover, PA 17331
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Manheim Little People Day",'Hanover=' + Hanover.length); York[York.length] = createMarker(new GPoint(-76.73548700,39.96147100),"
Ymca Of York Learning Center
90 N Newberry St
York, PA 17401
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ymca Of York Learning Center",'York=' + York.length); York[York.length] = createMarker(new GPoint(-76.74312600,39.94000400),"
York Country Day School
1071 Regents Glen Blvd
York, PA 17403
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("York Country Day School",'York=' + York.length); York[York.length] = createMarker(new GPoint(-76.71822900,39.96737100),"
York Day Nursery And Kindergar
450 East Philadelphia Street
York, PA 17403
Co-ed school, KG-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("York Day Nursery And Kindergar",'York=' + York.length); York[York.length] = createMarker(new GPoint(-76.66434500,39.96046000),"
York Little People Day Care School
2850 Carol Road
York, PA 17402
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("York Little People Day Care School",'York=' + York.length); York[York.length] = createMarker(new GPoint(-76.78394900,39.98683700),"
York Sda Church School
2220 Roosevelt Avenue
York, PA 17404
Co-ed school, K-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("York Sda Church School",'York=' + York.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/////1/' + showArray); map.removeOverlays(Airville); map.removeOverlays(Dallastown); map.removeOverlays(Delta); map.removeOverlays(Dover); map.removeOverlays(Glen_Rock); map.removeOverlays(Hanover); map.removeOverlays(New_Freedom); map.removeOverlays(Red_Lion); map.removeOverlays(Seven_Valleys); map.removeOverlays(Shrewsbury); map.removeOverlays(Spring_Grove); map.removeOverlays(Thomasville); map.removeOverlays(York); 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(York);map.removeOverlays(Airville); map.removeOverlays(Dallastown); map.removeOverlays(Delta); map.removeOverlays(Dover); map.removeOverlays(Glen_Rock); map.removeOverlays(Hanover); map.removeOverlays(New_Freedom); map.removeOverlays(Red_Lion); map.removeOverlays(Seven_Valleys); map.removeOverlays(Shrewsbury); map.removeOverlays(Spring_Grove); map.removeOverlays(Thomasville); map.removeOverlays(York); map.addOverlays(Airville); centerByArray(Airville, false, false); cntMarker += Airville.length; map.addOverlays(Dallastown); centerByArray(Dallastown, false, false); cntMarker += Dallastown.length; map.addOverlays(Delta); centerByArray(Delta, false, false); cntMarker += Delta.length; map.addOverlays(Dover); centerByArray(Dover, false, false); cntMarker += Dover.length; map.addOverlays(Glen_Rock); centerByArray(Glen_Rock, false, false); cntMarker += Glen_Rock.length; map.addOverlays(Hanover); centerByArray(Hanover, false, false); cntMarker += Hanover.length; map.addOverlays(New_Freedom); centerByArray(New_Freedom, false, false); cntMarker += New_Freedom.length; map.addOverlays(Red_Lion); centerByArray(Red_Lion, false, false); cntMarker += Red_Lion.length; map.addOverlays(Seven_Valleys); centerByArray(Seven_Valleys, false, false); cntMarker += Seven_Valleys.length; map.addOverlays(Shrewsbury); centerByArray(Shrewsbury, false, false); cntMarker += Shrewsbury.length; map.addOverlays(Spring_Grove); centerByArray(Spring_Grove, false, false); cntMarker += Spring_Grove.length; map.addOverlays(Thomasville); centerByArray(Thomasville, false, false); cntMarker += Thomasville.length; map.addOverlays(York); centerByArray(York, false, false); cntMarker += York.length; centerByArray(York,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=1&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; }