function addMarkers(){
mySelect = document.getElementById('selection');
Blytheville = [];Beebe = [];Pocahontas = [];De_Queen = [];Paragould = [];Forrest_City = [];Little_Rock = [];West_Memphis = [];Hot_Springs = [];Harrison = [];Bentonville = [];Malvern = [];Melbourne = [];Dewitt,_Helena,_Stuttgart = [];North_Little_Rock = [];Mena = [];El_Dorado = [];Pine_Bluff = [];Camden = [];Batesville = [];Hope = [];Morrilton = [];Fort_Smith = [];mySelect.options[mySelect.options.length] = new Option("Batesville Schools",'all=Batesville');
mySelect.options[mySelect.options.length] = new Option("Beebe Schools",'all=Beebe');
mySelect.options[mySelect.options.length] = new Option("Bentonville Schools",'all=Bentonville');
mySelect.options[mySelect.options.length] = new Option("Blytheville Schools",'all=Blytheville');
mySelect.options[mySelect.options.length] = new Option("Camden Schools",'all=Camden');
mySelect.options[mySelect.options.length] = new Option("De Queen Schools",'all=De_Queen');
mySelect.options[mySelect.options.length] = new Option("Dewitt, Helena, Stuttgart Schools",'all=Dewitt,_Helena,_Stuttgart');
mySelect.options[mySelect.options.length] = new Option("El Dorado Schools",'all=El_Dorado');
mySelect.options[mySelect.options.length] = new Option("Forrest City Schools",'all=Forrest_City');
mySelect.options[mySelect.options.length] = new Option("Fort Smith Schools",'all=Fort_Smith');
mySelect.options[mySelect.options.length] = new Option("Harrison Schools",'all=Harrison');
mySelect.options[mySelect.options.length] = new Option("Hope Schools",'all=Hope');
mySelect.options[mySelect.options.length] = new Option("Hot Springs Schools",'all=Hot_Springs');
mySelect.options[mySelect.options.length] = new Option("Little Rock Schools",'all=Little_Rock');
mySelect.options[mySelect.options.length] = new Option("Malvern Schools",'all=Malvern');
mySelect.options[mySelect.options.length] = new Option("Melbourne Schools",'all=Melbourne');
mySelect.options[mySelect.options.length] = new Option("Mena Schools",'all=Mena');
mySelect.options[mySelect.options.length] = new Option("Morrilton Schools",'all=Morrilton');
mySelect.options[mySelect.options.length] = new Option("North Little Rock Schools",'all=North_Little_Rock');
mySelect.options[mySelect.options.length] = new Option("Paragould Schools",'all=Paragould');
mySelect.options[mySelect.options.length] = new Option("Pine Bluff Schools",'all=Pine_Bluff');
mySelect.options[mySelect.options.length] = new Option("Pocahontas Schools",'all=Pocahontas');
mySelect.options[mySelect.options.length] = new Option("West Memphis Schools",'all=West_Memphis');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
var tmpLatLng=0;
var tmpLen=0;
tmpLatLng=new GLatLng(35.89782300000000248,-89.9185740000000066);
tmpLen=Blytheville.length;
Blytheville[tmpLen] = createMarker(tmpLatLng,"
",iconGr);
Blytheville[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Arkansas Northeastern College",'Blytheville=' + Blytheville.length);
tmpLatLng=new GLatLng(35.07017499999999898,-91.8948000000000035);
tmpLen=Beebe.length;
Beebe[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Beebe[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Arkansas State University-beebe",'Beebe=' + Beebe.length);
tmpLatLng=new GLatLng(36.26126099999999752,-90.9707570000000060);
tmpLen=Pocahontas.length;
Pocahontas[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Pocahontas[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Black River Technical College",'Pocahontas=' + Pocahontas.length);
tmpLatLng=new GLatLng(34.03776899999999727,-94.3411710000000027);
tmpLen=De_Queen.length;
De_Queen[tmpLen] = createMarker(tmpLatLng,"",iconGr);
De_Queen[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Cossatot Community College Of University Of Ar",'De_Queen=' + De_Queen.length);
tmpLatLng=new GLatLng(36.06624500000000210,-90.5844560000000029);
tmpLen=Paragould.length;
Paragould[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Paragould[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Crowley's Ridge College",'Paragould=' + Paragould.length);
tmpLatLng=new GLatLng(35.05174600000000140,-90.7659830000000056);
tmpLen=Forrest_City.length;
Forrest_City[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Forrest_City[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("East Arkansas Community College",'Forrest_City=' + Forrest_City.length);
tmpLatLng=new GLatLng(34.71212799999999987,-92.3430520000000001);
tmpLen=Little_Rock.length;
Little_Rock[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Little_Rock[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Itt Technical Institute-little Rock",'Little_Rock=' + Little_Rock.length);
tmpLatLng=new GLatLng(35.14668999999999954,-90.2213749999999947);
tmpLen=West_Memphis.length;
West_Memphis[tmpLen] = createMarker(tmpLatLng,"",iconGr);
West_Memphis[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Mid-south Community College",'West_Memphis=' + West_Memphis.length);
tmpLatLng=new GLatLng(34.51451099999999883,-93.1197420000000022);
tmpLen=Hot_Springs.length;
Hot_Springs[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Hot_Springs[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("National Park Community College",'Hot_Springs=' + Hot_Springs.length);
tmpLatLng=new GLatLng(36.22151300000000162,-93.0906640000000038);
tmpLen=Harrison.length;
Harrison[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Harrison[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("North Arkansas College",'Harrison=' + Harrison.length);
tmpLatLng=new GLatLng(36.35734599999999971,-94.1720239999999932);
tmpLen=Bentonville.length;
Bentonville[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Bentonville[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Northwest Arkansas Community College",'Bentonville=' + Bentonville.length);
tmpLatLng=new GLatLng(34.36469999999999913,-92.8178999999999945);
tmpLen=Malvern.length;
Malvern[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Malvern[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ouachita Technical College",'Malvern=' + Malvern.length);
tmpLatLng=new GLatLng(36.05493799999999993,-91.8979199999999991);
tmpLen=Melbourne.length;
Melbourne[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Melbourne[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ozarka College",'Melbourne=' + Melbourne.length);
tmpLatLng=new GLatLng(34.55183999999999855,-90.7676400000000001);
tmpLen=Dewitt,_Helena,_Stuttgart.length;
Dewitt,_Helena,_Stuttgart[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Dewitt,_Helena,_Stuttgart[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Phillips Community College Of University Of Ar",'Dewitt,_Helena,_Stuttgart=' + Dewitt,_Helena,_Stuttgart.length);
tmpLatLng=new GLatLng(34.78461500000000228,-92.2993179999999995);
tmpLen=North_Little_Rock.length;
North_Little_Rock[tmpLen] = createMarker(tmpLatLng,"",iconGr);
North_Little_Rock[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Pulaski Technical College",'North_Little_Rock=' + North_Little_Rock.length);
tmpLatLng=new GLatLng(34.59023299999999778,-94.2200789999999983);
tmpLen=Mena.length;
Mena[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Mena[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Rich Mountain Community College",'Mena=' + Mena.length);
tmpLatLng=new GLatLng(33.20979799999999926,-92.6655530000000027);
tmpLen=El_Dorado.length;
El_Dorado[tmpLen] = createMarker(tmpLatLng,"",iconGr);
El_Dorado[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("South Arkansas Community College",'El_Dorado=' + El_Dorado.length);
tmpLatLng=new GLatLng(34.20946599999999904,-92.0247399999999942);
tmpLen=Pine_Bluff.length;
Pine_Bluff[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Pine_Bluff[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Southeast Arkansas College",'Pine_Bluff=' + Pine_Bluff.length);
tmpLatLng=new GLatLng(33.57439999999999713,-92.8288000000000010);
tmpLen=Camden.length;
Camden[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Camden[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Southern Arkansas University Tech",'Camden=' + Camden.length);
tmpLatLng=new GLatLng(35.79134100000000273,-91.6190670000000011);
tmpLen=Batesville.length;
Batesville[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Batesville[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("University Of Arkansas Community College-batesvill",'Batesville=' + Batesville.length);
tmpLatLng=new GLatLng(33.64290199999999941,-93.5933540000000050);
tmpLen=Hope.length;
Hope[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Hope[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("University Of Arkansas Community College-hope",'Hope=' + Hope.length);
tmpLatLng=new GLatLng(35.17084499999999991,-92.7183820000000054);
tmpLen=Morrilton.length;
Morrilton[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Morrilton[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("University Of Arkansas Community College-morrilton",'Morrilton=' + Morrilton.length);
tmpLatLng=new GLatLng(35.38526300000000190,-94.3750869999999935);
tmpLen=Fort_Smith.length;
Fort_Smith[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Fort_Smith[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("University Of Arkansas-fort Smith",'Fort_Smith=' + Fort_Smith.length);
map.removeOverlays(Batesville);
map.removeOverlays(Beebe);
map.removeOverlays(Bentonville);
map.removeOverlays(Blytheville);
map.removeOverlays(Camden);
map.removeOverlays(De_Queen);
map.removeOverlays(Dewitt,_Helena,_Stuttgart);
map.removeOverlays(El_Dorado);
map.removeOverlays(Forrest_City);
map.removeOverlays(Fort_Smith);
map.removeOverlays(Harrison);
map.removeOverlays(Hope);
map.removeOverlays(Hot_Springs);
map.removeOverlays(Little_Rock);
map.removeOverlays(Malvern);
map.removeOverlays(Melbourne);
map.removeOverlays(Mena);
map.removeOverlays(Morrilton);
map.removeOverlays(North_Little_Rock);
map.removeOverlays(Paragould);
map.removeOverlays(Pine_Bluff);
map.removeOverlays(Pocahontas);
map.removeOverlays(West_Memphis);
setTimeout(function(){map.addOverlays(Batesville)},1000);
setTimeout(function(){map.addOverlays(Beebe)},1000);
setTimeout(function(){map.addOverlays(Bentonville)},1000);
setTimeout(function(){map.addOverlays(Blytheville)},1000);
setTimeout(function(){map.addOverlays(Camden)},1000);
setTimeout(function(){map.addOverlays(De_Queen)},1000);
setTimeout(function(){map.addOverlays(Dewitt,_Helena,_Stuttgart)},1000);
setTimeout(function(){map.addOverlays(El_Dorado)},1000);
setTimeout(function(){map.addOverlays(Forrest_City)},1000);
setTimeout(function(){map.addOverlays(Fort_Smith)},1000);
setTimeout(function(){map.addOverlays(Harrison)},1000);
setTimeout(function(){map.addOverlays(Hope)},1000);
setTimeout(function(){map.addOverlays(Hot_Springs)},1000);
setTimeout(function(){map.addOverlays(Little_Rock)},1000);
setTimeout(function(){map.addOverlays(Malvern)},1000);
setTimeout(function(){map.addOverlays(Melbourne)},1000);
setTimeout(function(){map.addOverlays(Mena)},1000);
setTimeout(function(){map.addOverlays(Morrilton)},1000);
setTimeout(function(){map.addOverlays(North_Little_Rock)},1000);
setTimeout(function(){map.addOverlays(Paragould)},1000);
setTimeout(function(){map.addOverlays(Pine_Bluff)},1000);
setTimeout(function(){map.addOverlays(Pocahontas)},1000);
setTimeout(function(){map.addOverlays(West_Memphis)},1000);
getPoly("","state","","AR");}
// 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(Batesville);
map.removeOverlays(Beebe);
map.removeOverlays(Bentonville);
map.removeOverlays(Blytheville);
map.removeOverlays(Camden);
map.removeOverlays(De_Queen);
map.removeOverlays(Dewitt,_Helena,_Stuttgart);
map.removeOverlays(El_Dorado);
map.removeOverlays(Forrest_City);
map.removeOverlays(Fort_Smith);
map.removeOverlays(Harrison);
map.removeOverlays(Hope);
map.removeOverlays(Hot_Springs);
map.removeOverlays(Little_Rock);
map.removeOverlays(Malvern);
map.removeOverlays(Melbourne);
map.removeOverlays(Mena);
map.removeOverlays(Morrilton);
map.removeOverlays(North_Little_Rock);
map.removeOverlays(Paragould);
map.removeOverlays(Pine_Bluff);
map.removeOverlays(Pocahontas);
map.removeOverlays(West_Memphis);
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(Blytheville);map.removeOverlays(Batesville);
map.removeOverlays(Beebe);
map.removeOverlays(Bentonville);
map.removeOverlays(Blytheville);
map.removeOverlays(Camden);
map.removeOverlays(De_Queen);
map.removeOverlays(Dewitt,_Helena,_Stuttgart);
map.removeOverlays(El_Dorado);
map.removeOverlays(Forrest_City);
map.removeOverlays(Fort_Smith);
map.removeOverlays(Harrison);
map.removeOverlays(Hope);
map.removeOverlays(Hot_Springs);
map.removeOverlays(Little_Rock);
map.removeOverlays(Malvern);
map.removeOverlays(Melbourne);
map.removeOverlays(Mena);
map.removeOverlays(Morrilton);
map.removeOverlays(North_Little_Rock);
map.removeOverlays(Paragould);
map.removeOverlays(Pine_Bluff);
map.removeOverlays(Pocahontas);
map.removeOverlays(West_Memphis);
map.addOverlays(Batesville);
centerByArray(Batesville, false, false);
cntMarker += Batesville.length;
map.addOverlays(Beebe);
centerByArray(Beebe, false, false);
cntMarker += Beebe.length;
map.addOverlays(Bentonville);
centerByArray(Bentonville, false, false);
cntMarker += Bentonville.length;
map.addOverlays(Blytheville);
centerByArray(Blytheville, false, false);
cntMarker += Blytheville.length;
map.addOverlays(Camden);
centerByArray(Camden, false, false);
cntMarker += Camden.length;
map.addOverlays(De_Queen);
centerByArray(De_Queen, false, false);
cntMarker += De_Queen.length;
map.addOverlays(Dewitt,_Helena,_Stuttgart);
centerByArray(Dewitt,_Helena,_Stuttgart, false, false);
cntMarker += Dewitt,_Helena,_Stuttgart.length;
map.addOverlays(El_Dorado);
centerByArray(El_Dorado, false, false);
cntMarker += El_Dorado.length;
map.addOverlays(Forrest_City);
centerByArray(Forrest_City, false, false);
cntMarker += Forrest_City.length;
map.addOverlays(Fort_Smith);
centerByArray(Fort_Smith, false, false);
cntMarker += Fort_Smith.length;
map.addOverlays(Harrison);
centerByArray(Harrison, false, false);
cntMarker += Harrison.length;
map.addOverlays(Hope);
centerByArray(Hope, false, false);
cntMarker += Hope.length;
map.addOverlays(Hot_Springs);
centerByArray(Hot_Springs, false, false);
cntMarker += Hot_Springs.length;
map.addOverlays(Little_Rock);
centerByArray(Little_Rock, false, false);
cntMarker += Little_Rock.length;
map.addOverlays(Malvern);
centerByArray(Malvern, false, false);
cntMarker += Malvern.length;
map.addOverlays(Melbourne);
centerByArray(Melbourne, false, false);
cntMarker += Melbourne.length;
map.addOverlays(Mena);
centerByArray(Mena, false, false);
cntMarker += Mena.length;
map.addOverlays(Morrilton);
centerByArray(Morrilton, false, false);
cntMarker += Morrilton.length;
map.addOverlays(North_Little_Rock);
centerByArray(North_Little_Rock, false, false);
cntMarker += North_Little_Rock.length;
map.addOverlays(Paragould);
centerByArray(Paragould, false, false);
cntMarker += Paragould.length;
map.addOverlays(Pine_Bluff);
centerByArray(Pine_Bluff, false, false);
cntMarker += Pine_Bluff.length;
map.addOverlays(Pocahontas);
centerByArray(Pocahontas, false, false);
cntMarker += Pocahontas.length;
map.addOverlays(West_Memphis);
centerByArray(West_Memphis, false, false);
cntMarker += West_Memphis.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;
}