var map = null;

function ShowMap(lat, lng) {
    $("#ctl00_cphMain_hypMap").css("display", "none");
    $("#ctl00_cphMain_imgProperty").css("display", "none");
    if ($("#ctl00_cphMain_Thumbnails").length)
        $("#ctl00_cphMain_Thumbnails").css("display", "none");
    $("#mapHolder").css("display", "inline");
    $("#ctl00_cphMain_hypPhoto").css("display", "inline");

    if (map == null) {
        var mapOptions = {
            credentials: "AnAV_DdLV3J0jGe9ivcR6q1GKRR-BCIxlqQWhTDl4JaLR-NTX1MfMQprJgv1MUZc",
            zoom: 16,
            center: new Microsoft.Maps.Location(lat, lng),
            mapTypeId: Microsoft.Maps.MapTypeId.road,
            enableClickableLogo: false,
            enableSearchLogo: false,
            showCopyright: false,
            showLogo: false
        }

        map = new Microsoft.Maps.Map(document.getElementById("map"), mapOptions);

        var pin = new Microsoft.Maps.Pushpin(
            new Microsoft.Maps.Location(lat, lng),
            { icon: 'Images/house.gif', typeName: "pp", anchor: (0, 0), height: 22, width: 23 });
        map.entities.push(pin);
    }
}

function ShowPhotos() {
    $("#mapHolder").css("display", "none");
    $("#ctl00_cphMain_hypBirdseye").css("display", "none");
    $("#ctl00_cphMain_hypPhoto").css("display", "none");
    $("#ctl00_cphMain_imgProperty").css("display", "inline");
    $("#ctl00_cphMain_hypMap").css("display", "inline");
    if ($("#ctl00_cphMain_Thumbnails").length)
        $("#ctl00_cphMain_Thumbnails").css("display", "inline");
}
