function addMarkers(){ mySelect = document.getElementById('selection'); Cape_Elizabeth = [];Steep_Falls = [];North_Yarmouth = [];Portland = [];South_Portland = [];Falmouth = [];Brunswick = [];Freeport = [];Bridgton = [];Raymond = [];Westbrook = [];South_Freeport = [];New_Gloucester = [];West_Baldwin = [];Yarmouth = [];Casco = [];Scarborough = [];Gorham = [];Windham = [];mySelect.options[mySelect.options.length] = new Option("Bridgton schools",'all=Bridgton'); mySelect.options[mySelect.options.length] = new Option("Brunswick schools",'all=Brunswick'); mySelect.options[mySelect.options.length] = new Option("Cape Elizabeth schools",'all=Cape_Elizabeth'); mySelect.options[mySelect.options.length] = new Option("Casco schools",'all=Casco'); mySelect.options[mySelect.options.length] = new Option("Falmouth schools",'all=Falmouth'); mySelect.options[mySelect.options.length] = new Option("Freeport schools",'all=Freeport'); mySelect.options[mySelect.options.length] = new Option("Gorham schools",'all=Gorham'); mySelect.options[mySelect.options.length] = new Option("New Gloucester schools",'all=New_Gloucester'); mySelect.options[mySelect.options.length] = new Option("North Yarmouth schools",'all=North_Yarmouth'); mySelect.options[mySelect.options.length] = new Option("Portland schools",'all=Portland'); mySelect.options[mySelect.options.length] = new Option("Raymond schools",'all=Raymond'); mySelect.options[mySelect.options.length] = new Option("Scarborough schools",'all=Scarborough'); mySelect.options[mySelect.options.length] = new Option("South Freeport schools",'all=South_Freeport'); mySelect.options[mySelect.options.length] = new Option("South Portland schools",'all=South_Portland'); mySelect.options[mySelect.options.length] = new Option("Steep Falls schools",'all=Steep_Falls'); mySelect.options[mySelect.options.length] = new Option("West Baldwin schools",'all=West_Baldwin'); mySelect.options[mySelect.options.length] = new Option("Westbrook schools",'all=Westbrook'); mySelect.options[mySelect.options.length] = new Option("Windham schools",'all=Windham'); mySelect.options[mySelect.options.length] = new Option("Yarmouth schools",'all=Yarmouth'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Cape_Elizabeth[Cape_Elizabeth.length] = createMarker(new GPoint(-70.21868900,43.56971200),"
Appletree School
44 Two Lights Road
Cape Elizabeth, ME 04107
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Appletree School",'Cape_Elizabeth=' + Cape_Elizabeth.length); Cape_Elizabeth[Cape_Elizabeth.length] = createMarker(new GPoint(-70.24662400,43.61886500),"
Aucocisco School
126 Spurwink Avenue
Cape Elizabeth, ME 04107
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aucocisco School",'Cape_Elizabeth=' + Cape_Elizabeth.length); Steep_Falls[Steep_Falls.length] = createMarker(new GPoint(-70.63850000,43.76690000),"
Berean Christian Academy
Po Box 22
Steep Falls, ME 04085
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Berean Christian Academy",'Steep_Falls=' + Steep_Falls.length); North_Yarmouth[North_Yarmouth.length] = createMarker(new GPoint(-70.22042600,43.85500300),"
Brailsford School
512 Memorial Hwy
North Yarmouth, ME 04097
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brailsford School",'North_Yarmouth=' + North_Yarmouth.length); Portland[Portland.length] = createMarker(new GPoint(-70.31355500,43.67273600),"
Breakwater School
856 Brighton Avenue
Portland, ME 04102
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Breakwater School",'Portland=' + Portland.length); South_Portland[South_Portland.length] = createMarker(new GPoint(-70.25038700,43.62699500),"
Casco Bay Montessori School
440 Ocean Street
South Portland, ME 04106
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Casco Bay Montessori School",'South_Portland=' + South_Portland.length); Portland[Portland.length] = createMarker(new GPoint(-70.25337500,43.66167500),"
Cathedral School
14 Locust Street
Portland, ME 04101
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cathedral School",'Portland=' + Portland.length); Falmouth[Falmouth.length] = createMarker(new GPoint(-70.29933200,43.75115500),"
Children's Odyssey
196 Gray Road
Falmouth, ME 04105
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Children's Odyssey",'Falmouth=' + Falmouth.length); Portland[Portland.length] = createMarker(new GPoint(-70.29362600,43.68315100),"
Childrens Center
721 Stevens Avenue
Portland, ME 04103
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Childrens Center",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-70.29362600,43.68315100),"
The Childrens Center
721 Stevens Avenue
Portland, ME 04103
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Childrens Center",'Portland=' + Portland.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-69.87835700,43.90720400),"
Childrens School Of Arts &science
185 Harding Rd
Brunswick, ME 04011
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Childrens School Of Arts &science",'Brunswick=' + Brunswick.length); Freeport[Freeport.length] = createMarker(new GPoint(-70.11124600,43.85078600),"
Cricket Hunt School
40 Independence Drive
Freeport, ME 04032
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cricket Hunt School",'Freeport=' + Freeport.length); Bridgton[Bridgton.length] = createMarker(new GPoint(-70.71020000,44.05764000),"
Dodge House
11 Wayside Avenue
Bridgton, ME 04009
Co-ed school, 3-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dodge House",'Bridgton=' + Bridgton.length); Portland[Portland.length] = createMarker(new GPoint(-70.25665400,43.65914500),"
East School
Po Box 15336
Portland, ME 04112
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East School",'Portland=' + Portland.length); Falmouth[Falmouth.length] = createMarker(new GPoint(-70.23458700,43.68942800),"
Friends School of Portland
1 Mackworth Island
Falmouth, ME 04105
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Friends School of Portland",'Falmouth=' + Falmouth.length); Raymond[Raymond.length] = createMarker(new GPoint(-70.49637700,43.90848700),"
Future Builder's Inc
Po Box 272
Raymond, ME 04071
Co-ed school, 8-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Future Builder's Inc",'Raymond=' + Raymond.length); Portland[Portland.length] = createMarker(new GPoint(-70.29615100,43.71826200),"
Grace Baptist Church School
476 Summit Street
Portland, ME 04103
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Baptist Church School",'Portland=' + Portland.length); South_Portland[South_Portland.length] = createMarker(new GPoint(-70.28770900,43.62979200),"
Greater Portland Christian School
1338 Broadway
South Portland, ME 04106
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greater Portland Christian School",'South_Portland=' + South_Portland.length); Westbrook[Westbrook.length] = createMarker(new GPoint(-70.35600200,43.64640300),"
Koala Child Kare
969 Spring St
Westbrook, ME 04092
Co-ed school, -
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Koala Child Kare",'Westbrook=' + Westbrook.length); South_Freeport[South_Freeport.length] = createMarker(new GPoint(-70.11054000,43.82042900),"
L'ecole Francaise Du Maine
Po Box 737
South Freeport, ME 04078
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("L'ecole Francaise Du Maine",'South_Freeport=' + South_Freeport.length); Cape_Elizabeth[Cape_Elizabeth.length] = createMarker(new GPoint(-70.23355000,43.62517800),"
Ledgemere Country Day School
243 Mitchell Road
Cape Elizabeth, ME 04107
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ledgemere Country Day School",'Cape_Elizabeth=' + Cape_Elizabeth.length); Portland[Portland.length] = createMarker(new GPoint(-70.28340500,43.66575600),"
Levey Day School
400 Deering Avenue
Portland, ME 04103
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Levey Day School",'Portland=' + Portland.length); South_Portland[South_Portland.length] = createMarker(new GPoint(-70.26538600,43.62324800),"
Lighthouse School
525 Highland Ave
South Portland, ME 04106
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lighthouse School",'South_Portland=' + South_Portland.length); Westbrook[Westbrook.length] = createMarker(new GPoint(-70.34696400,43.65054000),"
Little Dolphin School
101 County Rd
Westbrook, ME 04092
Co-ed school, K-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Dolphin School",'Westbrook=' + Westbrook.length); Westbrook[Westbrook.length] = createMarker(new GPoint(-70.34758900,43.65050400),"
The Little Dolphin School Foundation
101 County Road
Westbrook, ME 04092
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Little Dolphin School Foundation",'Westbrook=' + Westbrook.length); Freeport[Freeport.length] = createMarker(new GPoint(-70.10320000,43.85630000),"
Maine Classical School
P.O. Box 243
Freeport, ME 04032
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Maine Classical School",'Freeport=' + Freeport.length); Freeport[Freeport.length] = createMarker(new GPoint(-70.14300100,43.85352900),"
Merriconeag Waldorf School
57 Desert Road
Freeport, ME 04032
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Merriconeag Waldorf School",'Freeport=' + Freeport.length); New_Gloucester[New_Gloucester.length] = createMarker(new GPoint(-70.25506900,43.90369700),"
Msemhc-collaborative School
41 Pineland Drive
New Gloucester, ME 04260
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Msemhc-collaborative School",'New_Gloucester=' + New_Gloucester.length); West_Baldwin[West_Baldwin.length] = createMarker(new GPoint(-70.77780100,43.83214500),"
New Country School
969 Pequawket Trail Rt 113
West Baldwin, ME 04091
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Country School",'West_Baldwin=' + West_Baldwin.length); Yarmouth[Yarmouth.length] = createMarker(new GPoint(-70.18481000,43.79966800),"
North Yarmouth Academy
148 Main St
Yarmouth, ME 04096
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Yarmouth Academy",'Yarmouth=' + Yarmouth.length); Falmouth[Falmouth.length] = createMarker(new GPoint(-70.23110400,43.71163000),"
Pine Grove Child Development Center
32 Foreside Road
Falmouth, ME 04105
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pine Grove Child Development Center",'Falmouth=' + Falmouth.length); Freeport[Freeport.length] = createMarker(new GPoint(-70.11317000,43.86310900),"
Pine Tree Academy
67 Pownal Road
Freeport, ME 04032
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pine Tree Academy",'Freeport=' + Freeport.length); North_Yarmouth[North_Yarmouth.length] = createMarker(new GPoint(-70.24708900,43.82504100),"
Red House Montessori School
392 Walnut Hill Rd
North Yarmouth, ME 04097
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Red House Montessori School",'North_Yarmouth=' + North_Yarmouth.length); Portland[Portland.length] = createMarker(new GPoint(-70.26129000,43.65300200),"
St. Elizabeth's Child Development
87 High St.
Portland, ME 04101
Co-ed school, PK-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Elizabeth's Child Development",'Portland=' + Portland.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-69.96883400,43.91357800),"
St. John's Catholic School
37 Pleasant Street
Brunswick, ME 04011
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John's Catholic School",'Brunswick=' + Brunswick.length); Portland[Portland.length] = createMarker(new GPoint(-70.29375300,43.68224600),"
St. Joseph's Parish School
695 Stevens Avenue
Portland, ME 04103
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph's Parish School",'Portland=' + Portland.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-70.05861600,43.90058100),"
Spurwink Brunswick Staff Secure
675 Old Portland Road
Brunswick, ME 04011
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Spurwink Brunswick Staff Secure",'Brunswick=' + Brunswick.length); Portland[Portland.length] = createMarker(new GPoint(-70.31912600,43.70523800),"
Spurwink School
899 Riverside Street
Portland, ME 04103
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Spurwink School",'Portland=' + Portland.length); Casco[Casco.length] = createMarker(new GPoint(-70.49907000,43.95080800),"
Spurwink School--casco
Po Box 249 1002 Meadow Road
Casco, ME 04015
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Spurwink School--casco",'Casco=' + Casco.length); Portland[Portland.length] = createMarker(new GPoint(-70.29115400,43.65783500),"
St Patrick S School
1251 Congress Street
Portland, ME 04102
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Patrick S School",'Portland=' + Portland.length); Scarborough[Scarborough.length] = createMarker(new GPoint(-70.35781800,43.57956700),"
Toddle Inn Child Care
9 Lincoln Avenue
Scarborough, ME 04074
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Toddle Inn Child Care",'Scarborough=' + Scarborough.length); Gorham[Gorham.length] = createMarker(new GPoint(-70.41637300,43.68264800),"
Toddle Inn-gorham
79 Libby Avenue
Gorham, ME 04038
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Toddle Inn-gorham",'Gorham=' + Gorham.length); Portland[Portland.length] = createMarker(new GPoint(-70.27096200,43.64639100),"
Waynflete School
360 Spring Street
Portland, ME 04102
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Waynflete School",'Portland=' + Portland.length); Windham[Windham.length] = createMarker(new GPoint(-70.46606200,43.86438500),"
Windham Christian Academy
1051 Roosevelt Trail
Windham, ME 04062
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Windham Christian Academy",'Windham=' + Windham.length); Falmouth[Falmouth.length] = createMarker(new GPoint(-70.27530900,43.76109600),"
Winfield Children's House
161 Field Road
Falmouth, ME 04105
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Winfield Children's House",'Falmouth=' + Falmouth.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(Bridgton); map.removeOverlays(Brunswick); map.removeOverlays(Cape_Elizabeth); map.removeOverlays(Casco); map.removeOverlays(Falmouth); map.removeOverlays(Freeport); map.removeOverlays(Gorham); map.removeOverlays(New_Gloucester); map.removeOverlays(North_Yarmouth); map.removeOverlays(Portland); map.removeOverlays(Raymond); map.removeOverlays(Scarborough); map.removeOverlays(South_Freeport); map.removeOverlays(South_Portland); map.removeOverlays(Steep_Falls); map.removeOverlays(West_Baldwin); map.removeOverlays(Westbrook); map.removeOverlays(Windham); map.removeOverlays(Yarmouth); 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(Cape_Elizabeth);map.removeOverlays(Bridgton); map.removeOverlays(Brunswick); map.removeOverlays(Cape_Elizabeth); map.removeOverlays(Casco); map.removeOverlays(Falmouth); map.removeOverlays(Freeport); map.removeOverlays(Gorham); map.removeOverlays(New_Gloucester); map.removeOverlays(North_Yarmouth); map.removeOverlays(Portland); map.removeOverlays(Raymond); map.removeOverlays(Scarborough); map.removeOverlays(South_Freeport); map.removeOverlays(South_Portland); map.removeOverlays(Steep_Falls); map.removeOverlays(West_Baldwin); map.removeOverlays(Westbrook); map.removeOverlays(Windham); map.removeOverlays(Yarmouth); map.addOverlays(Bridgton); centerByArray(Bridgton, false, false); cntMarker += Bridgton.length; map.addOverlays(Brunswick); centerByArray(Brunswick, false, false); cntMarker += Brunswick.length; map.addOverlays(Cape_Elizabeth); centerByArray(Cape_Elizabeth, false, false); cntMarker += Cape_Elizabeth.length; map.addOverlays(Casco); centerByArray(Casco, false, false); cntMarker += Casco.length; map.addOverlays(Falmouth); centerByArray(Falmouth, false, false); cntMarker += Falmouth.length; map.addOverlays(Freeport); centerByArray(Freeport, false, false); cntMarker += Freeport.length; map.addOverlays(Gorham); centerByArray(Gorham, false, false); cntMarker += Gorham.length; map.addOverlays(New_Gloucester); centerByArray(New_Gloucester, false, false); cntMarker += New_Gloucester.length; map.addOverlays(North_Yarmouth); centerByArray(North_Yarmouth, false, false); cntMarker += North_Yarmouth.length; map.addOverlays(Portland); centerByArray(Portland, false, false); cntMarker += Portland.length; map.addOverlays(Raymond); centerByArray(Raymond, false, false); cntMarker += Raymond.length; map.addOverlays(Scarborough); centerByArray(Scarborough, false, false); cntMarker += Scarborough.length; map.addOverlays(South_Freeport); centerByArray(South_Freeport, false, false); cntMarker += South_Freeport.length; map.addOverlays(South_Portland); centerByArray(South_Portland, false, false); cntMarker += South_Portland.length; map.addOverlays(Steep_Falls); centerByArray(Steep_Falls, false, false); cntMarker += Steep_Falls.length; map.addOverlays(West_Baldwin); centerByArray(West_Baldwin, false, false); cntMarker += West_Baldwin.length; map.addOverlays(Westbrook); centerByArray(Westbrook, false, false); cntMarker += Westbrook.length; map.addOverlays(Windham); centerByArray(Windham, false, false); cntMarker += Windham.length; map.addOverlays(Yarmouth); centerByArray(Yarmouth, false, false); cntMarker += Yarmouth.length; centerByArray(Cape_Elizabeth,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; }