﻿/*
AUTHOR:     LK
CREATED:    11/11/08
LAST CHANGE:  11/11/08 - Creation
*/

var _map = null; // global variable to hold map instance
var zoomInLevel = 16;
var DEFAULT_SUBURB_POSTCODE_TEXT = "Please enter either a suburb or postcode.";
var DEFAULT_MULTIPLE_TEXT = "Multiple results found. Please select the best match from the list and click search."
var DEFAULT_NO_ADDRESS_FOUND_TEXT = "From : Sorry all attempts to locate the input address have failed."

function LoadDefaultText()
{
    if (document.getElementById('txtSuburb').value.length < 1){
     document.getElementById('lblError').value = DEFAULT_SUBURB_POSTCODE_TEXT; 
    }
 }
 
function Clear_onclick() {
    document.getElementById('txtStreet').value = "";
    document.getElementById('txtSuburb').value = "";
    document.getElementById('txtPostcode').value = "";
}

function loadMap(lat,lng) {
    // create a MDSMap instance
    _map=new MDSMap($get('mymap'));
    // pass in the key for the session
    _map.UserIDSet($get('UserID').value);
    // load the map - use centre provided
    _map.LoadMap(lat,lng,723,430,823,500);
}

function loadSmallMap(lat,lng) {
    // create a MDSMap instance
    _map=new MDSMap($get('mymap'));
    // pass in the key for the session
    _map.UserIDSet($get('UserID').value);
    // load the map - use centre provided
    _map.LoadMap(lat,lng,454,300,554,400);
    zoomToStreetLevel();
    
    var mbr = _map.MBR();
    document.getElementById('mbrTop').value = mbr.Top;
    document.getElementById('mbrLeft').value = mbr.Left;
    document.getElementById('mbrBottom').value = mbr.Bottom;
    document.getElementById('mbrRight').value = mbr.Right;
}





