function addMarkers(){
mySelect = document.getElementById('selection');
Los_Angeles = [];Lancaster = [];Santa_Monica = [];Long_Beach = [];Norwalk = [];Glendora = [];Santa_Clarita = [];Monterey_Park = [];Compton = [];Torrance = [];City_Of_Industry = [];Cerritos = [];Glendale = [];Wilmington = [];Sylmar = [];Woodland_Hills = [];Valley_Glen = [];North_Hollywood = [];Panorama_City = [];Rancho_Palos_Verdes = [];Walnut = [];San_Diego = [];Pasadena = [];Alhambra = [];Whittier = [];Culver_City = [];mySelect.options[mySelect.options.length] = new Option("Alhambra Schools",'all=Alhambra');
mySelect.options[mySelect.options.length] = new Option("Cerritos Schools",'all=Cerritos');
mySelect.options[mySelect.options.length] = new Option("City Of Industry Schools",'all=City_Of_Industry');
mySelect.options[mySelect.options.length] = new Option("Compton Schools",'all=Compton');
mySelect.options[mySelect.options.length] = new Option("Culver City Schools",'all=Culver_City');
mySelect.options[mySelect.options.length] = new Option("Glendale Schools",'all=Glendale');
mySelect.options[mySelect.options.length] = new Option("Glendora Schools",'all=Glendora');
mySelect.options[mySelect.options.length] = new Option("Lancaster Schools",'all=Lancaster');
mySelect.options[mySelect.options.length] = new Option("Long Beach Schools",'all=Long_Beach');
mySelect.options[mySelect.options.length] = new Option("Los Angeles Schools",'all=Los_Angeles');
mySelect.options[mySelect.options.length] = new Option("Monterey Park Schools",'all=Monterey_Park');
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("Panorama City Schools",'all=Panorama_City');
mySelect.options[mySelect.options.length] = new Option("Pasadena Schools",'all=Pasadena');
mySelect.options[mySelect.options.length] = new Option("Rancho Palos Verdes Schools",'all=Rancho_Palos_Verdes');
mySelect.options[mySelect.options.length] = new Option("San Diego Schools",'all=San_Diego');
mySelect.options[mySelect.options.length] = new Option("Santa Clarita Schools",'all=Santa_Clarita');
mySelect.options[mySelect.options.length] = new Option("Santa Monica Schools",'all=Santa_Monica');
mySelect.options[mySelect.options.length] = new Option("Sylmar Schools",'all=Sylmar');
mySelect.options[mySelect.options.length] = new Option("Torrance Schools",'all=Torrance');
mySelect.options[mySelect.options.length] = new Option("Valley Glen Schools",'all=Valley_Glen');
mySelect.options[mySelect.options.length] = new Option("Walnut Schools",'all=Walnut');
mySelect.options[mySelect.options.length] = new Option("Whittier Schools",'all=Whittier');
mySelect.options[mySelect.options.length] = new Option("Wilmington Schools",'all=Wilmington');
mySelect.options[mySelect.options.length] = new Option("Woodland Hills Schools",'all=Woodland_Hills');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
var tmpLatLng=0;
var tmpLen=0;
tmpLatLng=new GLatLng(34.09497000000000355,-118.344147000000006);
tmpLen=Los_Angeles.length;
Los_Angeles[tmpLen] = createMarker(tmpLatLng,"
",iconRd);
Los_Angeles[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("American Academy Of Dramatic Arts-west",'Los_Angeles=' + Los_Angeles.length);
tmpLatLng=new GLatLng(34.67493699999999989,-118.184544000000002);
tmpLen=Lancaster.length;
Lancaster[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Lancaster[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Antelope Valley College",'Lancaster=' + Lancaster.length);
tmpLatLng=new GLatLng(34.02011799999999652,-118.451677000000003);
tmpLen=Santa_Monica.length;
Santa_Monica[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Santa_Monica[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Art Institute Of California-los Angeles",'Santa_Monica=' + Santa_Monica.length);
tmpLatLng=new GLatLng(33.78564899999999937,-118.136196999999995);
tmpLen=Long_Beach.length;
Long_Beach[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Long_Beach[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Brooks College",'Long_Beach=' + Long_Beach.length);
tmpLatLng=new GLatLng(34.03280999999999778,-118.390010000000003);
tmpLen=Los_Angeles.length;
Los_Angeles[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Los_Angeles[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Bryman College-west Los Angeles",'Los_Angeles=' + Los_Angeles.length);
tmpLatLng=new GLatLng(34.06166300000000291,-118.299032999999994);
tmpLen=Los_Angeles.length;
Los_Angeles[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Los_Angeles[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("California Design College",'Los_Angeles=' + Los_Angeles.length);
tmpLatLng=new GLatLng(33.88759399999999999,-118.097826999999995);
tmpLen=Norwalk.length;
Norwalk[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Norwalk[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Cerritos College",'Norwalk=' + Norwalk.length);
tmpLatLng=new GLatLng(34.13590700000000310,-117.880295000000003);
tmpLen=Glendora.length;
Glendora[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Glendora[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Citrus College",'Glendora=' + Glendora.length);
tmpLatLng=new GLatLng(34.40270999999999901,-118.566616999999993);
tmpLen=Santa_Clarita.length;
Santa_Clarita[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Santa_Clarita[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("College Of Canyons",'Santa_Clarita=' + Santa_Clarita.length);
tmpLatLng=new GLatLng(34.03958300000000036,-118.148538000000002);
tmpLen=Monterey_Park.length;
Monterey_Park[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Monterey_Park[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("East Los Angeles College",'Monterey_Park=' + Monterey_Park.length);
tmpLatLng=new GLatLng(33.87424899999999894,-118.209282000000001);
tmpLen=Compton.length;
Compton[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Compton[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("El Camino College-compton Center",'Compton=' + Compton.length);
tmpLatLng=new GLatLng(33.88551199999999852,-118.326266000000003);
tmpLen=Torrance.length;
Torrance[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Torrance[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("El Camino Community College District",'Torrance=' + Torrance.length);
tmpLatLng=new GLatLng(33.97065500000000071,-118.045755999999997);
tmpLen=City_Of_Industry.length;
City_Of_Industry[tmpLen] = createMarker(tmpLatLng,"",iconRd);
City_Of_Industry[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Everest College-city Of Industry",'City_Of_Industry=' + City_Of_Industry.length);
tmpLatLng=new GLatLng(34.04425499999999971,-118.259546000000000);
tmpLen=Los_Angeles.length;
Los_Angeles[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Los_Angeles[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Fashion Institute Of Design & Merchandising-lo",'Los_Angeles=' + Los_Angeles.length);
tmpLatLng=new GLatLng(33.86561499999999824,-118.101798999999999);
tmpLen=Cerritos.length;
Cerritos[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Cerritos[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Fremont College",'Cerritos=' + Cerritos.length);
tmpLatLng=new GLatLng(34.16790600000000210,-118.229406999999994);
tmpLen=Glendale.length;
Glendale[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Glendale[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Glendale Community College",'Glendale=' + Glendale.length);
tmpLatLng=new GLatLng(33.84946200000000260,-118.290604999999999);
tmpLen=Torrance.length;
Torrance[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Torrance[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Itt Technical Institute-torrance",'Torrance=' + Torrance.length);
tmpLatLng=new GLatLng(34.06166300000000291,-118.291765999999995);
tmpLen=Los_Angeles.length;
Los_Angeles[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Los_Angeles[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("La College International",'Los_Angeles=' + Los_Angeles.length);
tmpLatLng=new GLatLng(33.83235599999999720,-118.135251999999994);
tmpLen=Long_Beach.length;
Long_Beach[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Long_Beach[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Long Beach City College",'Long_Beach=' + Long_Beach.length);
tmpLatLng=new GLatLng(34.08689300000000344,-118.291908000000006);
tmpLen=Los_Angeles.length;
Los_Angeles[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Los_Angeles[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Los Angeles City College",'Los_Angeles=' + Los_Angeles.length);
tmpLatLng=new GLatLng(34.06234200000000100,-118.212128000000006);
tmpLen=Los_Angeles.length;
Los_Angeles[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Los_Angeles[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Los Angeles County College Of Nursing And Allied H",'Los_Angeles=' + Los_Angeles.length);
tmpLatLng=new GLatLng(33.7814910000000026,-118.281122999999993);
tmpLen=Wilmington.length;
Wilmington[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Wilmington[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Los Angeles Harbor College",'Wilmington=' + Wilmington.length);
tmpLatLng=new GLatLng(34.31453700000000139,-118.420625000000001);
tmpLen=Sylmar.length;
Sylmar[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Sylmar[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Los Angeles Mission College",'Sylmar=' + Sylmar.length);
tmpLatLng=new GLatLng(34.18200000000000216,-118.571020000000004);
tmpLen=Woodland_Hills.length;
Woodland_Hills[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Woodland_Hills[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Los Angeles Pierce College",'Woodland_Hills=' + Woodland_Hills.length);
tmpLatLng=new GLatLng(33.93081399999999803,-118.304507000000000);
tmpLen=Los_Angeles.length;
Los_Angeles[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Los_Angeles[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Los Angeles Southwest College",'Los_Angeles=' + Los_Angeles.length);
tmpLatLng=new GLatLng(34.03331200000000222,-118.269606999999993);
tmpLen=Los_Angeles.length;
Los_Angeles[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Los_Angeles[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Los Angeles Trade Technical College",'Los_Angeles=' + Los_Angeles.length);
tmpLatLng=new GLatLng(34.17570500000000066,-118.422613999999995);
tmpLen=Valley_Glen.length;
Valley_Glen[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Valley_Glen[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Los Angeles Valley College",'Valley_Glen=' + Valley_Glen.length);
tmpLatLng=new GLatLng(34.18260899999999935,-118.396332999999998);
tmpLen=North_Hollywood.length;
North_Hollywood[tmpLen] = createMarker(tmpLatLng,"",iconRd);
North_Hollywood[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Maric College-north Hollywood",'North_Hollywood=' + North_Hollywood.length);
tmpLatLng=new GLatLng(34.22149499999999733,-118.446408000000005);
tmpLen=Panorama_City.length;
Panorama_City[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Panorama_City[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Maric College-panorama City",'Panorama_City=' + Panorama_City.length);
tmpLatLng=new GLatLng(33.73521699999999867,-118.333505000000002);
tmpLen=Rancho_Palos_Verdes.length;
Rancho_Palos_Verdes[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Rancho_Palos_Verdes[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Marymount College",'Rancho_Palos_Verdes=' + Rancho_Palos_Verdes.length);
tmpLatLng=new GLatLng(34.04261000000000336,-117.847792999999995);
tmpLen=Walnut.length;
Walnut[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Walnut[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Mt San Antonio College",'Walnut=' + Walnut.length);
tmpLatLng=new GLatLng(33.78119999999999834,-118.261902000000006);
tmpLen=San_Diego.length;
San_Diego[tmpLen] = createMarker(tmpLatLng,"",iconRd);
San_Diego[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("National Polytechnic College Of Science",'San_Diego=' + San_Diego.length);
tmpLatLng=new GLatLng(34.14610700000000065,-118.117103000000000);
tmpLen=Pasadena.length;
Pasadena[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Pasadena[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Pasadena City College",'Pasadena=' + Pasadena.length);
tmpLatLng=new GLatLng(34.09511899999999684,-118.126923000000005);
tmpLen=Alhambra.length;
Alhambra[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Alhambra[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Platt College-los Angeles",'Alhambra=' + Alhambra.length);
tmpLatLng=new GLatLng(34.00231200000000342,-118.056299999999993);
tmpLen=Whittier.length;
Whittier[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Whittier[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Rio Hondo College",'Whittier=' + Whittier.length);
tmpLatLng=new GLatLng(34.01901000000000152,-118.470411999999996);
tmpLen=Santa_Monica.length;
Santa_Monica[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Santa_Monica[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Santa Monica College",'Santa_Monica=' + Santa_Monica.length);
tmpLatLng=new GLatLng(34.00141200000000196,-118.391109999999997);
tmpLen=Culver_City.length;
Culver_City[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Culver_City[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("West Los Angeles College",'Culver_City=' + Culver_City.length);
map.removeOverlays(Alhambra);
map.removeOverlays(Cerritos);
map.removeOverlays(City_Of_Industry);
map.removeOverlays(Compton);
map.removeOverlays(Culver_City);
map.removeOverlays(Glendale);
map.removeOverlays(Glendora);
map.removeOverlays(Lancaster);
map.removeOverlays(Long_Beach);
map.removeOverlays(Los_Angeles);
map.removeOverlays(Monterey_Park);
map.removeOverlays(North_Hollywood);
map.removeOverlays(Norwalk);
map.removeOverlays(Panorama_City);
map.removeOverlays(Pasadena);
map.removeOverlays(Rancho_Palos_Verdes);
map.removeOverlays(San_Diego);
map.removeOverlays(Santa_Clarita);
map.removeOverlays(Santa_Monica);
map.removeOverlays(Sylmar);
map.removeOverlays(Torrance);
map.removeOverlays(Valley_Glen);
map.removeOverlays(Walnut);
map.removeOverlays(Whittier);
map.removeOverlays(Wilmington);
map.removeOverlays(Woodland_Hills);
setTimeout(function(){map.addOverlays(Alhambra)},1000);
setTimeout(function(){map.addOverlays(Cerritos)},1000);
setTimeout(function(){map.addOverlays(City_Of_Industry)},1000);
setTimeout(function(){map.addOverlays(Compton)},1000);
setTimeout(function(){map.addOverlays(Culver_City)},1000);
setTimeout(function(){map.addOverlays(Glendale)},1000);
setTimeout(function(){map.addOverlays(Glendora)},1000);
setTimeout(function(){map.addOverlays(Lancaster)},1000);
setTimeout(function(){map.addOverlays(Long_Beach)},1000);
setTimeout(function(){map.addOverlays(Los_Angeles)},1000);
setTimeout(function(){map.addOverlays(Monterey_Park)},1000);
setTimeout(function(){map.addOverlays(North_Hollywood)},1000);
setTimeout(function(){map.addOverlays(Norwalk)},1000);
setTimeout(function(){map.addOverlays(Panorama_City)},1000);
setTimeout(function(){map.addOverlays(Pasadena)},1000);
setTimeout(function(){map.addOverlays(Rancho_Palos_Verdes)},1000);
setTimeout(function(){map.addOverlays(San_Diego)},1000);
setTimeout(function(){map.addOverlays(Santa_Clarita)},1000);
setTimeout(function(){map.addOverlays(Santa_Monica)},1000);
setTimeout(function(){map.addOverlays(Sylmar)},1000);
setTimeout(function(){map.addOverlays(Torrance)},1000);
setTimeout(function(){map.addOverlays(Valley_Glen)},1000);
setTimeout(function(){map.addOverlays(Walnut)},1000);
setTimeout(function(){map.addOverlays(Whittier)},1000);
setTimeout(function(){map.addOverlays(Wilmington)},1000);
setTimeout(function(){map.addOverlays(Woodland_Hills)},1000);
maxLng = -117.847792999999995;
maxLat = 34.67493699999999989;
minLng = -118.571020000000004;
minLat = 33.73521699999999867;
reCenterMap();
}
// End addStateMarkers JavaScript Function
//open all when map is defined
function openAll() {
if (map) {
selectChange("all");
} else {
setTimeout("openAll()",200);
}
}
// 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].point.x;
var markLat = myArray[i].point.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].point.x;
maxLat = myArray[0].point.y;
minLng = myArray[0].point.x;
minLat = myArray[0].point.y;
}
// Recenter map based on global max/mins
function reCenterMap(){
//alert('#' + minLat + '#' + minLng + '#' + maxLat + '#' + maxLng);
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,10);
/*
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) {
if (selection.options) {
var _openNewWindow=true;
var myVal = selection.options[selection.selectedIndex].value;
} else {
var _openNewWindow=false;
var myVal=selection;
}
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('schools-by-distance') == -1)
window.open(location.href + '/map/all');
else
window.open('/search////all');
map.removeOverlays(Alhambra);
map.removeOverlays(Cerritos);
map.removeOverlays(City_Of_Industry);
map.removeOverlays(Compton);
map.removeOverlays(Culver_City);
map.removeOverlays(Glendale);
map.removeOverlays(Glendora);
map.removeOverlays(Lancaster);
map.removeOverlays(Long_Beach);
map.removeOverlays(Los_Angeles);
map.removeOverlays(Monterey_Park);
map.removeOverlays(North_Hollywood);
map.removeOverlays(Norwalk);
map.removeOverlays(Panorama_City);
map.removeOverlays(Pasadena);
map.removeOverlays(Rancho_Palos_Verdes);
map.removeOverlays(San_Diego);
map.removeOverlays(Santa_Clarita);
map.removeOverlays(Santa_Monica);
map.removeOverlays(Sylmar);
map.removeOverlays(Torrance);
map.removeOverlays(Valley_Glen);
map.removeOverlays(Walnut);
map.removeOverlays(Whittier);
map.removeOverlays(Wilmington);
map.removeOverlays(Woodland_Hills);
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(Los_Angeles);map.removeOverlays(Alhambra);
map.removeOverlays(Cerritos);
map.removeOverlays(City_Of_Industry);
map.removeOverlays(Compton);
map.removeOverlays(Culver_City);
map.removeOverlays(Glendale);
map.removeOverlays(Glendora);
map.removeOverlays(Lancaster);
map.removeOverlays(Long_Beach);
map.removeOverlays(Los_Angeles);
map.removeOverlays(Monterey_Park);
map.removeOverlays(North_Hollywood);
map.removeOverlays(Norwalk);
map.removeOverlays(Panorama_City);
map.removeOverlays(Pasadena);
map.removeOverlays(Rancho_Palos_Verdes);
map.removeOverlays(San_Diego);
map.removeOverlays(Santa_Clarita);
map.removeOverlays(Santa_Monica);
map.removeOverlays(Sylmar);
map.removeOverlays(Torrance);
map.removeOverlays(Valley_Glen);
map.removeOverlays(Walnut);
map.removeOverlays(Whittier);
map.removeOverlays(Wilmington);
map.removeOverlays(Woodland_Hills);
map.addOverlays(Alhambra);
centerByArray(Alhambra, false, false);
cntMarker += Alhambra.length;
map.addOverlays(Cerritos);
centerByArray(Cerritos, false, false);
cntMarker += Cerritos.length;
map.addOverlays(City_Of_Industry);
centerByArray(City_Of_Industry, false, false);
cntMarker += City_Of_Industry.length;
map.addOverlays(Compton);
centerByArray(Compton, false, false);
cntMarker += Compton.length;
map.addOverlays(Culver_City);
centerByArray(Culver_City, false, false);
cntMarker += Culver_City.length;
map.addOverlays(Glendale);
centerByArray(Glendale, false, false);
cntMarker += Glendale.length;
map.addOverlays(Glendora);
centerByArray(Glendora, false, false);
cntMarker += Glendora.length;
map.addOverlays(Lancaster);
centerByArray(Lancaster, false, false);
cntMarker += Lancaster.length;
map.addOverlays(Long_Beach);
centerByArray(Long_Beach, false, false);
cntMarker += Long_Beach.length;
map.addOverlays(Los_Angeles);
centerByArray(Los_Angeles, false, false);
cntMarker += Los_Angeles.length;
map.addOverlays(Monterey_Park);
centerByArray(Monterey_Park, false, false);
cntMarker += Monterey_Park.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(Panorama_City);
centerByArray(Panorama_City, false, false);
cntMarker += Panorama_City.length;
map.addOverlays(Pasadena);
centerByArray(Pasadena, false, false);
cntMarker += Pasadena.length;
map.addOverlays(Rancho_Palos_Verdes);
centerByArray(Rancho_Palos_Verdes, false, false);
cntMarker += Rancho_Palos_Verdes.length;
map.addOverlays(San_Diego);
centerByArray(San_Diego, false, false);
cntMarker += San_Diego.length;
map.addOverlays(Santa_Clarita);
centerByArray(Santa_Clarita, false, false);
cntMarker += Santa_Clarita.length;
map.addOverlays(Santa_Monica);
centerByArray(Santa_Monica, false, false);
cntMarker += Santa_Monica.length;
map.addOverlays(Sylmar);
centerByArray(Sylmar, false, false);
cntMarker += Sylmar.length;
map.addOverlays(Torrance);
centerByArray(Torrance, false, false);
cntMarker += Torrance.length;
map.addOverlays(Valley_Glen);
centerByArray(Valley_Glen, false, false);
cntMarker += Valley_Glen.length;
map.addOverlays(Walnut);
centerByArray(Walnut, false, false);
cntMarker += Walnut.length;
map.addOverlays(Whittier);
centerByArray(Whittier, false, false);
cntMarker += Whittier.length;
map.addOverlays(Wilmington);
centerByArray(Wilmington, false, false);
cntMarker += Wilmington.length;
map.addOverlays(Woodland_Hills);
centerByArray(Woodland_Hills, false, false);
cntMarker += Woodland_Hills.length;
reCenterMap();
//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');
}
}
function createMarker(point, label, icon){
var marker = new GMarker(point, icon);
var html = label;
GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); });
return marker;
}