

          var map = null;
		  

$j(document).ready(function()
    {
   
		// is there a fixed latitude and longitude for this property?	
		if (latitude!=0 || longitude!=0)
	    {
			var map = new VEMap('myMap');
	        
			
			map.LoadMap(new VELatLong(latitude,longitude), zoom ,'h' ,false);
			var pin = new VEShape(VEShapeType.Pushpin, new VELatLong(latitude,longitude));
			map.AddShape(pin);
		    
			
			return;
	    }
		
		// if there is a location for this property try to retrieve lat/long from webservice
		if (worldid>0)
		{
		    url="/tmc.system/geo.services.locations.asp?GetLatitudeLongitude=y&countryName=" + country + "&worldid=" + worldid;
			if (isLondon)
				url=url + "&isLondon=true";
				
			
		    $j.getJSON(url,function(s)
				{
					
					var map = new VEMap('myMap');
					var lat=s.latitude;
					var lng=s.longitude;
					
					if (lat==0 && lng==0)
					{
						// lat/long not found so hide the panel
						$j("#mapbox").hide();
						return;
					}
					
					map.LoadMap(new VELatLong(lat,lng), s.zoom ,'h' ,false);
		    });
		}
		else
		{
			// no location so hide the panel
			$j("#mapbox").hide();
		}
	
    });//ready

