function addMarkers(){
mySelect = document.getElementById('selection');
Donaldson = [];Fort_Wayne = [];Merrillville = [];South_Bend = [];Hobart = [];Columbus = [];Evansville = [];Indianapolis = [];Lafayette = [];Marion = [];Muncie = [];Terre_Haute = [];Richmond = [];Kokomo = [];Gary = [];Sellersburg = [];Madison = [];Jeffersonville = [];Hammond = [];Vincennes = [];mySelect.options[mySelect.options.length] = new Option("Columbus Schools",'all=Columbus');
mySelect.options[mySelect.options.length] = new Option("Donaldson Schools",'all=Donaldson');
mySelect.options[mySelect.options.length] = new Option("Evansville Schools",'all=Evansville');
mySelect.options[mySelect.options.length] = new Option("Fort Wayne Schools",'all=Fort_Wayne');
mySelect.options[mySelect.options.length] = new Option("Gary Schools",'all=Gary');
mySelect.options[mySelect.options.length] = new Option("Hammond Schools",'all=Hammond');
mySelect.options[mySelect.options.length] = new Option("Hobart Schools",'all=Hobart');
mySelect.options[mySelect.options.length] = new Option("Indianapolis Schools",'all=Indianapolis');
mySelect.options[mySelect.options.length] = new Option("Jeffersonville Schools",'all=Jeffersonville');
mySelect.options[mySelect.options.length] = new Option("Kokomo Schools",'all=Kokomo');
mySelect.options[mySelect.options.length] = new Option("Lafayette Schools",'all=Lafayette');
mySelect.options[mySelect.options.length] = new Option("Madison Schools",'all=Madison');
mySelect.options[mySelect.options.length] = new Option("Marion Schools",'all=Marion');
mySelect.options[mySelect.options.length] = new Option("Merrillville Schools",'all=Merrillville');
mySelect.options[mySelect.options.length] = new Option("Muncie Schools",'all=Muncie');
mySelect.options[mySelect.options.length] = new Option("Richmond Schools",'all=Richmond');
mySelect.options[mySelect.options.length] = new Option("Sellersburg Schools",'all=Sellersburg');
mySelect.options[mySelect.options.length] = new Option("South Bend Schools",'all=South_Bend');
mySelect.options[mySelect.options.length] = new Option("Terre Haute Schools",'all=Terre_Haute');
mySelect.options[mySelect.options.length] = new Option("Vincennes Schools",'all=Vincennes');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
var tmpLatLng=0;
var tmpLen=0;
tmpLatLng=new GLatLng(41.35976600000000047,-86.4443289999999961);
tmpLen=Donaldson.length;
Donaldson[tmpLen] = createMarker(tmpLatLng,"
",iconRd);
Donaldson[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ancilla College",'Donaldson=' + Donaldson.length);
tmpLatLng=new GLatLng(41.09795900000000301,-85.0834559999999981);
tmpLen=Fort_Wayne.length;
Fort_Wayne[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Fort_Wayne[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Brown Mackie College-fort Wayne",'Fort_Wayne=' + Fort_Wayne.length);
tmpLatLng=new GLatLng(41.47361500000000234,-87.3304030000000039);
tmpLen=Merrillville.length;
Merrillville[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Merrillville[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Brown Mackie College-merrillville",'Merrillville=' + Merrillville.length);
tmpLatLng=new GLatLng(41.67487899999999712,-86.2359859999999969);
tmpLen=South_Bend.length;
South_Bend[tmpLen] = createMarker(tmpLatLng,"",iconRd);
South_Bend[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Brown Mackie College-south Bend",'South_Bend=' + South_Bend.length);
tmpLatLng=new GLatLng(41.52166400000000123,-87.2607019999999948);
tmpLen=Hobart.length;
Hobart[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Hobart[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("College Of Court Reporting Inc",'Hobart=' + Hobart.length);
tmpLatLng=new GLatLng(39.24824799999999669,-85.9033179999999987);
tmpLen=Columbus.length;
Columbus[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Columbus[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Indiana Business College-columbus",'Columbus=' + Columbus.length);
tmpLatLng=new GLatLng(37.99579700000000315,-87.4941000000000030);
tmpLen=Evansville.length;
Evansville[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Evansville[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Indiana Business College-evansville",'Evansville=' + Evansville.length);
tmpLatLng=new GLatLng(39.76706599999999980,-86.1571849999999983);
tmpLen=Indianapolis.length;
Indianapolis[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Indianapolis[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Indiana Business College-indianapolis",'Indianapolis=' + Indianapolis.length);
tmpLatLng=new GLatLng(40.41752400000000022,-86.8436460000000067);
tmpLen=Lafayette.length;
Lafayette[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Lafayette[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Indiana Business College-lafayette",'Lafayette=' + Lafayette.length);
tmpLatLng=new GLatLng(40.57172200000000117,-85.6931100000000043);
tmpLen=Marion.length;
Marion[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Marion[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Indiana Business College-marion",'Marion=' + Marion.length);
tmpLatLng=new GLatLng(40.23304399999999958,-85.3899870000000049);
tmpLen=Muncie.length;
Muncie[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Muncie[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Indiana Business College-muncie",'Muncie=' + Muncie.length);
tmpLatLng=new GLatLng(39.42749299999999834,-87.4226769999999930);
tmpLen=Terre_Haute.length;
Terre_Haute[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Terre_Haute[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Indiana Business College-terre Haute",'Terre_Haute=' + Terre_Haute.length);
tmpLatLng=new GLatLng(41.03368900000000252,-85.2563640000000049);
tmpLen=Fort_Wayne.length;
Fort_Wayne[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Fort_Wayne[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("International Business College",'Fort_Wayne=' + Fort_Wayne.length);
tmpLatLng=new GLatLng(39.88521800000000183,-86.0422630000000054);
tmpLen=Indianapolis.length;
Indianapolis[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Indianapolis[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("International Business College-indianapolis",'Indianapolis=' + Indianapolis.length);
tmpLatLng=new GLatLng(39.83728299999999933,-84.8889429999999975);
tmpLen=Richmond.length;
Richmond[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Richmond[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ivy Tech Community College--whitewater",'Richmond=' + Richmond.length);
tmpLatLng=new GLatLng(39.80416300000000262,-86.1579770000000024);
tmpLen=Indianapolis.length;
Indianapolis[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Indianapolis[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ivy Tech Community College-central Indiana",'Indianapolis=' + Indianapolis.length);
tmpLatLng=new GLatLng(39.2496190000000027,-85.9044269999999983);
tmpLen=Columbus.length;
Columbus[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Columbus[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ivy Tech Community College-columbus",'Columbus=' + Columbus.length);
tmpLatLng=new GLatLng(40.15467600000000203,-85.4050309999999939);
tmpLen=Muncie.length;
Muncie[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Muncie[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ivy Tech Community College-east Central",'Muncie=' + Muncie.length);
tmpLatLng=new GLatLng(40.50562399999999740,-86.1082799999999934);
tmpLen=Kokomo.length;
Kokomo[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Kokomo[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ivy Tech Community College-kokomo",'Kokomo=' + Kokomo.length);
tmpLatLng=new GLatLng(40.39331899999999819,-86.8384159999999951);
tmpLen=Lafayette.length;
Lafayette[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Lafayette[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ivy Tech Community College-lafayette",'Lafayette=' + Lafayette.length);
tmpLatLng=new GLatLng(41.66264699999999976,-86.2475850000000008);
tmpLen=South_Bend.length;
South_Bend[tmpLen] = createMarker(tmpLatLng,"",iconGr);
South_Bend[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ivy Tech Community College-north Central",'South_Bend=' + South_Bend.length);
tmpLatLng=new GLatLng(41.11174799999999862,-85.1156699999999943);
tmpLen=Fort_Wayne.length;
Fort_Wayne[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Fort_Wayne[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ivy Tech Community College-northeast",'Fort_Wayne=' + Fort_Wayne.length);
tmpLatLng=new GLatLng(41.55463600000000212,-87.3193059999999974);
tmpLen=Gary.length;
Gary[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Gary[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ivy Tech Community College-northwest",'Gary=' + Gary.length);
tmpLatLng=new GLatLng(38.38962099999999821,-85.7653410000000064);
tmpLen=Sellersburg.length;
Sellersburg[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Sellersburg[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ivy Tech Community College-south Central",'Sellersburg=' + Sellersburg.length);
tmpLatLng=new GLatLng(38.78160299999999693,-85.3743439999999935);
tmpLen=Madison.length;
Madison[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Madison[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ivy Tech Community College-southeast",'Madison=' + Madison.length);
tmpLatLng=new GLatLng(38.01124200000000286,-87.5739159999999969);
tmpLen=Evansville.length;
Evansville[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Evansville[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ivy Tech Community College-southwest",'Evansville=' + Evansville.length);
tmpLatLng=new GLatLng(39.37003700000000350,-87.3887249999999937);
tmpLen=Terre_Haute.length;
Terre_Haute[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Terre_Haute[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ivy Tech Community College-wabash Valley",'Terre_Haute=' + Terre_Haute.length);
tmpLatLng=new GLatLng(39.78369699999999653,-86.1789619999999985);
tmpLen=Indianapolis.length;
Indianapolis[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Indianapolis[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Lincoln Technical Institute",'Indianapolis=' + Indianapolis.length);
tmpLatLng=new GLatLng(38.31082099999999712,-85.7445859999999981);
tmpLen=Jeffersonville.length;
Jeffersonville[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Jeffersonville[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Mid-america College Of Funeral Service",'Jeffersonville=' + Jeffersonville.length);
tmpLatLng=new GLatLng(39.88488199999999750,-86.2668890000000061);
tmpLen=Indianapolis.length;
Indianapolis[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Indianapolis[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Professional Careers Institute",'Indianapolis=' + Indianapolis.length);
tmpLatLng=new GLatLng(41.60354600000000147,-87.5216419999999999);
tmpLen=Hammond.length;
Hammond[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Hammond[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Sawyer College-hammond",'Hammond=' + Hammond.length);
tmpLatLng=new GLatLng(38.68661999999999778,-87.5206960000000009);
tmpLen=Vincennes.length;
Vincennes[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Vincennes[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Vincennes University",'Vincennes=' + Vincennes.length);
map.removeOverlays(Columbus);
map.removeOverlays(Donaldson);
map.removeOverlays(Evansville);
map.removeOverlays(Fort_Wayne);
map.removeOverlays(Gary);
map.removeOverlays(Hammond);
map.removeOverlays(Hobart);
map.removeOverlays(Indianapolis);
map.removeOverlays(Jeffersonville);
map.removeOverlays(Kokomo);
map.removeOverlays(Lafayette);
map.removeOverlays(Madison);
map.removeOverlays(Marion);
map.removeOverlays(Merrillville);
map.removeOverlays(Muncie);
map.removeOverlays(Richmond);
map.removeOverlays(Sellersburg);
map.removeOverlays(South_Bend);
map.removeOverlays(Terre_Haute);
map.removeOverlays(Vincennes);
setTimeout(function(){map.addOverlays(Columbus)},1000);
setTimeout(function(){map.addOverlays(Donaldson)},1000);
setTimeout(function(){map.addOverlays(Evansville)},1000);
setTimeout(function(){map.addOverlays(Fort_Wayne)},1000);
setTimeout(function(){map.addOverlays(Gary)},1000);
setTimeout(function(){map.addOverlays(Hammond)},1000);
setTimeout(function(){map.addOverlays(Hobart)},1000);
setTimeout(function(){map.addOverlays(Indianapolis)},1000);
setTimeout(function(){map.addOverlays(Jeffersonville)},1000);
setTimeout(function(){map.addOverlays(Kokomo)},1000);
setTimeout(function(){map.addOverlays(Lafayette)},1000);
setTimeout(function(){map.addOverlays(Madison)},1000);
setTimeout(function(){map.addOverlays(Marion)},1000);
setTimeout(function(){map.addOverlays(Merrillville)},1000);
setTimeout(function(){map.addOverlays(Muncie)},1000);
setTimeout(function(){map.addOverlays(Richmond)},1000);
setTimeout(function(){map.addOverlays(Sellersburg)},1000);
setTimeout(function(){map.addOverlays(South_Bend)},1000);
setTimeout(function(){map.addOverlays(Terre_Haute)},1000);
setTimeout(function(){map.addOverlays(Vincennes)},1000);
getPoly("","state","","IN");}
// 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(Columbus);
map.removeOverlays(Donaldson);
map.removeOverlays(Evansville);
map.removeOverlays(Fort_Wayne);
map.removeOverlays(Gary);
map.removeOverlays(Hammond);
map.removeOverlays(Hobart);
map.removeOverlays(Indianapolis);
map.removeOverlays(Jeffersonville);
map.removeOverlays(Kokomo);
map.removeOverlays(Lafayette);
map.removeOverlays(Madison);
map.removeOverlays(Marion);
map.removeOverlays(Merrillville);
map.removeOverlays(Muncie);
map.removeOverlays(Richmond);
map.removeOverlays(Sellersburg);
map.removeOverlays(South_Bend);
map.removeOverlays(Terre_Haute);
map.removeOverlays(Vincennes);
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(Donaldson);map.removeOverlays(Columbus);
map.removeOverlays(Donaldson);
map.removeOverlays(Evansville);
map.removeOverlays(Fort_Wayne);
map.removeOverlays(Gary);
map.removeOverlays(Hammond);
map.removeOverlays(Hobart);
map.removeOverlays(Indianapolis);
map.removeOverlays(Jeffersonville);
map.removeOverlays(Kokomo);
map.removeOverlays(Lafayette);
map.removeOverlays(Madison);
map.removeOverlays(Marion);
map.removeOverlays(Merrillville);
map.removeOverlays(Muncie);
map.removeOverlays(Richmond);
map.removeOverlays(Sellersburg);
map.removeOverlays(South_Bend);
map.removeOverlays(Terre_Haute);
map.removeOverlays(Vincennes);
map.addOverlays(Columbus);
centerByArray(Columbus, false, false);
cntMarker += Columbus.length;
map.addOverlays(Donaldson);
centerByArray(Donaldson, false, false);
cntMarker += Donaldson.length;
map.addOverlays(Evansville);
centerByArray(Evansville, false, false);
cntMarker += Evansville.length;
map.addOverlays(Fort_Wayne);
centerByArray(Fort_Wayne, false, false);
cntMarker += Fort_Wayne.length;
map.addOverlays(Gary);
centerByArray(Gary, false, false);
cntMarker += Gary.length;
map.addOverlays(Hammond);
centerByArray(Hammond, false, false);
cntMarker += Hammond.length;
map.addOverlays(Hobart);
centerByArray(Hobart, false, false);
cntMarker += Hobart.length;
map.addOverlays(Indianapolis);
centerByArray(Indianapolis, false, false);
cntMarker += Indianapolis.length;
map.addOverlays(Jeffersonville);
centerByArray(Jeffersonville, false, false);
cntMarker += Jeffersonville.length;
map.addOverlays(Kokomo);
centerByArray(Kokomo, false, false);
cntMarker += Kokomo.length;
map.addOverlays(Lafayette);
centerByArray(Lafayette, false, false);
cntMarker += Lafayette.length;
map.addOverlays(Madison);
centerByArray(Madison, false, false);
cntMarker += Madison.length;
map.addOverlays(Marion);
centerByArray(Marion, false, false);
cntMarker += Marion.length;
map.addOverlays(Merrillville);
centerByArray(Merrillville, false, false);
cntMarker += Merrillville.length;
map.addOverlays(Muncie);
centerByArray(Muncie, false, false);
cntMarker += Muncie.length;
map.addOverlays(Richmond);
centerByArray(Richmond, false, false);
cntMarker += Richmond.length;
map.addOverlays(Sellersburg);
centerByArray(Sellersburg, false, false);
cntMarker += Sellersburg.length;
map.addOverlays(South_Bend);
centerByArray(South_Bend, false, false);
cntMarker += South_Bend.length;
map.addOverlays(Terre_Haute);
centerByArray(Terre_Haute, false, false);
cntMarker += Terre_Haute.length;
map.addOverlays(Vincennes);
centerByArray(Vincennes, false, false);
cntMarker += Vincennes.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;
}