
"+name+"<\/b>" + address.replace(',', '
') + "<\/p><\/a><\/div>";
}
html+= "
to hotel<\/a>";
var category = markers[i].getAttribute("category");
// Create the markers
map.addOverlay(createMarker(point, name, html, category, id));
}
if(gmarkers) {
// Sort categories and names to display
// both in alphabetic order
gmarkers.sort(compareCats);
}
// Show or hide the categories initially
visible.show("hotel");
makeSidebar();
}
}; request.send(null);
}
var compareCats = function(a, b) {
var n1 = a.sorter;
var n2 = b.sorter;
var c1 = a.category;
var c2 = b.category;
// Sort categories and names
if(a.category == b.category){
if(a.sorter == b.sorter){
return 0;
}
return (a.sorter < b.sorter) ? -1 : 1;
}
return (a.category < b.category) ? -1 : 1;
}
function setDirections(fromAddress, toAddress, locale) {
gdir.load("from: " + fromAddress + " to: " + toAddress,
{ "locale": locale });
}
function handleErrors(){
$('#print2').css('display', 'none');
if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.");
else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code);
// else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS) <--- Doc bug... this is either not defined, or Doc is wrong
// alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_BAD_KEY)
alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code);
else alert("An unknown error occurred.");
}
function onGDirectionsLoad(){
window.setTimeout("gotomap()", 1000);
$('#print2').css('display', 'block');
}
//]]>