﻿var map = null;
var shape;
var pinid = 0;
		
	//-37.539500
	//143.829600
	
// Load Map
function LoadMap() {
    var lat = -37.539500;
    var lng = 143.829600;
    var LoadErr = 0;
    
    try
    {
        map = new VEMap('myMap');
        map.LoadMap(new VELatLong(lat,lng), 16 ,'r' ,false);
        
	    shape = new VEShape(VEShapeType.Pushpin, new VELatLong(lat,lng )); //map.GetCenter());
	    shape.SetTitle('Wendouree Centre for Performing Arts');
	    shape.SetDescription('WCPA'); //'This is shape number '+pinid);
	    map.AddShape(shape);
	    pinid++;        
        
    } catch (err)
    {
        if (LoadErr < 5)
        {
            LoadErr++;
            setTimeout("LoadMap()",1000);
        }else
        {
            alert("The Mapping Control failed to load!");
        }
    }    
    //AddPushpin();
}

/* Areas
function ShowMap(el_id) {

	if(document.getElementById(el_id).style.visibility == 'visible') {
		document.getElementById(el_id).style.visibility = 'hidden';
	} else {
		document.getElementById(el_id).style.visibility = 'visible';
	}
} */

/* Push Pins		
function AddPushpin() {
    var LoadErr = 0;
    try
    {
	    shape = new VEShape(VEShapeType.Pushpin, new VELatLong(-37.539660, 143.829600)); //map.GetCenter());
	    shape.SetTitle('Wendouree Centre for Performing Arts');
	    shape.SetDescription('WCPA'); //'This is shape number '+pinid);
	    map.AddShape(shape);
	    pinid++;
	}   catch (err)
	{
	    if (LoadErr < 5)
	    {
	        LoadErr++;
	        setTimeout("AddPushpin()",1000);
	    } else
	    {
	        alert("Failed to load Map Shapes!")
	    }
	}
} 
		
function GetInfo() {
    alert('The latitude,longitude at the center of the map is: '+ map.GetCenter());
	// <!-- <INPUT id="getinfo" type="button" value="Get Info" name="getInfo"          onclick="GetInfo();"> //-->            
}
*/