function initMap()
{
	var installExperienceHTML = '<div style="position:auto; text-align:left; background-repeat:no-repeat; height:477px; background-image:url(assets/faded_preinstall.png);">'; 
	installExperienceHTML += '<div style="padding-left:212px; padding-top:170px;">';
	installExperienceHTML += '<div id="InstallPromptDiv"> </div> </div> <div id="PostInstallGuidance"'; 
	installExperienceHTML += 'style="background: #fff; border: solid 2px #ccc; font-family:sans-serif; margin: 0 50px; padding: 20px; text-align:center; color:#3366ff; ';
	installExperienceHTML += 'font-weight:normal; font-size:11pt">&nbsp;</div> </div>';
	
	Silverlight.InstallAndCreateSilverlight('1.0', document.getElementById('airportMap'), installExperienceHTML, 'InstallPromptDiv', createSilverlight);
	
	var PostInstallGuidance = document.getElementById('PostInstallGuidance');
	if ( document.getElementById('PostInstallGuidance') )   
	{
		PostInstallGuidance.innerHTML= "Welcome, Please download Microsoft Silverlight to view our destinations map.";
	} else{
          var mapTxt=document.getElementById('mapTxt')
          if(mapTxt) mapTxt.style.display='block';
        }
	
	/**
	 * create Silverlight
	 */
	function createSilverlight()
	{
		var scene = new RM.Page();
		Silverlight.createObjectEx({
			source: $('#jsLoc').val() + "airports.xaml",
			parentElement: document.getElementById("airportMap"),
			id: "SilverlightControl",
			properties: {
				width: "100%",
				height: "100%",
				version: "1.0",
				isWindowless: "false",
				background: "#ffffff"
			},
			events: {
				onLoad: Silverlight.createDelegate(scene, scene.handleLoad),
				onError: function(sender, args) {
					var errorDiv = document.getElementById("errorLocation");
					if (errorDiv != null) {
						var errorText = args.errorType + "- " + args.errorMessage;
								
						if (args.ErrorType == "ParserError") {
							errorText += "<br>File: " + args.xamlFile;
							errorText += ", line " + args.lineNumber;
							errorText += " character " + args.charPosition;
						}
						else if (args.ErrorType == "RuntimeError") {
							errorText += "<br>line " + args.lineNumber;
							errorText += " character " +  args.charPosition;
						}
						errorDiv.innerHTML = errorText;
					}	
				}
			},
			inplaceInstallPrompt:true
		});
	}	
}

if (!window.Silverlight) 
		window.Silverlight = {};
	
Silverlight.createDelegate = function(instance, method) 
{
	return function() 
	{
		return method.apply(instance, arguments);
	}
}

