      var map = null;
      var description ="";
      function goMap24(){
        map = Map24.Webservices.getMap24Application({
          AppKey: "CJXf2e667534b1f266aa513aae4ab5b5X14",
          MapArea: document.getElementById( "maparea" ),
          MapWidth: 260,
          MapHeight: 260
	    });
		
		 controlOverview('HIDE');
		 controlToolbar('HIDE');
		 setMGI()
		
      }

function goMap24Large(){
        map = Map24.Webservices.getMap24Application({
          AppKey: "CJXf2e667534b1f266aa513aae4ab5b5X14",
          MapArea: document.getElementById( "maparea" ),
          MapWidth: 450,
          MapHeight: 371
	    });
		
     }
	  
      function setMGI(){
	   try
	   {
         map.setMaptype( "MGI" );
	   }
	   catch(e)
	   {
	     // suppresing ie error
	   }
      }
      
      function setJava(){
        map.setMaptype( "JAVA" );
      }
	  
      function controlOverview( cmd ){
        var mrcContainer = new Map24.Webservices.Request.MapletRemoteControl( map );
        mrcContainer.push( 
          new Map24.Webservices.MRC.ControlComponent({
            Component: "OV",
            Control: cmd
          }) 
        );
        mrcContainer.push( 
          new Map24.Webservices.MRC.ControlComponent({
            Component: "SHOWOV",
            Control: cmd
          }) 
        );
        map.Webservices.sendRequest( mrcContainer );
      }
	      
      function geocode( addressString,desc ){
	     map.Webservices.sendRequest(        
          new Map24.Webservices.Request.MapSearchFree(map, {
            SearchText: addressString,
            MaxNoOfAlternatives: 3
          })
		 )
	
		 description=desc;
      
        map.onMapSearchFree = function( event ){
          var mrcContainer2 = new Map24.Webservices.Request.MapletRemoteControl( map );
          var firstResult = event.Alternatives[0];
          var lon = firstResult.Coordinate.Longitude;
          var lat = firstResult.Coordinate.Latitude;
          try
		  {
		  
          addWithLabelLocation(lon,lat,description);
		  }
		  catch(e)
		  {
		     alert(e)
		  }
		 return false;
        }
      }
	 
	 function controlToolbar( cmd ){
        var mrcContainer = new Map24.Webservices.Request.MapletRemoteControl( map );
        mrcContainer.push( 
          new Map24.Webservices.MRC.ControlComponent({
            Component: "TBAR",
            Control: cmd
          }) 
        );
        mrcContainer.push( 
          new Map24.Webservices.MRC.ControlComponent({
            Component: "SHOWTBAR",
            Control: cmd
          }) 
        );
        map.Webservices.sendRequest( mrcContainer );
      }
	 
	 function controlLayer( cmd, layerId, mrcContainer){
         mrcContainer.push( new Map24.Webservices.MRC.ControlLayer( cmd, layerId, true ) );
     }
	  
	 function addWithLabelLocation(lon,lat,text){
        
        var mrcContainer = new Map24.Webservices.Request.MapletRemoteControl( map );
        mrcContainer.push(
          new Map24.Webservices.MRC.DeclareMap24Location({
            MapObjectID: "myLocation",
            Coordinate: new Map24.Coordinate( lon,lat ),
            SymbolID: 0
          })
        );
        mrcContainer.push(
          new Map24.Webservices.MRC.ControlMapObject({
            Control: "ENABLE",
            MapObjectIDs: "myLocation"
          })
        );
        mrcContainer.push(
          new Map24.Webservices.MRC.SetMapView({
            Coordinates: new Map24.Coordinate( lon,lat ),
            ClippingWidth: new Map24.Webservices.ClippingWidth(
              { MinimumWidth: 700 }            
            )
          })
        );
		
	   	
		hideLayers(mrcContainer);
		addMap24Label(lon,lat,text,mrcContainer);
		map.Webservices.sendRequest( mrcContainer );
	   
     } 
	  
	 function hideLayers(mrcContainer)
	 {
	    controlLayer('DISABLE','3012|3003|3001|3007|3010|3005|3004|3011|3002|3006|3008|3009|3013|3014',mrcContainer);	 
	 }
	 
	 
	 
	 
	  function addMap24Label(lon,lat,text,mrcContainer){
       
        mrcContainer.push(
          new Map24.Webservices.MRC.DeclareMap24Label({
            Anchor: "CENTER",
            Coordinate: new Map24.Coordinate(lon,lat ),
            Color: new Map24.Color( { R:0, G:0, B:0, A:255 } ),
            BgColor: new Map24.Color( { R:255, G:255, B:255, A:255 } ),
            BorderColor: new Map24.Color( { R:255, G:0, B:0, A:255 } ),
            MapObjectID: "myLabel",
            Text: text,
			 YOffset:15
          })
        );
        mrcContainer.push(
          new Map24.Webservices.MRC.ControlMapObject({
            Control: "ENABLE",
            MapObjectIDs: "myLabel"
          })
        );
        
      }
	 