// main map object
var map = null;

var henlexLongitude = 1020.6035766601562;
var henlexLatitude = 3141.305419921875;
var smallhenlex = "http://henlex.orzechowo.info/img/smallhenlex.jpg";
/*
	Function for calling map
*/

function goMap24PL(width, height, area){
	goMap24(width, height, area, 'FJX92b61067bb77e9297c726672a3af5X13');
}
function goMap24EN(width, height, area){
	goMap24(width, height, area, 'FJXdf0774dd276808321969bd4b75532X13');
}
function goMap24(width, height, area, ak){
		// getting the map, 
        map = Map24.Webservices.getMap24Application({
          AppKey: ak,
          MapArea: document.getElementById(area),
          MapWidth: width,
          MapHeight: height
        });
        // center view on coordinates
        var mrcContainer = new Map24.Webservices.Request.MapletRemoteControl();
        mrcContainer.push(
          new Map24.Webservices.MRC.SetMapView({
            Coordinates: new Map24.Coordinate( henlexLongitude, henlexLatitude ),
            ClippingWidth: new Map24.Webservices.ClippingWidth(
              { MinimumWidth: 2400 }              
            )
          })
        );
        mrcContainer.push(
          new Map24.Webservices.MRC.DeclareMap24Location({
            MapObjectID: "myLocation",
            Coordinate: new Map24.Coordinate( henlexLongitude, henlexLatitude ),
            LogoURL: smallhenlex,
            SymbolID: 20100
          })
        );
        mrcContainer.push(
          new Map24.Webservices.MRC.ControlMapObject({
            Control: "ENABLE",
            MapObjectIDs: "myLocation"
          })
        );
        mrcContainer.push(
          new Map24.Webservices.MRC.SetMapView({
            Coordinates: new Map24.Coordinate( henlexLongitude, henlexLatitude ),
            ClippingWidth: new Map24.Webservices.ClippingWidth(
              { MinimumWidth: 2400 }            
            )
          })
        );
        map.Webservices.sendRequest( mrcContainer );
/*        // add henlex picture
		var mrcContainer = new Map24.Webservices.Request.MapletRemoteControl( map );
        mrcContainer.push(
          new Map24.Webservices.MRC.DeclareMap24Location({
            MapObjectID: "myLocation",
            Coordinate: new Map24.Coordinate( henlexLongitude, henlexLatitude ),
            LogoURL: smallhenlex,
            SymbolID: 20100
          })
        );
        mrcContainer.push(
          new Map24.Webservices.MRC.ControlMapObject({
            Control: "ENABLE",
            MapObjectIDs: "myLocation"
          })
        );
        mrcContainer.push(
          new Map24.Webservices.MRC.SetMapView({
            Coordinates: new Map24.Coordinate( henlexLongitude, henlexLatitude ),
            ClippingWidth: new Map24.Webservices.ClippingWidth(
              { MinimumWidth: 2400 }            
            )
          })
        );
        map.Webservices.sendRequest( mrcContainer );*/
}
/*
	This function is for route link
*/
function map24_removeDefaultValues(){
			if (document.link2map24.s.value == 'Address')
			 	document.link2map24.s.value 	= '';
}

