';
document.getElementById('resultsWrapper').style.display = 'block';
document.getElementById('searchResults').style.display = 'block';
document.getElementById('searchResults').innerHTML = noResultsMsg;
map.SetCenterAndZoom(centerPoint, 6);
}
}
function disambigResults(e){
var results = 'We found more than one match. Please select the location you were looking for:
';
document.getElementById('resultsWrapper').style.display = 'block';
document.getElementById('searchResults').innerHTML = results;
document.getElementById('searchResults').style.display = 'block';
}
}
function GetMidPointLatLong(returnType){
var midPoint = map.GetCenter();
if (returnType == 'lat'){
return midPoint.Latitude;
}else{
return midPoint.Longitude;
}
}
function GetTopLeftLatLong(){
var topPixel, leftPixel, topLeftLatLong;
// Get top and left pixel values
topPixel = map.GetTop();
leftPixel = map.GetLeft();
topPixel = 0;
leftPixel = 0;
// Convert our top/left pixels into lat/long
topLeftLatLong = map.PixelToLatLong(topPixel, leftPixel);
return topLeftLatLong;
}
function GetBottomRightLatLong(){
var midPointLat, midPointLong;
var topLeftLatLong, bottomRightLatLong;
var diffY, diffX;
topLeftLatLong = GetTopLeftLatLong();
// Get lat/long values for the CENTRE of the map
midPointLat = GetMidPointLatLong('lat');
midPointLong = GetMidPointLatLong('long');
// Calculate the difference from the top to centre, and from the left to centre
diffY = midPointLat - topLeftLatLong.Latitude;
diffX = midPointLong - topLeftLatLong.Longitude;
// Using the differences, get the lat/long value for bottom/right of the map
bottomRightLatLong = new VELatLong(midPointLat+diffY, midPointLong+diffX);
return bottomRightLatLong;
}
function scrollMap(x, y){
map.StartContinuousPan(x,y);
setTimeout('map.EndContinuousPan();',500);
}
/* Ajax */
var blnDebug = true;
function getHttpCon(){
var objCon = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
objCon = new XMLHttpRequest();
if (objCon.overrideMimeType) {
objCon.overrideMimeType('text/plain'); // Not XML - important this, otherwise FF has js error
}
} else if (window.ActiveXObject) { // IE
try {
objCon = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
objCon = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
if (blnDebug){
alert('Sorry, unable to create HTTP connection.');
}
}
}
}
return objCon;
}
function makeRequest(url, handlerFunc){
var objRequest = getHttpCon();
if (objRequest) {
objRequest.onreadystatechange = function(){return xmlRequestHandler(objRequest, handlerFunc);};
objRequest.open('GET', url, true);
objRequest.send(null);
}
}
function xmlRequestHandler(objRequest, handlerFunc){
if (objRequest.readyState == 4) {
if (objRequest.status == 200) {
var strResponse = objRequest.responseText;
handlerFunc(strResponse);
} else {
if (blnDebug){
alert('This site is experiencing technical difficulties.\n\nWe apologise for any inconvenience caused.\n\n(HTTP Request has failed: Error ' + objRequest.status + ').');
alert(objRequest.responseText);
}
}
objRequest = null;
return true;
}else{
return false;
}
}
function loadXmlData(strData){
var usersAr = strData.split('\n');
for (var i=0; i Actions:', usersAr[i][3]);
}
}
function getPermaLink() {
var latlong = map.GetCenter();
var lat = latlong.Latitude;
var long = latlong.Longitude;
var zoom = map.GetZoomLevel();
var linkage = '/includes/repository/127.asp?la=' + lat + '&lo=' + long + '&z=' + zoom;
makeRequest(linkage, showLink);
}
function showLink(strData) {
var results = 'Here is your link: