// Javascript File for MS Virtual Earth...
         var map = null;
         var selstyle = VEMapStyle.Road;
         var selMode = VEMapMode.Mode2d;
         var zoom = 15;
         var be = null;
         var id = null;
         var mapControlState = 'Hide';
         var Lat = new Number (0);
         var Long = new Number (0);
         var pinID = 1;
         var Address = null;
         var PID = null;
         
         function GetMap(){
         try
         {
         Lat = document.getElementById("hYParam");
	     Long = document.getElementById("hXParam");  
         map = new VEMap('myMap');
         map.LoadMap(new VELatLong(Lat.value, Long.value),zoom,selstyle,0,selMode,0,2);
         map.ShowMiniMap(2,203);
            if (map.IsBirdseyeAvailable()) {
                map.SetMapStyle(VEMapStyle.BirdseyeHybrid);
            }else{
                StartTheTimer();
            }
         AddPin();
         }
         catch(ex)
         {
         //Displays message to all other browsers that do not support VML or SVG...
         alert(ex.message);
         }
         }
         
         //Set Timer because MS takes a second to return true from BirdseyeAvailable
         var secs = 1;
         var totalCount = 0;
         function StartTheTimer(){
         var delay = 50;
            if (secs==0){
            
                if (map.IsBirdseyeAvailable()) {
                map.SetMapStyle(VEMapStyle.BirdseyeHybrid);
                mapZoom();
                }else{
                secs = 1;
                StartTheTimer();
                totalCount = totalCount + 1;
                }  
            }else{
                secs = secs -1
                timerID = self.setTimeout("StartTheTimer()", delay)
            }

		//map.ShowMiniMap();

        }
        
        function AddPin(){
          PID = document.getElementById("hvParcelHighlighted"); 
          Address = document.getElementById("hvAddress");
          var pin = new VEPushpin(pinID,new VELatLong(Lat.value, Long.value),"images/startPIN.gif",'Property Address:(' + PID.value + ')',Address.value);
          map.AddPushpin(pin);
          pinID++;         
          }   
        
        function mapControl(Activity) {
        if (mapControlState == 'Hide') {
        //Hide Control
            map.HideDashboard();
            mapControlState = 'Show';
            map.DeleteAllPushpins();
		   map.HideMiniMap();
            }else{
        //showControl
            map.ShowDashboard();
            mapControlState = 'Hide';
		          map.ShowMiniMap(2,203);
            AddPin();
            }
        }
        
        function mapZoom() {
        map.ZoomIn();
        }
