// -- Parse The Arguments Passed var args; if (args == null) { args = new Array(); all_args = document.URL.split("?"); if(all_args[1]) { arg_vals = all_args[1].split("&"); for(var x=0; x 0) { verbose = args["verbose"]; } if (args["bdc"] == 1 ) { bdc = 1; } // -- Global Variables var gotdirections = 0; var sbthold = 17; // -- Zoom Level To Start Showing Bars On The Map In The Side Bar Default = 15 var map; // var gdir; // var zl = 12; // var outzl = 12; // -- The Start Value var refresh = true; // var lastswlat = 0; // var lastswlong = 0; // var lastnelat = 0; // var lastnelong = 0; // var focused_marker; // -- Marker Passed In Frm Site var focus; // -- Trigger Set If It Is // -- These Arrays Are Cleared When The Getpoints Function Runs, Otherwise They Hold The Values For The Driving Directions And Side Bar var i = 0; var counter; var side_bar_html = ""; var gmarkers = []; var points = []; var names = []; var tooltip = document.createElement("div"); // -- Icons And Cluster Icon Array var s_pin = new GIcon(); s_pin.image = "http://morgantown.barsmart.com/gfx/pngs/red_small.png"; s_pin.shadow = "http://morgantown.barsmart.com/gfx/pngs/shadow_small.png"; s_pin.transparent = "http://morgantown.barsmart.com/gfx/pngs/xp_shadow_small.png"; s_pin.imageMap = [0,4, 1,4, 1,2, 2,2, 2,1, 3,1, 3,0, 9,0, 9,1, 10,1, 10,2, 11,2, 11,3, 11,4, 12,4, 12,8, 11,8, 11,9, 10,9, 10,10, 9,10, 9,11, 8,11, 8,14, 7,14, 7,20, 5,20, 5,14, 4,14, 4,12, 3,12, 3,11, 2,11, 2,10, 1,10, 1,9, 1,8, 0,8]; s_pin.iconSize = new GSize(12, 20); s_pin.shadowSize = new GSize(22, 20); s_pin.iconAnchor = new GPoint(6, 20); s_pin.infoWindowAnchor = new GPoint(5, 1); s_pin.maxHeight = 30.0; var cityIcon = new GIcon(); cityIcon.image = "http://morgantown.barsmart.com/gfx/pngs/cityicon.png"; cityIcon.iconSize = new GSize(23,32); cityIcon.shadow = "http://morgantown.barsmart.com/gfx/pngs/shadow_cityicon.png"; cityIcon.transparent = "http://morgantown.barsmart.com/gfx/pngs/xp_cityicon.png"; cityIcon.shadowSize = new GSize(39,32); cityIcon.iconAnchor = new GPoint(12,32); cityIcon.infoWindowAnchor = new GPoint(12,0); cityIcon.imageMap = [22,0,22,1,22,2,22,3,22,4,22,5,22,6,22,7,22,8,22,9,22,10,22,11,22,12,22,13,22,14,22,15,22,16,22,17,22,18,22,19,22,20,22,21,22,22,14,23,14,24,14,25,13,26,13,27,12,28,12,29,12,30,11,31,11,31,10,30,10,29,9,28,9,27,9,26,8,25,8,24,8,23,0,22,0,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,0,13,0,12,0,11,0,10,0,9,0,8,0,7,0,6,0,5,0,4,0,3,0,2,0,1,0,0]; var f_pin = new GIcon(); f_pin.image = "http://morgantown.barsmart.com/gfx/pngs/focusedpin.png"; f_pin.shadow = "http://morgantown.barsmart.com/gfx/pngs/focusedpin_s.png"; f_pin.transparent = "http://morgantown.barsmart.com/gfx/pngs/xp_f_pin.png"; f_pin.imageMap = [1,13, 12,11, 18,1, 24,11, 35,13, 27,22, 29,34, 18,28, 8,34, 9,22]; f_pin.iconSize = new GSize(36, 34); f_pin.shadowSize = new GSize(54, 34); f_pin.iconAnchor = new GPoint(18, 17); f_pin.infoWindowAnchor = new GPoint(18,2); f_pin.maxHeight = 30.0; var c_icon = []; for (icons = 0; icons <= 51; icons++) { c_icon[icons] = new GIcon(); c_icon[icons].image = "http://morgantown.barsmart.com/gfx/pngs/cp"+icons+".png"; c_icon[icons].transparent = "http://morgantown.barsmart.com/gfx/pngs/xp_cp.png"; c_icon[icons].imageMap = [2,16, 2,3, 10,3, 17,1, 27,1, 37,6, 41,14, 43,19, 43,27, 41,32, 38,36, 41,39, 38,42, 34,39, 28,43, 17,43, 11,40, 5,36, 2,30, 1,24, 1,19, 1,16]; c_icon[icons].iconSize=new GSize(44,44); c_icon[icons].iconAnchor=new GPoint(22,22); c_icon[icons].infoWindowAnchor=new GPoint(22,22); if (icons == 51) { c_icon[icons] = new GIcon(); c_icon[icons].image = "http://morgantown.barsmart.com/gfx/pngs/cp50p.png"; c_icon[icons].transparent = "http://morgantown.barsmart.com/gfx/pngs/xp_cp.png"; c_icon[icons].imageMap = [2,16, 2,3, 10,3, 17,1, 27,1, 37,6, 41,14, 43,19, 43,27, 41,32, 38,36, 41,39, 38,42, 34,39, 28,43, 17,43, 11,40, 5,36, 2,30, 1,24, 1,19, 1,16]; c_icon[icons].iconSize=new GSize(44,44); c_icon[icons].iconAnchor=new GPoint(22,22); c_icon[icons].infoWindowAnchor=new GPoint(22,22); } } // -- Failure Codes For Driving Directions var causes=[]; causes[G_GEO_BAD_KEY] = "The given key is either invalid or does not match the domain for which it was given."; causes[G_GEO_TOO_MANY_QUERIES] = "The given key has gone over the requests limit in the 24 hour period."; causes[G_GEO_MISSING_ADDRESS] = "Missing Address: The address was either missing, had no value, or could not be successfully parsed."; causes[G_GEO_UNKNOWN_ADDRESS] = "No corresponding geographic location could be found for the specified address. This may be due to the fact that the address is relatively new, or it may be incorrect."; causes[G_GEO_SERVER_ERROR] = "A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known."; causes[G_GEO_BAD_REQUEST] = "A directions request could not be successfully parsed."; causes[G_GEO_MISSING_QUERY] = "The HTTP q parameter was either missing or had no value. For geocoding requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input."; causes[G_GEO_UNKNOWN_DIRECTIONS] = "The GDirections object could not compute directions between the points mentioned in the query. This is usually because there is no route available between the two points, or because we do not have data for routing in that region."; causes[G_GEO_UNAVAILABLE_ADDRESS] = "The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons."; causes[G_GEO_SUCCESS] = "Success"; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function Createtabbedmarker(Marker Point,Html Text, Bar Name) // Creates A Tabbed Marker With Info, Reviews And Driving Direction Tabs // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function createTabbedMarker(point,text,name,focus) { var bar_info; var tabs; if (focus == 1) { var marker = new GMarker(point,f_pin); } else { var marker = new GMarker(point,s_pin); } gmarkers[i] = marker; points[i] = marker.getPoint(); // -- Duplicate These Funcs For Listener marker.tooltip = '
 '+name.replace(/ /g, " ")+' 
'; GEvent.addListener(marker,"click", function() { DataURL = "http://morgantown.barsmart.com/getbubble?id="+text; // -- Debugging if (verbose > 2) { GLog.writeHtml(""+DataURL+""); var testnumvarthing = marker.getPoint(); GLog.writeHtml("Passed in Lat/Lon "+testnumvarthing); } points[i] = marker.getPoint(); GDownloadUrl(DataURL, function(data, responseCode) { names[i] = name; var jscript = data; var bars; eval(jscript); for (j in bars) { var imgprops = " height=\"31\" width=\"41\" hspace=\"2px\" border=\"0\" "; var imgprefx = ""; if (bars[j].rating == 1) { if (bars[j].web.length > 3) { bar_icons += "" + imgprefx + "webicon.gif\"" + imgprops + "alt=\"Web Page\" title=\"Web Page\">"; } else { bar_icons += imgprefx + "o_webicon.gif\"" + imgprops + "alt=\"N/A\">"; } if (bars[j].darts == 1) { bar_icons += imgprefx + "darts.gif\"" + imgprops + "alt=\"Darts\" title=\"Darts\">"; } else { bar_icons += imgprefx + "o_darts.gif\"" + imgprops + "alt=\"N/A\">"; } if (bars[j].dancing == 1) { bar_icons += imgprefx + "danceicon2.gif\"" + imgprops + "alt=\"Dancing\" title=\"Dancing\">"; } else { bar_icons += imgprefx + "o_danceicon2.gif\"" + imgprops + "alt=\"N/A\">"; } if (bars[j].pool == 1) { bar_icons += imgprefx + "8_ball.gif\"" + imgprops + "alt=\"Pool\" title=\"Pool\">"; } else { bar_icons += imgprefx + "o_8_ball.gif\"" + imgprops + "alt=\"N/A\">"; } if (bars[j].smoke == 1) { bar_icons += imgprefx + "o_smoking.gif\"" + imgprops + "alt=\"Smoking\">"; } else { bar_icons += imgprefx + "smoking.gif\"" + imgprops + "alt=\"Smoke-Free\">"; } } // -- We Got Most Of The Non Smoking Bars So If A Bar Is Non Smoking And Not Rated We Can Show This Extra Here. else { if (bars[j].smoke == 1) { bar_icons += imgprefx + "o_smoking.gif\"" + imgprops + "alt=\"Smoking\">"; } else { bar_icons += imgprefx + "smoking.gif\"" + imgprops + "alt=\"Smoke-Free\">"; } } bar_icons += ""; if (bars[j].pic == 1) { var picsrc = ""; } else { var picsrc = ""; } bar_info = picsrc+""+names[i]+"
"+bars[j].address+"
"+bars[j].city+", "+bars[j].state+" "+bars[j].zip+"
"+bars[j].phone+""+"
Is this wrong?"; } // -- To Here And From Here Links html = "
Directions: To here | from here.
"; var stackOpts = 0; var iw_start = '
'; var iw_end = '
'; /* if (focus == 1) { } */ var tabs = iw_start+bar_info+bar_icons+html+iw_end; marker.openInfoWindowHtml(tabs); }); });// -- End the click listener GEvent.addListener(marker,"mouseover", function() { showTooltip(marker); }); GEvent.addListener(marker,"mouseout", function() { tooltip.style.visibility="hidden" }); if (map.getZoom() >= sbthold) { if ((i % 2) == 0) { side_bar_html += ''; } else { side_bar_html += '
' + name + '
'; } } i++; return marker; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function Createclustermarker(Markerpoint,Ammount In Marker Text) // Creates Cluster Markers With Custom Icon // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function createClusterMarker(point,text) { if (text < 50){ var marker = new GMarker(point,c_icon[text]); } else { var marker = new GMarker(point,c_icon[51]); } points[i] = marker.getPoint(); gmarkers[i] = marker; marker.tooltip = '
 Click to zoom in and see '+text+' bars in this general area. 
'; // -- The Click Handler Below Used To Store The Htmltext Var With A Zoom Link In It. // -- This Was Replaced With A Click Zoom On The Marker And Seting Map Center To It. // var Htmltext = ""+Text+" Bars In Or Near This General Area.
Click Here To Zoom In."; // -- Code Below Resided In The Function Below. // marker.openInfoWindow(htmltext); GEvent.addListener(marker,"click", function() { clusterZoom(point); if (verbose > 2) { GLog.writeHtml("center point: "+point); } tooltip.style.visibility="hidden"; }); GEvent.addListener(marker,"mouseover", function() { showTooltip(marker); }); GEvent.addListener(marker,"mouseout", function() { tooltip.style.visibility="hidden" }); i++; return marker; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function CreateCityMarker(Markerpoint) // Creates City Markers With Custom Icon // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function CreateCityMarker(point,city,web) { var marker = new GMarker(point,cityIcon); points[i] = marker.getPoint(); gmarkers[i] = marker; marker.tooltip = '
 Click to zoom in to '+city+' . 
'; GEvent.addListener(marker,"click", function() { window.location="http://"+web+".barsmart.com/locations.cfm"; if (verbose > 2) { GLog.writeHtml("center point: "+point); } tooltip.style.visibility="hidden"; }); GEvent.addListener(marker,"mouseover", function() { showTooltip(marker); }); GEvent.addListener(marker,"mouseout", function() { tooltip.style.visibility="hidden" }); i++; return marker; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function Load() // Loads The Map // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function load() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); map.addControl(new GScaleControl()); map.addControl(new GOverviewMapControl(new GSize(150,150))); // -- Currently Set To The Center Of Town if (bdc == 1) { map.setCenter(new GLatLng(args["lat"], args["lon"]), 19); } else { map.setCenter(new GLatLng(39.63874440886546, -79.94939804077148), 14); } map.enableDoubleClickZoom(); map.getPane(G_MAP_FLOAT_PANE).appendChild(tooltip); gdir = new GDirections(map, document.getElementById("driving")); tooltip.style.visibility="hidden"; GEvent.addListener(gdir, "error", function() { var code = gdir.getStatus().code; var cause="Code "+code; if (causes[code]) { cause = causes[code] } alert("Failed to obtain directions, "+cause); }); GEvent.addListener(map, "zoomend", function() { if (map.getZoom() > outzl){ refresh = true; } getPoints(map); if (map.getZoom() >= sbthold) { showSidebar('side_bar'); if (gotdirections == 1){ showSidebar('driving'); } hideSidebar('side_info_bar'); } else { hideSidebar('side_bar'); if (gotdirections == 0) { showSidebar('side_info_bar'); } if (gotdirections == 1) { showSidebar('driving'); } } }); GEvent.addListener(map, "moveend", function() { var iw = map.getInfoWindow(); // -- Prevents Reloading The Map If An Info Window Is Open if (!iw.isHidden()) { // -- Don't Refresh Or Get Points At All } else { getPoints(map); } }); getPoints(map); } else { alert("Sorry, the Google Maps API is not compatible with this browser"); } } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function Getdirections() // Send Request To Google To Get Mapping Directions // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function getDirections() { gotdirections = 1; showSidebar('driving'); hideSidebar('side_info_bar'); hideSidebar('side_bar'); showHide('driving_help'); showHide('driving_reset'); var saddr = document.getElementById("saddr").value var daddr = document.getElementById("daddr").value map.clearOverlays(); gdir.load("from: "+saddr+" to: "+daddr); if (map.getZoom() >= sbthold) { document.getElementById("side_bar").innerHTML = "This is disabled while you have directions visible in the Directions tab. If you want to see bars here click \"Reset Directions\" on the Directions tab."; } } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function Cleardirections() // Clear The Directions Object, Hide The Window, And Refresh The Map // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function ClearDirections() { gdir.clear(); gotdirections = 0; showHide('driving_help'); showHide('driving_reset'); refresh = true; getPoints(map); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // BEGIN: function sbClick() // opens info windows of items clicked on in side bar // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function sbClick(i) { GEvent.trigger(gmarkers[i], "click"); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function Directions(Tohere/Fromhere,Points Array Position,Place Name) // Rewrites The 'directionfromto' Div With Appropriate Direction Form // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function directions(direction,i,name) { var d_html = ""; switch(direction) { // -- To Here Directions Form case "tohere" : d_html += "
"; d_html += "
"; d_html += ""; d_html += ""; d_html += ""; d_html += ""; d_html += "
"; d_html += "
"; d_html += "
"; break; // -- From Here Directions Form case "fromhere" : d_html += "
"; d_html += "
"; d_html += ""; d_html += ""; d_html += ""; d_html += ""; d_html += "
"; d_html += "
"; d_html += "
"; break; } // -- Set The Inner Html To The Appropriate Form To Here Or From Here document.getElementById('directionfromto').innerHTML = d_html; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function Showhide(Object Id) // Flip The Loading Box On/Off // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function showHide(obj) { var objID = document.getElementById(obj); objID.style.display = (objID.style.display == "none")?"":"none"; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function Showtooltip(Marker) // Shows The Tooltips For The Bar Names // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function showTooltip(marker) { tooltip.innerHTML = marker.tooltip; var point=map.getCurrentMapType().getProjection().fromLatLngToPixel(map.fromDivPixelToLatLng(new GPoint(0,0),true),map.getZoom()); var offset=map.getCurrentMapType().getProjection().fromLatLngToPixel(marker.getPoint(),map.getZoom()); var anchor=marker.getIcon().iconAnchor; var width=marker.getIcon().iconSize.width; var height=tooltip.clientHeight; var pos = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(offset.x - point.x - anchor.x + width, offset.y - point.y -anchor.y -height)); pos.apply(tooltip); tooltip.style.visibility="visible"; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function Hidesidebar() // Hides The Sidebar When We Are In Clusters And Pins Mode // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function hideSidebar(obj) { var objID = document.getElementById(obj); objID.style.display = "none"; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function Showsidebar() // Shows The Sidebar When We Are Not In Clusters And Pins Mode // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function showSidebar(obj) { var objID = document.getElementById(obj); var dir = document.getElementById("directions"); var hel = document.getElementById("help"); var loc = document.getElementById("locations"); objID.style.display = "block"; if (obj == "side_bar") { dir.className = ""; hel.className = ""; loc.className = "active"; } else if (obj == "driving") { dir.className = "active"; hel.className = ""; loc.className = ""; } else { dir.className = ""; hel.className = "active"; loc.className = ""; } } function activateButton (obja,objb,objc) { var objaID = document.getElementById(obja); var objbID = document.getElementById(objb); var objcID = document.getElementById(objc); objaID.style.fontWeight = "bold"; objbID.style.fontWeight = "normal"; objcID.style.fontWeight = "normal"; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function Clusterzoom() // Provides An Animated Zoom To A Clusters X,Y Location // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function clusterZoom(i) { // -- This Went Away Because We Changed The Cluster Click From An Info Popup To A Straight Zoom // map.closeInfoWindow(); map.zoomIn(i,true,true); if (verbose > 2) { GLog.writeHtml("Passed lat/lon: "+i+"."); } } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function Clearallmarkers() // Clears All Of The Markers From The Map And Resets Our Arrays Between Point Loads // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function ClearAllMarkers() { for (var i in gmarkers) { if (gmarkers[i]) map.removeOverlay(gmarkers[i]); if (verbose > 3) { GLog.writeHtml("Removing Marker: "+i+"."); } } // -- These Arrays Are Cleared When We Refresh The Data On The Page // -- They Hold The Values For The Driving Directions And Side Bar Etc.. i = 0; counter = 0; side_bar_html = ""; gmarkers = []; points = []; names = []; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function Getpoints() // Gets Points From Xml File If Page Is Refreshed Or The Map Is Moved Significantly // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function getPoints(map) { var center = map.getCenter(); var bounds = map.getBounds(); outzl = zl; zl = map.getZoom(); var mapsw = bounds.getSouthWest(); var mapne = bounds.getNorthEast(); var mapswlat = mapsw.lat(); var mapswlong = mapsw.lng(); var mapnelat = mapne.lat(); var mapnelong = mapne.lng(); var dataswlat = mapswlat - (mapnelat-mapswlat)/2; var dataswlong = mapswlong - (mapnelong-mapswlong)/2; var datanelat = mapnelat + (mapnelat-mapswlat)/2; var datanelong = mapnelong + (mapnelong-mapswlong)/2; if (zl > 9) { if (verbose > 2) { GLog.writeHtml(zl+"\n"); } if ((refresh || mapswlat < lastswlat || mapswlong < lastswlong || mapnelat > lastnelat || mapnelong > lastnelong)) { lastswlat = dataswlat; lastswlong = dataswlong; lastnelat = datanelat; lastnelong = datanelong; // map.clearOverlays(); ClearAllMarkers(); // -- Loading Message document.getElementById("loading_status_content").innerHTML = "Please wait a moment..."; showHide('loading_status'); PointsURL = "http://morgantown.barsmart.com/getpoints?swlat="+dataswlat+"&swlng="+dataswlong+"&nelat="+datanelat+"&nelng="+datanelong+"&zl="+zl+"&grdsz=13"+"&page=4"; // -- Debugging if (verbose > 2) { GLog.writeHtml(""+PointsURL+""); } GDownloadUrl(PointsURL, function(data, responseCode) { var jscript = data; var bars; var barsLength; eval(jscript); // -- Create Points for (i in bars) { counter++; var thisLat = parseFloat(bars[i].lat); var thisLon = parseFloat(bars[i].lon); var MarkType = bars[i].type; // get the point type var bar = new GLatLng(thisLat,thisLon); var bar_name = bars[i].n; if (MarkType == 'm') { var bar_ID = bars[i].id; // -- Make A Custom Pin For Map/Directions Requested On The Site if (thisLat == args["lat"] && thisLon == args["lon"]) { focus = 1; focused_marker = i; } else { focus = 0; } map.addOverlay(createTabbedMarker(bar, bar_ID,bar_name,focus)); // -- Update The Loader With This Establishment --- And Delay So The Results Can Be Seen. window.setTimeout('UpdateLoader('+counter+','+barsLength+')', 500); // -- If This Is A Focused Point And The First Time In, Trigger The Info Window if (bdc == 1) { setTimeout("sbClick(focused_marker)",100); bdc = 0; // -- Toggle The Trigger Off } } else { var num_bars = bars[i].c; map.addOverlay(createClusterMarker(bar, num_bars)); if (verbose > 3) { // -- Debugging GLog.writeHtml(counter+" "+num_bars+" "+bar); } } // -- Update The Loader With This Cluster --- And Delay So The Results Can Be Seen. window.setTimeout('UpdateLoader('+counter+','+barsLength+')', 500); } window.setTimeout("showHide('loading_status')",700); if (map.getZoom() >= sbthold) { document.getElementById("side_bar").innerHTML = side_bar_html; } else { document.getElementById("side_bar").innerHTML = "You must zoom in more to see bars listed here."; } }); refresh = false; } } else { ClearAllMarkers(); citylevel1 = new GLatLng(40.44177859358136, -80.01291275024414); //pgh citylevel2 = new GLatLng(24.553721,-81.801177);//kw citylevel3 = new GLatLng(39.63874440886546,-79.94939804077148);//erie // citylevel4 = new GLatLng(42.033994349356604,-80.12466430664062);//motown citylevel5 = new GLatLng(40.79373,-77.860704);//SC citylevel7 = new GLatLng(40.26511849423995,-76.88095092773438);//harrisburg map.addOverlay(CreateCityMarker(citylevel1,'Pittsburgh','www')); map.addOverlay(CreateCityMarker(citylevel2,'Key West','keywest')); map.addOverlay(CreateCityMarker(citylevel3,'Morgantown','morgantown')); map.addOverlay(CreateCityMarker(citylevel4,'Erie','erie')); map.addOverlay(CreateCityMarker(citylevel5,'State College','statecollege')); map.addOverlay(CreateCityMarker(citylevel7,'Harrisburg','harrisburg')); } } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Begin: Function UpdateLoader(Current Point Count, Total Points) // Gets Points From Xml File If Page Is Refreshed Or The Map Is Moved Significantly // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function UpdateLoader(cnt,tot) { var Obj = document.getElementById("loading_status_content"); Obj.innerHTML = "Plotting point " + cnt + " / " + tot + " points."; } function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ ro = new XMLHttpRequest(); } return ro; } var http = createRequestObject(); function sndReq(barid,barname) { http.open('get', '/include/queries/barstack.cfm?barid='+barid+'&barname='+barname); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4){ var response = http.responseText; var update = new Array(); if(response.indexOf('|' != -1)) { update = response.split('|'); if (update[2] == 1) { //var linkage = "delete"; var linkage = "\"Add\"";// } else { //var linkage = "Add"; var linkage = "\"Remove\"";// } document.getElementById(update[0]).innerHTML = linkage; } } }