function addMarkers(){ mySelect = document.getElementById('selection'); Glendale = [];Yuma = [];Phoenix = [];Coolidge = [];Chandler = [];Douglas = [];Flagstaff = [];Thatcher = [];Avondale = [];Mesa = [];Tucson = [];Tempe = [];Kingman = [];Holbrook = [];Scottsdale = [];Prescott = [];mySelect.options[mySelect.options.length] = new Option("Avondale Schools",'all=Avondale'); mySelect.options[mySelect.options.length] = new Option("Chandler Schools",'all=Chandler'); mySelect.options[mySelect.options.length] = new Option("Coolidge Schools",'all=Coolidge'); mySelect.options[mySelect.options.length] = new Option("Douglas Schools",'all=Douglas'); mySelect.options[mySelect.options.length] = new Option("Flagstaff Schools",'all=Flagstaff'); mySelect.options[mySelect.options.length] = new Option("Glendale Schools",'all=Glendale'); mySelect.options[mySelect.options.length] = new Option("Holbrook Schools",'all=Holbrook'); mySelect.options[mySelect.options.length] = new Option("Kingman Schools",'all=Kingman'); mySelect.options[mySelect.options.length] = new Option("Mesa Schools",'all=Mesa'); mySelect.options[mySelect.options.length] = new Option("Phoenix Schools",'all=Phoenix'); mySelect.options[mySelect.options.length] = new Option("Prescott Schools",'all=Prescott'); mySelect.options[mySelect.options.length] = new Option("Scottsdale Schools",'all=Scottsdale'); mySelect.options[mySelect.options.length] = new Option("Tempe Schools",'all=Tempe'); mySelect.options[mySelect.options.length] = new Option("Thatcher Schools",'all=Thatcher'); mySelect.options[mySelect.options.length] = new Option("Tucson Schools",'all=Tucson'); mySelect.options[mySelect.options.length] = new Option("Yuma Schools",'all=Yuma'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); var tmpLatLng=0; var tmpLen=0; tmpLatLng=new GLatLng(33.53615800000000035,-112.157454000000001); tmpLen=Glendale.length; Glendale[tmpLen] = createMarker(tmpLatLng,"
Arizona Automotive Institute
6829 N 46th Ave
Glendale, AZ 85301

[ View School Profile ]
",iconRd); Glendale[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Arizona Automotive Institute",'Glendale=' + Glendale.length); tmpLatLng=new GLatLng(32.70667199999999752,-114.495530999999999); tmpLen=Yuma.length; Yuma[tmpLen] = createMarker(tmpLatLng,"
Arizona Western College
2020 S. Avenue 8e
Yuma, AZ 85365

[ View School Profile ]
",iconGr); Yuma[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Arizona Western College",'Yuma=' + Yuma.length); tmpLatLng=new GLatLng(33.56763099999999866,-112.105981999999997); tmpLen=Phoenix.length; Phoenix[tmpLen] = createMarker(tmpLatLng,"
Art Institute Of Phoenix
2233 W Dunlap Ave
Phoenix, AZ 85021

[ View School Profile ]
",iconGr); Phoenix[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Art Institute Of Phoenix",'Phoenix=' + Phoenix.length); tmpLatLng=new GLatLng(33.44720099999999973,-112.073166000000000); tmpLen=Phoenix.length; Phoenix[tmpLen] = createMarker(tmpLatLng,"
Bryman School
2250 W. Peoria Ave. A-100
Phoenix, AZ 85029

[ View School Profile ]
",iconRd); Phoenix[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Bryman School",'Phoenix=' + Phoenix.length); tmpLatLng=new GLatLng(32.95464700000000135,-111.652838000000002); tmpLen=Coolidge.length; Coolidge[tmpLen] = createMarker(tmpLatLng,"
Central Arizona College
8470 N Overfield Rd
Coolidge, AZ 85228

[ View School Profile ]
",iconGr); Coolidge[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Central Arizona College",'Coolidge=' + Coolidge.length); tmpLatLng=new GLatLng(33.29188500000000061,-111.794362000000006); tmpLen=Chandler.length; Chandler[tmpLen] = createMarker(tmpLatLng,"
Chandler/gilbert Community College
2626 E Pecos Rd
Chandler, AZ 85225

[ View School Profile ]
",iconGr); Chandler[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Chandler/gilbert Community College",'Chandler=' + Chandler.length); tmpLatLng=new GLatLng(31.36419700000000077,-109.696599000000006); tmpLen=Douglas.length; Douglas[tmpLen] = createMarker(tmpLatLng,"
Cochise College
4190 W Highway 80
Douglas, AZ 85607

[ View School Profile ]
",iconGr); Douglas[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Cochise College",'Douglas=' + Douglas.length); tmpLatLng=new GLatLng(35.17955200000000104,-111.648410999999995); tmpLen=Flagstaff.length; Flagstaff[tmpLen] = createMarker(tmpLatLng,"
Coconino County Community College
2800 S. Lone Tree Rd.
Flagstaff, AZ 86001

[ View School Profile ]
",iconGr); Flagstaff[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Coconino County Community College",'Flagstaff=' + Flagstaff.length); tmpLatLng=new GLatLng(32.84301299999999912,-109.762872000000001); tmpLen=Thatcher.length; Thatcher[tmpLen] = createMarker(tmpLatLng,"
Eastern Arizona College
615 N. Stadium Ave.
Thatcher, AZ 85552

[ View School Profile ]
",iconGr); Thatcher[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Eastern Arizona College",'Thatcher=' + Thatcher.length); tmpLatLng=new GLatLng(33.478841,-112.340913); tmpLen=Avondale.length; Avondale[tmpLen] = createMarker(tmpLatLng,"
Estrella Mountain Community College
3000 N Dysart Rd
Avondale, AZ 85323

[ View School Profile ]
",iconGr); Avondale[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Estrella Mountain Community College",'Avondale=' + Avondale.length); tmpLatLng=new GLatLng(33.58026799999999667,-112.113836000000006); tmpLen=Phoenix.length; Phoenix[tmpLen] = createMarker(tmpLatLng,"
Everest College-phoenix
10400 N. 25th Avenue, Suite 190
Phoenix, AZ 85021

[ View School Profile ]
",iconRd); Phoenix[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Everest College-phoenix",'Phoenix=' + Phoenix.length); tmpLatLng=new GLatLng(33.44927500000000009,-111.995001000000002); tmpLen=Phoenix.length; Phoenix[tmpLen] = createMarker(tmpLatLng,"
Gateway Community College
108 N. 40th Street
Phoenix, AZ 85034

[ View School Profile ]
",iconGr); Phoenix[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Gateway Community College",'Phoenix=' + Phoenix.length); tmpLatLng=new GLatLng(33.56743999999999772,-112.188331000000005); tmpLen=Glendale.length; Glendale[tmpLen] = createMarker(tmpLatLng,"
Glendale Community College
6000 W Olive Ave
Glendale, AZ 85302

[ View School Profile ]
",iconGr); Glendale[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Glendale Community College",'Glendale=' + Glendale.length); tmpLatLng=new GLatLng(33.49475000000000335,-112.049294000000003); tmpLen=Phoenix.length; Phoenix[tmpLen] = createMarker(tmpLatLng,"
High-tech Institute-phoenix
1515 E Indian School Road
Phoenix, AZ 85014

[ View School Profile ]
",iconRd); Phoenix[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("High-tech Institute-phoenix",'Phoenix=' + Phoenix.length); tmpLatLng=new GLatLng(33.52479000000000297,-112.151218000000000); tmpLen=Phoenix.length; Phoenix[tmpLen] = createMarker(tmpLatLng,"
International Institute Of Americas
6049 N 43rd Ave
Phoenix, AZ 85019

[ View School Profile ]
",iconRd); Phoenix[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("International Institute Of Americas",'Phoenix=' + Phoenix.length); tmpLatLng=new GLatLng(33.39687299999999936,-111.788343999999995); tmpLen=Mesa.length; Mesa[tmpLen] = createMarker(tmpLatLng,"
International Institute Of Americas
925 S Gilbert Rd Ste 201
Mesa, AZ 85204

[ View School Profile ]
",iconRd); Mesa[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("International Institute Of Americas",'Mesa=' + Mesa.length); tmpLatLng=new GLatLng(32.20677599999999785,-110.875527000000005); tmpLen=Tucson.length; Tucson[tmpLen] = createMarker(tmpLatLng,"
International Institute Of Americas
5441 E. 22nd St. Ste. 125
Tucson, AZ 85711

[ View School Profile ]
",iconRd); Tucson[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("International Institute Of Americas",'Tucson=' + Tucson.length); tmpLatLng=new GLatLng(33.49555699999999802,-112.220653999999996); tmpLen=Phoenix.length; Phoenix[tmpLen] = createMarker(tmpLatLng,"
International Institute Of The Americas
4136 N 75th Ave Ste 211
Phoenix, AZ 85033

[ View School Profile ]
",iconRd); Phoenix[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("International Institute Of The Americas",'Phoenix=' + Phoenix.length); tmpLatLng=new GLatLng(32.29760000000000275,-110.995924999999999); tmpLen=Tucson.length; Tucson[tmpLen] = createMarker(tmpLatLng,"
Itt Technical Institute-tucson
1455 W. River Rd
Tucson, AZ 85704

[ View School Profile ]
",iconRd); Tucson[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Itt Technical Institute-tucson",'Tucson=' + Tucson.length); tmpLatLng=new GLatLng(33.44084500000000304,-111.926499000000006); tmpLen=Tempe.length; Tempe[tmpLen] = createMarker(tmpLatLng,"
Lamson College
1126 N Scottsdale Rd Ste 17
Tempe, AZ 85281

[ View School Profile ]
",iconRd); Tempe[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Lamson College",'Tempe=' + Tempe.length); tmpLatLng=new GLatLng(33.60479699999999780,-112.117264000000005); tmpLen=Phoenix.length; Phoenix[tmpLen] = createMarker(tmpLatLng,"
Long Technical College
13450 N Black Canyon Hwy, Ste 104
Phoenix, AZ 85029

[ View School Profile ]
",iconRd); Phoenix[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Long Technical College",'Phoenix=' + Phoenix.length); tmpLatLng=new GLatLng(33.39303900000000169,-111.870264000000005); tmpLen=Mesa.length; Mesa[tmpLen] = createMarker(tmpLatLng,"
Mesa Community College
1833 W Southern Ave
Mesa, AZ 85202

[ View School Profile ]
",iconGr); Mesa[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Mesa Community College",'Mesa=' + Mesa.length); tmpLatLng=new GLatLng(35.26833200000000090,-114.030158999999997); tmpLen=Kingman.length; Kingman[tmpLen] = createMarker(tmpLatLng,"
Mohave Community College
1971 Jagerson Avenue
Kingman, AZ 86409

[ View School Profile ]
",iconGr); Kingman[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Mohave Community College",'Kingman=' + Kingman.length); tmpLatLng=new GLatLng(34.90700700000000011,-110.159958000000003); tmpLen=Holbrook.length; Holbrook[tmpLen] = createMarker(tmpLatLng,"
Northland Pioneer College
103 N. First Ave. At Hopi Dr.
Holbrook, AZ 86025

[ View School Profile ]
",iconGr); Holbrook[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Northland Pioneer College",'Holbrook=' + Holbrook.length); tmpLatLng=new GLatLng(33.65293400000000190,-112.013052999999999); tmpLen=Phoenix.length; Phoenix[tmpLen] = createMarker(tmpLatLng,"
Paradise Valley Community College
18401 N 32nd St
Phoenix, AZ 85032

[ View School Profile ]
",iconGr); Phoenix[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Paradise Valley Community College",'Phoenix=' + Phoenix.length); tmpLatLng=new GLatLng(33.48064099999999854,-112.088274999999995); tmpLen=Phoenix.length; Phoenix[tmpLen] = createMarker(tmpLatLng,"
Phoenix College
1202 W Thomas Rd
Phoenix, AZ 85013

[ View School Profile ]
",iconGr); Phoenix[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Phoenix College",'Phoenix=' + Phoenix.length); tmpLatLng=new GLatLng(32.22497599999999806,-111.011320999999995); tmpLen=Tucson.length; Tucson[tmpLen] = createMarker(tmpLatLng,"
Pima Community College
2202 W Anklam Rd
Tucson, AZ 85709

[ View School Profile ]
",iconGr); Tucson[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Pima Community College",'Tucson=' + Tucson.length); tmpLatLng=new GLatLng(33.44824400000000252,-111.990033999999994); tmpLen=Phoenix.length; Phoenix[tmpLen] = createMarker(tmpLatLng,"
Refrigeration School Inc
4210 E Washington
Phoenix, AZ 85034

[ View School Profile ]
",iconRd); Phoenix[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Refrigeration School Inc",'Phoenix=' + Phoenix.length); tmpLatLng=new GLatLng(33.34896299999999769,-111.951910999999995); tmpLen=Tempe.length; Tempe[tmpLen] = createMarker(tmpLatLng,"
Remington College-tempe Campus
875 W Elliot Rd 126
Tempe, AZ 85284

[ View School Profile ]
",iconRd); Tempe[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Remington College-tempe Campus",'Tempe=' + Tempe.length); tmpLatLng=new GLatLng(33.41375699999999682,-111.975632000000004); tmpLen=Tempe.length; Tempe[tmpLen] = createMarker(tmpLatLng,"
Rio Salado College
2323 W 14th St
Tempe, AZ 85281

[ View School Profile ]
",iconGr); Tempe[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Rio Salado College",'Tempe=' + Tempe.length); tmpLatLng=new GLatLng(33.50924400000000247,-111.880566999999999); tmpLen=Scottsdale.length; Scottsdale[tmpLen] = createMarker(tmpLatLng,"
Scottsdale Community College
9000 E Chaparral Rd
Scottsdale, AZ 85256

[ View School Profile ]
",iconGr); Scottsdale[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Scottsdale Community College",'Scottsdale=' + Scottsdale.length); tmpLatLng=new GLatLng(33.50205299999999653,-111.906160999999997); tmpLen=Scottsdale.length; Scottsdale[tmpLen] = createMarker(tmpLatLng,"
Scottsdale Culinary Institute
8100 E Camelback Rd, Suite 1001
Scottsdale, AZ 85251

[ View School Profile ]
",iconRd); Scottsdale[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Scottsdale Culinary Institute",'Scottsdale=' + Scottsdale.length); tmpLatLng=new GLatLng(33.38265499999999974,-112.030410000000003); tmpLen=Phoenix.length; Phoenix[tmpLen] = createMarker(tmpLatLng,"
South Mountain Community College
7050 S 24th St
Phoenix, AZ 85040

[ View School Profile ]
",iconGr); Phoenix[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("South Mountain Community College",'Phoenix=' + Phoenix.length); tmpLatLng=new GLatLng(33.49107500000000214,-112.125218000000003); tmpLen=Avondale.length; Avondale[tmpLen] = createMarker(tmpLatLng,"
Universal Technical Institute Of Arizona Inc
10695 West Pierce Street
Avondale, AZ 85323

[ View School Profile ]
",iconRd); Avondale[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Universal Technical Institute Of Arizona Inc",'Avondale=' + Avondale.length); tmpLatLng=new GLatLng(34.54495399999999705,-112.455392000000003); tmpLen=Prescott.length; Prescott[tmpLen] = createMarker(tmpLatLng,"
Yavapai College
1100 E Sheldon St
Prescott, AZ 86301

[ View School Profile ]
",iconGr); Prescott[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Yavapai College",'Prescott=' + Prescott.length); map.removeOverlays(Avondale); map.removeOverlays(Chandler); map.removeOverlays(Coolidge); map.removeOverlays(Douglas); map.removeOverlays(Flagstaff); map.removeOverlays(Glendale); map.removeOverlays(Holbrook); map.removeOverlays(Kingman); map.removeOverlays(Mesa); map.removeOverlays(Phoenix); map.removeOverlays(Prescott); map.removeOverlays(Scottsdale); map.removeOverlays(Tempe); map.removeOverlays(Thatcher); map.removeOverlays(Tucson); map.removeOverlays(Yuma); setTimeout(function(){map.addOverlays(Avondale)},1000); setTimeout(function(){map.addOverlays(Chandler)},1000); setTimeout(function(){map.addOverlays(Coolidge)},1000); setTimeout(function(){map.addOverlays(Douglas)},1000); setTimeout(function(){map.addOverlays(Flagstaff)},1000); setTimeout(function(){map.addOverlays(Glendale)},1000); setTimeout(function(){map.addOverlays(Holbrook)},1000); setTimeout(function(){map.addOverlays(Kingman)},1000); setTimeout(function(){map.addOverlays(Mesa)},1000); setTimeout(function(){map.addOverlays(Phoenix)},1000); setTimeout(function(){map.addOverlays(Prescott)},1000); setTimeout(function(){map.addOverlays(Scottsdale)},1000); setTimeout(function(){map.addOverlays(Tempe)},1000); setTimeout(function(){map.addOverlays(Thatcher)},1000); setTimeout(function(){map.addOverlays(Tucson)},1000); setTimeout(function(){map.addOverlays(Yuma)},1000); getPoly("","state","","AZ");} // 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(Avondale); map.removeOverlays(Chandler); map.removeOverlays(Coolidge); map.removeOverlays(Douglas); map.removeOverlays(Flagstaff); map.removeOverlays(Glendale); map.removeOverlays(Holbrook); map.removeOverlays(Kingman); map.removeOverlays(Mesa); map.removeOverlays(Phoenix); map.removeOverlays(Prescott); map.removeOverlays(Scottsdale); map.removeOverlays(Tempe); map.removeOverlays(Thatcher); map.removeOverlays(Tucson); map.removeOverlays(Yuma); 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(Glendale);map.removeOverlays(Avondale); map.removeOverlays(Chandler); map.removeOverlays(Coolidge); map.removeOverlays(Douglas); map.removeOverlays(Flagstaff); map.removeOverlays(Glendale); map.removeOverlays(Holbrook); map.removeOverlays(Kingman); map.removeOverlays(Mesa); map.removeOverlays(Phoenix); map.removeOverlays(Prescott); map.removeOverlays(Scottsdale); map.removeOverlays(Tempe); map.removeOverlays(Thatcher); map.removeOverlays(Tucson); map.removeOverlays(Yuma); map.addOverlays(Avondale); centerByArray(Avondale, false, false); cntMarker += Avondale.length; map.addOverlays(Chandler); centerByArray(Chandler, false, false); cntMarker += Chandler.length; map.addOverlays(Coolidge); centerByArray(Coolidge, false, false); cntMarker += Coolidge.length; map.addOverlays(Douglas); centerByArray(Douglas, false, false); cntMarker += Douglas.length; map.addOverlays(Flagstaff); centerByArray(Flagstaff, false, false); cntMarker += Flagstaff.length; map.addOverlays(Glendale); centerByArray(Glendale, false, false); cntMarker += Glendale.length; map.addOverlays(Holbrook); centerByArray(Holbrook, false, false); cntMarker += Holbrook.length; map.addOverlays(Kingman); centerByArray(Kingman, false, false); cntMarker += Kingman.length; map.addOverlays(Mesa); centerByArray(Mesa, false, false); cntMarker += Mesa.length; map.addOverlays(Phoenix); centerByArray(Phoenix, false, false); cntMarker += Phoenix.length; map.addOverlays(Prescott); centerByArray(Prescott, false, false); cntMarker += Prescott.length; map.addOverlays(Scottsdale); centerByArray(Scottsdale, false, false); cntMarker += Scottsdale.length; map.addOverlays(Tempe); centerByArray(Tempe, false, false); cntMarker += Tempe.length; map.addOverlays(Thatcher); centerByArray(Thatcher, false, false); cntMarker += Thatcher.length; map.addOverlays(Tucson); centerByArray(Tucson, false, false); cntMarker += Tucson.length; map.addOverlays(Yuma); centerByArray(Yuma, false, false); cntMarker += Yuma.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; }