var map;
var geocoder = new GClientGeocoder();
var dealers;
var mgr;
var batch;
var currentmarker;
function maildealer(addr) {
var el = document.getElementById('popup');
hs.htmlExpand(el);
}
function formatInfo(data) {
var html = ''+data.ai_company+'
';
if (!data.ai_company || data.ai_company == '')
html += ''+data.ai_name+'
';
if (typeof(data.ai_phone) != "undefined")
html += data.ai_phone + '
';
html += data.ai_address + '
';
html += data.ai_city + ', ' + data.ai_state +' '+ data.ai_zipcode+'
';
var szip = document.forms[0].zipcode.value.toString();
//html += 'Contact Dealer';
html += 'Contact Dealer';
// html += 'Contact Dealer';
html += '
';
var addrst = escape(data.ai_address + ', ' + data.ai_city + ', ' + data.ai_state +' '+ data.ai_zipcode);
html += '
Get Directions';
var info = document.getElementById('dealer');
info.innerHTML = html;
return html;
}
function showAddress(address,data) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
var html = formatInfo(data);
marker.openInfoWindowHtml(html);
var info = document.getElementById('dealer');
info.innerHTML = html;
}
}
);
}
var icn = new GIcon();
icn.image = "red-pushpin.png" ;
icn.iconAnchor = new GPoint(16, 32);
icn.infoWindowAnchor = new GPoint(13,32);
icn.iconSize = new GSize(32, 32);
icn.shadow = "pushpin_shadow.png";
icn.shadowSize = new GSize(59, 32);
function displayInfo() {
currentmarker.openInfoWindowHtml(formatInfo(currentmarker.data));
}
function getMarkers() {
batch = [];
for (var i =0; i