	function onViewChange(e)
	{
		ShowInfo();
	}

	function onAfterLoad(e)
	{
		alert('after load');
		map.HideDashboard();         

	}

	function onEndZoom(e)
	{
		alert('end zoom');
		ShowInfo();
	}
	
	function ShowControl()         
	{            
		map.ShowDashboard();         
	}         
	
	function GoToGoogle()
	{
		sCenter = "" + map.GetCenter();
		intPos = sCenter.indexOf(',');
		curLat = sCenter.substr(0,intPos);
		curLong = sCenter.substr(intPos+1,25);
		curZoom = map.GetZoomLevel();
		sFullString = sGooglePage + '?Lat=' + curLat + '&Long=' + curLong + '&Zoom=' + curZoom;
		newWin = window.location.href = sFullString;
		//newWin = window.location(sFullString);
		
	}
		
	function HideControl()         
	{            
		map.HideDashboard();         
	} 
	
	function ChangeMapType(targ,selObj,restore)
	{ 
		newType = selObj.options[selObj.selectedIndex].value;
		if (newType == "Road" )
		{
			map.SetMapStyle(VEMapStyle.Road);
		}
		if (newType == "Satellite" )
		{
			map.SetMapStyle(VEMapStyle.Aerial);
		}
		if (newType == "Hybrid" )
		{
			map.SetMapStyle(VEMapStyle.Hybrid);
		}
	}

	function FindLoc()         
	{            
		map.FindLocation(document.getElementById('txtWhere').value);         
	}  

	function NewLatLong()         
	{ 
		if (isNaN(document.getElementById('latcontrol').value)) 
		{
			alert('Latitude must be a number less than 90 and greater than -90');
			exit;
		}
		else 
		{
			x = eval(document.getElementById('latcontrol').value);
		}
		
		if (isNaN(document.getElementById('longcontrol').value))
		{
			alert('Longitude must be a number less than 180 and greater than -180');
			exit;
		}
		else 
		{
			y = eval(document.getElementById('longcontrol').value);
		}
		
		if (x >= 90 || x <= -90)
		{
			alert('Latitude must be a number less than 90 and greater than -90');
			exit;
		}
		if (y >= 180 || y <= -180)
		{
			alert('Longitude must be a number less than 180 and greater than -180');
			exit;
		}
		latlong = new VELatLong(x,y);						
		map.PanToLatLong(latlong);						
	}  

	function ChangeMapStyle()         
	{            
		var s=map.GetMapStyle();            
		if (s==VEMapStyle.Hybrid)            
		{               
			map.SetMapStyle(VEMapStyle.Road);            
		}            
		else            
		{               
		map.SetMapStyle(VEMapStyle.Hybrid);            
		}         
	}
 
	function CustomZoom(x)
	{
		curZoom = map.GetZoomLevel();
		newZoom = eval(curZoom) + eval(x);
		map.SetZoomLevel(newZoom);
		document.getElementById('zoomcontrol').selectedIndex = map.GetZoomLevel();
	}

	function ShowInfo()
	 {
		sCenter = "" + map.GetCenter();
		intPos = sCenter.indexOf(',');
		curLat = sCenter.substr(0,intPos);
		curLong = sCenter.substr(intPos+1,25);
		document.getElementById('latcontrol').value = curLat;
		document.getElementById('longcontrol').value = curLong;
		document.getElementById('zoomcontrol').selectedIndex = map.GetZoomLevel();
	 }		

	function SetZoom(targ,selObj,restore)
	{ 
	  //eval(targ+".location='"+zselObj.options[selObj.selectedIndex].value+"'");
	  //if (restore) 
	  map.SetZoomLevel(selObj.options[selObj.selectedIndex].value);
	  selObj.selectedIndex=map.GetZoomLevel();
	}
