﻿//set page event handlers
if (window.attachEvent) {
    window.attachEvent("onload", Page_Load);
    window.attachEvent("onunload", Page_Unload);
} else {
    window.addEventListener("DOMContentLoaded", Page_Load, false);
    window.addEventListener("unload", Page_Unload, false);
}
var map;


var synth1 = "<iframe frameborder='0' src='http://photosynth.net/embed.aspx?cid=7324a24c-27ca-4a2c-8a50-a3b8a1a47d01&m=false&i=0:0:22&c=-3.87527:-0.265516:-0.3311&z=620.878513271213&d=1.94325545298598:-2.5007694072593:-2.50971241041026&p=0:0&delayLoad=true&slideShowPlaying=false' width='500' height='400'></iframe><p><a href='/building/overview/101/Kew+Bridge+Court' target='_blank' class='viewlink'>View Full Details</a></p>";
var synth2 = "<iframe frameborder='0' src='http://photosynth.net/embed.aspx?cid=44734402-50d0-44aa-836e-5c92f2ff12ab&m=false&i=0:2:2&c=-2.4926:0.204812:-0.0593922&z=509.687283930138&d=2.35291513159527:-2.44363215495802:-2.40357686197361&p=0:0&delayLoad=true&slideShowPlaying=false' width='500' height='400'></iframe><p><a href='/building/overview/113/Rosslyn%20Hill' target='_blank' class='viewlink'>View Full Details</a></p>";
var synth3 = "<iframe frameborder='0' src='http://photosynth.net/embed.aspx?cid=9b6f0c72-a531-4e52-8a89-e2ecef3864ea&m=false&i=0:0:37&c=-52.2826:-172.25:2.78902&z=622.165423307515&d=4.57413572457254:-0.250019555429527:-0.22090983378432&p=0:0&delayLoad=true&slideShowPlaying=false' width='500' height='400'></iframe><p><a href='/building/overview/109/Portobello+Lofts' target='_blank' class='viewlink'>View Full Details</a></p>"; 


var propertypin1 = null; 
var propertypin2 = null; 
var propertypin3 = null;

var propertypoint1 = new VELatLong(51.48897255, -0.28538704);
var propertypoint2 = new VELatLong(51.55341689, -0.16904891);
var propertypoint3 = new VELatLong(51.52632780, -0.21354675);
var points = new Array(propertypoint1,propertypoint2,propertypoint3);

function Page_Load() {
    map = new VEMap('psmap');
    map.LoadMap(new VELatLong(51.4,-0.24),15,VEMapStyle.Road,false,VEMapMode.Mode2D,false);
    map.SetMapView(points);
    map.onLoadMap = AddPropertyPins();
}

function AddPropertyPins() 
{ 
    map.ClearInfoBoxStyles(); 

    propertypin1 = new VEShape(VEShapeType.Pushpin, propertypoint1); 
    propertypin1.SetDescription(synth1);
    propertypin1.SetTitle("Kew Bridge Court - 1, 2 and 3 bedroom Apartments");
    propertypin1.SetCustomIcon("/images/photosynthmap/camera.png");
    map.AddShape(propertypin1); 

    propertypin2 = new VEShape(VEShapeType.Pushpin, propertypoint2); 
    propertypin2.SetDescription(synth2);
    propertypin2.SetTitle("Rosslyn Hill - 2 bedroom Apartments");
    propertypin2.SetCustomIcon("/images/photosynthmap/camera.png");
    map.AddShape(propertypin2); 

    propertypin3 = new VEShape(VEShapeType.Pushpin, propertypoint3); 
    propertypin3.SetDescription(synth3);
    propertypin3.SetTitle("Portabello Lofts - 2 and 3 bedroom Apartments");
    propertypin3.SetCustomIcon("/images/photosynthmap/camera.png");
    map.AddShape(propertypin3); 
}

//Clean up all objects
function Page_Unload() {
    if (map != null) {
        map = null;
    }
}
