function addMarkers(){
mySelect = document.getElementById('selection');
Vista = [];Carmel = [];San_Diego = [];La_Jolla = [];North_Hollywood = [];San_Francisco = [];Irvine = [];Coronado = [];Sierra_Madre = [];Saratoga = [];La_Mesa = [];Norwalk = [];Laguna_Hills = [];Rancho_Santa_Margarita = [];San_Juan_Capistrano = [];Palm_Desert = [];Upland = [];Altadena = [];Winnetka = [];San_Mateo = [];Pacific_Palisades = [];Carmichael = [];Visalia = [];San_Jose = [];Apple_Valley = [];Foster_City = [];South_Pasadena = [];Roseville = [];Chula_Vista = [];Downey = [];Newport_Beach = [];San_Clemente = [];Thousand_Oaks = [];Oakland = [];Compton = [];Menlo_Park = [];Monterey = [];mySelect.options[mySelect.options.length] = new Option("Altadena schools",'all=Altadena');
mySelect.options[mySelect.options.length] = new Option("Apple Valley schools",'all=Apple_Valley');
mySelect.options[mySelect.options.length] = new Option("Carmel schools",'all=Carmel');
mySelect.options[mySelect.options.length] = new Option("Carmichael schools",'all=Carmichael');
mySelect.options[mySelect.options.length] = new Option("Chula Vista schools",'all=Chula_Vista');
mySelect.options[mySelect.options.length] = new Option("Compton schools",'all=Compton');
mySelect.options[mySelect.options.length] = new Option("Coronado schools",'all=Coronado');
mySelect.options[mySelect.options.length] = new Option("Downey schools",'all=Downey');
mySelect.options[mySelect.options.length] = new Option("Foster City schools",'all=Foster_City');
mySelect.options[mySelect.options.length] = new Option("Irvine schools",'all=Irvine');
mySelect.options[mySelect.options.length] = new Option("La Jolla schools",'all=La_Jolla');
mySelect.options[mySelect.options.length] = new Option("La Mesa schools",'all=La_Mesa');
mySelect.options[mySelect.options.length] = new Option("Laguna Hills schools",'all=Laguna_Hills');
mySelect.options[mySelect.options.length] = new Option("Menlo Park schools",'all=Menlo_Park');
mySelect.options[mySelect.options.length] = new Option("Monterey schools",'all=Monterey');
mySelect.options[mySelect.options.length] = new Option("Newport Beach schools",'all=Newport_Beach');
mySelect.options[mySelect.options.length] = new Option("North Hollywood schools",'all=North_Hollywood');
mySelect.options[mySelect.options.length] = new Option("Norwalk schools",'all=Norwalk');
mySelect.options[mySelect.options.length] = new Option("Oakland schools",'all=Oakland');
mySelect.options[mySelect.options.length] = new Option("Pacific Palisades schools",'all=Pacific_Palisades');
mySelect.options[mySelect.options.length] = new Option("Palm Desert schools",'all=Palm_Desert');
mySelect.options[mySelect.options.length] = new Option("Rancho Santa Margarita schools",'all=Rancho_Santa_Margarita');
mySelect.options[mySelect.options.length] = new Option("Roseville schools",'all=Roseville');
mySelect.options[mySelect.options.length] = new Option("San Clemente schools",'all=San_Clemente');
mySelect.options[mySelect.options.length] = new Option("San Diego schools",'all=San_Diego');
mySelect.options[mySelect.options.length] = new Option("San Francisco schools",'all=San_Francisco');
mySelect.options[mySelect.options.length] = new Option("San Jose schools",'all=San_Jose');
mySelect.options[mySelect.options.length] = new Option("San Juan Capistrano schools",'all=San_Juan_Capistrano');
mySelect.options[mySelect.options.length] = new Option("San Mateo schools",'all=San_Mateo');
mySelect.options[mySelect.options.length] = new Option("Saratoga schools",'all=Saratoga');
mySelect.options[mySelect.options.length] = new Option("Sierra Madre schools",'all=Sierra_Madre');
mySelect.options[mySelect.options.length] = new Option("South Pasadena schools",'all=South_Pasadena');
mySelect.options[mySelect.options.length] = new Option("Thousand Oaks schools",'all=Thousand_Oaks');
mySelect.options[mySelect.options.length] = new Option("Upland schools",'all=Upland');
mySelect.options[mySelect.options.length] = new Option("Visalia schools",'all=Visalia');
mySelect.options[mySelect.options.length] = new Option("Vista schools",'all=Vista');
mySelect.options[mySelect.options.length] = new Option("Winnetka schools",'all=Winnetka');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Vista[Vista.length] = createMarker(new GPoint(-117.23433000,33.20201800),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("All Saints Preschool",'Vista=' + Vista.length);
Carmel[Carmel.length] = createMarker(new GPoint(-121.83476700,36.53088200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("All Saints' Episcopal Day School",'Carmel=' + Carmel.length);
San_Diego[San_Diego.length] = createMarker(new GPoint(-117.15850400,32.74479700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("All Saints' Episcopal Preschool",'San_Diego=' + San_Diego.length);
La_Jolla[La_Jolla.length] = createMarker(new GPoint(-117.27939000,32.84145700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Bishop's School",'La_Jolla=' + La_Jolla.length);
North_Hollywood[North_Hollywood.length] = createMarker(new GPoint(-118.39663200,34.15299200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Campbell Hall School",'North_Hollywood=' + North_Hollywood.length);
San_Francisco[San_Francisco.length] = createMarker(new GPoint(-122.41377500,37.79227700),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Cathedral School For Boys",'San_Francisco=' + San_Francisco.length);
Irvine[Irvine.length] = createMarker(new GPoint(-117.80227100,33.68037900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Children's Center Of St An",'Irvine=' + Irvine.length);
Coronado[Coronado.length] = createMarker(new GPoint(-117.17720000,32.68390000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Christ Church Day School",'Coronado=' + Coronado.length);
Sierra_Madre[Sierra_Madre.length] = createMarker(new GPoint(-118.05233300,34.16525100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Gooden School",'Sierra_Madre=' + Sierra_Madre.length);
North_Hollywood[North_Hollywood.length] = createMarker(new GPoint(-118.41263200,34.13785000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Harvard-westlake School",'North_Hollywood=' + North_Hollywood.length);
Saratoga[Saratoga.length] = createMarker(new GPoint(-122.01480900,37.27134300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Saint Andrew's Episcopal School",'Saratoga=' + Saratoga.length);
La_Mesa[La_Mesa.length] = createMarker(new GPoint(-117.00906200,32.76655400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Andrews Episcopal Parish Da",'La_Mesa=' + La_Mesa.length);
Norwalk[Norwalk.length] = createMarker(new GPoint(-118.07676200,33.91694300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. E Childcare Center",'Norwalk=' + Norwalk.length);
Laguna_Hills[Laguna_Hills.length] = createMarker(new GPoint(-117.71116800,33.61665100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. George S Academy",'Laguna_Hills=' + Laguna_Hills.length);
Rancho_Santa_Margarita[Rancho_Santa_Margarita.length] = createMarker(new GPoint(-117.60041600,33.64457400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. John's Episcopal School",'Rancho_Santa_Margarita=' + Rancho_Santa_Margarita.length);
San_Juan_Capistrano[San_Juan_Capistrano.length] = createMarker(new GPoint(-117.64808600,33.50254600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Margaret S Episcopal School",'San_Juan_Capistrano=' + San_Juan_Capistrano.length);
Palm_Desert[Palm_Desert.length] = createMarker(new GPoint(-116.39116900,33.71869000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Margaret's Episcopal School",'Palm_Desert=' + Palm_Desert.length);
Upland[Upland.length] = createMarker(new GPoint(-117.64661700,34.12138700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Mark's Episcopal School",'Upland=' + Upland.length);
Altadena[Altadena.length] = createMarker(new GPoint(-118.12911000,34.19021200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Mark's School",'Altadena=' + Altadena.length);
Winnetka[Winnetka.length] = createMarker(new GPoint(-118.57083300,34.19987700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Martin Fields Parish School",'Winnetka=' + Winnetka.length);
San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.32768700,37.56547200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Matthew's Episcopal Day School",'San_Mateo=' + San_Mateo.length);
Pacific_Palisades[Pacific_Palisades.length] = createMarker(new GPoint(-118.54125000,34.05312000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Matthews Parish School",'Pacific_Palisades=' + Pacific_Palisades.length);
Carmichael[Carmichael.length] = createMarker(new GPoint(-121.35511400,38.60387800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Michael's Episcopal Day School",'Carmichael=' + Carmichael.length);
Visalia[Visalia.length] = createMarker(new GPoint(-119.35861500,36.34176300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Pauls School",'Visalia=' + Visalia.length);
San_Jose[San_Jose.length] = createMarker(new GPoint(-121.83087200,37.24116300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Stephens Episcopal School",'San_Jose=' + San_Jose.length);
Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-117.24184700,34.53795800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Timothy's Preparatory School",'Apple_Valley=' + Apple_Valley.length);
Foster_City[Foster_City.length] = createMarker(new GPoint(-122.27238400,37.54544500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Ambrose Sea Breeze School",'Foster_City=' + Foster_City.length);
Carmel[Carmel.length] = createMarker(new GPoint(-121.80600800,36.52038500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Dunstan's Episcopal School",'Carmel=' + Carmel.length);
South_Pasadena[South_Pasadena.length] = createMarker(new GPoint(-118.15384400,34.11190000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St James Parish Day School & Kindergarten",'South_Pasadena=' + South_Pasadena.length);
Roseville[Roseville.length] = createMarker(new GPoint(-121.37092300,38.77795400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St John's School",'Roseville=' + Roseville.length);
Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.06561900,32.62744000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St John's Episcopal School",'Chula_Vista=' + Chula_Vista.length);
Downey[Downey.length] = createMarker(new GPoint(-118.12682400,33.94966200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Mark's Episcopal School",'Downey=' + Downey.length);
Newport_Beach[Newport_Beach.length] = createMarker(new GPoint(-117.84925500,33.62738900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Matthews Montessori School",'Newport_Beach=' + Newport_Beach.length);
San_Clemente[San_Clemente.length] = createMarker(new GPoint(-117.61750700,33.42933900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Michael's Academy",'San_Clemente=' + San_Clemente.length);
Thousand_Oaks[Thousand_Oaks.length] = createMarker(new GPoint(-118.84989300,34.20023700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Patrick's Episcopal Day School",'Thousand_Oaks=' + Thousand_Oaks.length);
Oakland[Oakland.length] = createMarker(new GPoint(-122.26014700,37.81146200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Pauls Episcopal School",'Oakland=' + Oakland.length);
Compton[Compton.length] = createMarker(new GPoint(-118.22843400,33.89387500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Timothys Episcopal School",'Compton=' + Compton.length);
Menlo_Park[Menlo_Park.length] = createMarker(new GPoint(-122.20871500,37.42080900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Trinity School",'Menlo_Park=' + Menlo_Park.length);
Monterey[Monterey.length] = createMarker(new GPoint(-121.79409200,36.57576500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("York School",'Monterey=' + Monterey.length);
map.removeOverlays(Altadena);
map.removeOverlays(Apple_Valley);
map.removeOverlays(Carmel);
map.removeOverlays(Carmichael);
map.removeOverlays(Chula_Vista);
map.removeOverlays(Compton);
map.removeOverlays(Coronado);
map.removeOverlays(Downey);
map.removeOverlays(Foster_City);
map.removeOverlays(Irvine);
map.removeOverlays(La_Jolla);
map.removeOverlays(La_Mesa);
map.removeOverlays(Laguna_Hills);
map.removeOverlays(Menlo_Park);
map.removeOverlays(Monterey);
map.removeOverlays(Newport_Beach);
map.removeOverlays(North_Hollywood);
map.removeOverlays(Norwalk);
map.removeOverlays(Oakland);
map.removeOverlays(Pacific_Palisades);
map.removeOverlays(Palm_Desert);
map.removeOverlays(Rancho_Santa_Margarita);
map.removeOverlays(Roseville);
map.removeOverlays(San_Clemente);
map.removeOverlays(San_Diego);
map.removeOverlays(San_Francisco);
map.removeOverlays(San_Jose);
map.removeOverlays(San_Juan_Capistrano);
map.removeOverlays(San_Mateo);
map.removeOverlays(Saratoga);
map.removeOverlays(Sierra_Madre);
map.removeOverlays(South_Pasadena);
map.removeOverlays(Thousand_Oaks);
map.removeOverlays(Upland);
map.removeOverlays(Visalia);
map.removeOverlays(Vista);
map.removeOverlays(Winnetka);
setTimeout(function(){map.addOverlays(Altadena)},1000);
setTimeout(function(){map.addOverlays(Apple_Valley)},1000);
setTimeout(function(){map.addOverlays(Carmel)},1000);
setTimeout(function(){map.addOverlays(Carmichael)},1000);
setTimeout(function(){map.addOverlays(Chula_Vista)},1000);
setTimeout(function(){map.addOverlays(Compton)},1000);
setTimeout(function(){map.addOverlays(Coronado)},1000);
setTimeout(function(){map.addOverlays(Downey)},1000);
setTimeout(function(){map.addOverlays(Foster_City)},1000);
setTimeout(function(){map.addOverlays(Irvine)},1000);
setTimeout(function(){map.addOverlays(La_Jolla)},1000);
setTimeout(function(){map.addOverlays(La_Mesa)},1000);
setTimeout(function(){map.addOverlays(Laguna_Hills)},1000);
setTimeout(function(){map.addOverlays(Menlo_Park)},1000);
setTimeout(function(){map.addOverlays(Monterey)},1000);
setTimeout(function(){map.addOverlays(Newport_Beach)},1000);
setTimeout(function(){map.addOverlays(North_Hollywood)},1000);
setTimeout(function(){map.addOverlays(Norwalk)},1000);
setTimeout(function(){map.addOverlays(Oakland)},1000);
setTimeout(function(){map.addOverlays(Pacific_Palisades)},1000);
setTimeout(function(){map.addOverlays(Palm_Desert)},1000);
setTimeout(function(){map.addOverlays(Rancho_Santa_Margarita)},1000);
setTimeout(function(){map.addOverlays(Roseville)},1000);
setTimeout(function(){map.addOverlays(San_Clemente)},1000);
setTimeout(function(){map.addOverlays(San_Diego)},1000);
setTimeout(function(){map.addOverlays(San_Francisco)},1000);
setTimeout(function(){map.addOverlays(San_Jose)},1000);
setTimeout(function(){map.addOverlays(San_Juan_Capistrano)},1000);
setTimeout(function(){map.addOverlays(San_Mateo)},1000);
setTimeout(function(){map.addOverlays(Saratoga)},1000);
setTimeout(function(){map.addOverlays(Sierra_Madre)},1000);
setTimeout(function(){map.addOverlays(South_Pasadena)},1000);
setTimeout(function(){map.addOverlays(Thousand_Oaks)},1000);
setTimeout(function(){map.addOverlays(Upland)},1000);
setTimeout(function(){map.addOverlays(Visalia)},1000);
setTimeout(function(){map.addOverlays(Vista)},1000);
setTimeout(function(){map.addOverlays(Winnetka)},1000);
maxLng = -116.39116900;
maxLat = 38.77795400;
minLng = -122.41377500;
minLat = 32.62744000;
reCenterMap();
} // 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//////' + showArray);
map.removeOverlays(Altadena);
map.removeOverlays(Apple_Valley);
map.removeOverlays(Carmel);
map.removeOverlays(Carmichael);
map.removeOverlays(Chula_Vista);
map.removeOverlays(Compton);
map.removeOverlays(Coronado);
map.removeOverlays(Downey);
map.removeOverlays(Foster_City);
map.removeOverlays(Irvine);
map.removeOverlays(La_Jolla);
map.removeOverlays(La_Mesa);
map.removeOverlays(Laguna_Hills);
map.removeOverlays(Menlo_Park);
map.removeOverlays(Monterey);
map.removeOverlays(Newport_Beach);
map.removeOverlays(North_Hollywood);
map.removeOverlays(Norwalk);
map.removeOverlays(Oakland);
map.removeOverlays(Pacific_Palisades);
map.removeOverlays(Palm_Desert);
map.removeOverlays(Rancho_Santa_Margarita);
map.removeOverlays(Roseville);
map.removeOverlays(San_Clemente);
map.removeOverlays(San_Diego);
map.removeOverlays(San_Francisco);
map.removeOverlays(San_Jose);
map.removeOverlays(San_Juan_Capistrano);
map.removeOverlays(San_Mateo);
map.removeOverlays(Saratoga);
map.removeOverlays(Sierra_Madre);
map.removeOverlays(South_Pasadena);
map.removeOverlays(Thousand_Oaks);
map.removeOverlays(Upland);
map.removeOverlays(Visalia);
map.removeOverlays(Vista);
map.removeOverlays(Winnetka);
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(Vista);map.removeOverlays(Altadena);
map.removeOverlays(Apple_Valley);
map.removeOverlays(Carmel);
map.removeOverlays(Carmichael);
map.removeOverlays(Chula_Vista);
map.removeOverlays(Compton);
map.removeOverlays(Coronado);
map.removeOverlays(Downey);
map.removeOverlays(Foster_City);
map.removeOverlays(Irvine);
map.removeOverlays(La_Jolla);
map.removeOverlays(La_Mesa);
map.removeOverlays(Laguna_Hills);
map.removeOverlays(Menlo_Park);
map.removeOverlays(Monterey);
map.removeOverlays(Newport_Beach);
map.removeOverlays(North_Hollywood);
map.removeOverlays(Norwalk);
map.removeOverlays(Oakland);
map.removeOverlays(Pacific_Palisades);
map.removeOverlays(Palm_Desert);
map.removeOverlays(Rancho_Santa_Margarita);
map.removeOverlays(Roseville);
map.removeOverlays(San_Clemente);
map.removeOverlays(San_Diego);
map.removeOverlays(San_Francisco);
map.removeOverlays(San_Jose);
map.removeOverlays(San_Juan_Capistrano);
map.removeOverlays(San_Mateo);
map.removeOverlays(Saratoga);
map.removeOverlays(Sierra_Madre);
map.removeOverlays(South_Pasadena);
map.removeOverlays(Thousand_Oaks);
map.removeOverlays(Upland);
map.removeOverlays(Visalia);
map.removeOverlays(Vista);
map.removeOverlays(Winnetka);
map.addOverlays(Altadena);
centerByArray(Altadena, false, false);
cntMarker += Altadena.length;
map.addOverlays(Apple_Valley);
centerByArray(Apple_Valley, false, false);
cntMarker += Apple_Valley.length;
map.addOverlays(Carmel);
centerByArray(Carmel, false, false);
cntMarker += Carmel.length;
map.addOverlays(Carmichael);
centerByArray(Carmichael, false, false);
cntMarker += Carmichael.length;
map.addOverlays(Chula_Vista);
centerByArray(Chula_Vista, false, false);
cntMarker += Chula_Vista.length;
map.addOverlays(Compton);
centerByArray(Compton, false, false);
cntMarker += Compton.length;
map.addOverlays(Coronado);
centerByArray(Coronado, false, false);
cntMarker += Coronado.length;
map.addOverlays(Downey);
centerByArray(Downey, false, false);
cntMarker += Downey.length;
map.addOverlays(Foster_City);
centerByArray(Foster_City, false, false);
cntMarker += Foster_City.length;
map.addOverlays(Irvine);
centerByArray(Irvine, false, false);
cntMarker += Irvine.length;
map.addOverlays(La_Jolla);
centerByArray(La_Jolla, false, false);
cntMarker += La_Jolla.length;
map.addOverlays(La_Mesa);
centerByArray(La_Mesa, false, false);
cntMarker += La_Mesa.length;
map.addOverlays(Laguna_Hills);
centerByArray(Laguna_Hills, false, false);
cntMarker += Laguna_Hills.length;
map.addOverlays(Menlo_Park);
centerByArray(Menlo_Park, false, false);
cntMarker += Menlo_Park.length;
map.addOverlays(Monterey);
centerByArray(Monterey, false, false);
cntMarker += Monterey.length;
map.addOverlays(Newport_Beach);
centerByArray(Newport_Beach, false, false);
cntMarker += Newport_Beach.length;
map.addOverlays(North_Hollywood);
centerByArray(North_Hollywood, false, false);
cntMarker += North_Hollywood.length;
map.addOverlays(Norwalk);
centerByArray(Norwalk, false, false);
cntMarker += Norwalk.length;
map.addOverlays(Oakland);
centerByArray(Oakland, false, false);
cntMarker += Oakland.length;
map.addOverlays(Pacific_Palisades);
centerByArray(Pacific_Palisades, false, false);
cntMarker += Pacific_Palisades.length;
map.addOverlays(Palm_Desert);
centerByArray(Palm_Desert, false, false);
cntMarker += Palm_Desert.length;
map.addOverlays(Rancho_Santa_Margarita);
centerByArray(Rancho_Santa_Margarita, false, false);
cntMarker += Rancho_Santa_Margarita.length;
map.addOverlays(Roseville);
centerByArray(Roseville, false, false);
cntMarker += Roseville.length;
map.addOverlays(San_Clemente);
centerByArray(San_Clemente, false, false);
cntMarker += San_Clemente.length;
map.addOverlays(San_Diego);
centerByArray(San_Diego, false, false);
cntMarker += San_Diego.length;
map.addOverlays(San_Francisco);
centerByArray(San_Francisco, false, false);
cntMarker += San_Francisco.length;
map.addOverlays(San_Jose);
centerByArray(San_Jose, false, false);
cntMarker += San_Jose.length;
map.addOverlays(San_Juan_Capistrano);
centerByArray(San_Juan_Capistrano, false, false);
cntMarker += San_Juan_Capistrano.length;
map.addOverlays(San_Mateo);
centerByArray(San_Mateo, false, false);
cntMarker += San_Mateo.length;
map.addOverlays(Saratoga);
centerByArray(Saratoga, false, false);
cntMarker += Saratoga.length;
map.addOverlays(Sierra_Madre);
centerByArray(Sierra_Madre, false, false);
cntMarker += Sierra_Madre.length;
map.addOverlays(South_Pasadena);
centerByArray(South_Pasadena, false, false);
cntMarker += South_Pasadena.length;
map.addOverlays(Thousand_Oaks);
centerByArray(Thousand_Oaks, false, false);
cntMarker += Thousand_Oaks.length;
map.addOverlays(Upland);
centerByArray(Upland, false, false);
cntMarker += Upland.length;
map.addOverlays(Visalia);
centerByArray(Visalia, false, false);
cntMarker += Visalia.length;
map.addOverlays(Vista);
centerByArray(Vista, false, false);
cntMarker += Vista.length;
map.addOverlays(Winnetka);
centerByArray(Winnetka, false, false);
cntMarker += Winnetka.length;
centerByArray(Vista,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///4370,35548,1571,2342,4280,30596,4285,4111,3871,4114,4255,1235,35318,4286,4275,4256,1746,4116,3868,3644,3870,3995,4490,34735,1571,3654,36203,4150,4280,4053,30596,4285,1236,1629,4237,4111,4149,3871,4397,4021,4178,4119,4192,32055,4125,/all');
//window.open('/map.php?type=2&schools=4370,35548,1571,2342,4280,30596,4285,4111,3871,4114,4255,1235,35318,4286,4275,4256,1746,4116,3868,3644,3870,3995,4490,34735,1571,3654,36203,4150,4280,4053,30596,4285,1236,1629,4237,4111,4149,3871,4397,4021,4178,4119,4192,32055,4125,&school_level=&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;
}