﻿var _mapLinkBase = "http://maps.google.co.uk/maps/ms?ie=UTF8&hl=en&msa=0&msid=115776175509179224899.000474e144510e66e6792&z=16";
var _shops = [];
//Bravissimo Aberdeen
_shops[14] = { 
    id: 14,
    x: 57.14649614,
    y: -2.098817825,
    address: "Bravissimo Aberdeen<br/>123.5 Union Street<br/>Aberdeen<br/>AB11 6BH",
    iwloc: "000474e144f77849e92bd",
    ll: "57.146185,-2.099569",
    spn: "0.002456,0.006968" 
};
	
       
//Bravissimo Brighton
_shops[11] = { 
    id: 11,
    x: 50.82198719178952,
    y: -0.13903498649597168,
    address: "Bravissimo Brighton<br/>3 North Street<br/>Brighton<br/>BN1 1EB",
    iwloc: "000474e18a112f44aaed8",
    ll: "50.822394,-0.139829",
    spn: "0.00286,0.006968" 
};
	
//Bravissimo Cambridge
_shops[6] = { 
    id: 6,
    x: 52.207080697451,
    y: 0.12109637260437012,
    address: "Bravissimo Cambridge<br/>17-19 Sussex Street<br/>Cambridge<br/>CB1 1PA",
    iwloc: "000474e150885e2148feb",
    ll: "52.206906,0.121236",
    spn: "0.002775,0.006968" 
};
	
//Bravissimo Cardiff
_shops[16] = { 
    id: 16,
    x: 51.481301,
    y: -3.177333,
    address: "Bravissimo Cardiff<br/>6 Queens Arcade<br/>Queen Street<br/>Cardiff<br/>CF10 2BY",
    iwloc: "000474e15088cc89c3f07",
    ll: "51.48136,-3.177313",
    spn: "0.00282,0.006968" 
};
	
//Bravissimo Chester
_shops[12] = { 
    id: 12,
    x: 53.19008044645538,
    y: -2.8924405574798584,
    address: "Bravissimo Chester<br/>17–19 Watergate Row South<br/>Watergate Street<br/>Chester<br/>CH1 2LE",
    iwloc: "000474e169aca8010af81",
    ll: "53.189878,-2.893234",
    spn: "0.002713,0.006968" 
};
	
//Bravissimo Edinburgh
_shops[19] = { 
    id: 19,
    x: 55.955309,
    y: -3.191326,
    address: "Bravissimo Edinburgh<br/>20 Multrees Walk<br/>Edinburgh<br/>EH1 3DQ",
    iwloc: "000474e169b1df1ffd9fd",
    ll: "55.955315,-3.191303",
    spn: "0.002535,0.006968"
};
	
//Bravissimo Glasgow
_shops[9] = { 
    id: 9,
    x: 55.86012837521831,
    y: -4.251333475112915,
    address: "Bravissimo Glasgow<br/>229 Ingram Street<br/>Glasgow<br/>G1 1DA",
    iwloc: "000474e16d47ce67ba7d0",
    ll: "55.859842,-4.250947",
    spn: "0.002541,0.006968"
};

//Bravissimo Leamington Spa
_shops[15] = { 
    id: 15,
    x: 52.290226,
    y: -1.536273,
    address: "Bravissimo Leamington Spa<br/>64b Regent Street<br/>Leamington Spa<br/>CV32 5EG",
    iwloc: "000474e170dd985930d09",
    ll: "52.29017,-1.537217",
    spn: "0.002769,0.006968"
};
	
//Bravissimo Leeds
_shops[4] = { 
    id: 4,
    x: 53.79779300667231,
    y: -1.5411221981048584,
    address: "Bravissimo Leeds<br/>6-8 Cross Arcade<br/>The Victoria Quarter<br/>Leeds, LS1 6AZ",
    iwloc: "000474e170de2e16ce13f",
    ll: "53.797958,-1.541122",
    spn: "0.002674,0.006968"
};
	
//Bravissimo Liverpool
_shops[18] = { 
    id: 18,
    x: 53.40366050200629,
    y: -2.979311943054199,
    address: "Bravissimo Liverpool<br/>8 Bold Street<br/>Liverpool<br/>L1 4DS",
    iwloc: "000474e1747399866ddaa",
    ll: "53.404047,-2.980615",
    spn: "0.002699,0.006968"
};
	
//Bravissimo London, Covent Garden
_shops[7] = { 
    id: 7,
    x: 51.5114534740914,
    y: -0.121321678161621,
    address: "Bravissimo London - Covent Garden<br/>20 Tavistock Street<br/>Covent Garden<br/>London, WC2E 7NZ",
    iwloc: "000474e174742f15631c3",
    ll: "51.513043,-0.119728",
    spn: "0.002818,0.006968"
};
	
//Bravissimo London, Ealing
_shops[1] = { 
    id: 1,
    x: 51.511914197104836,
    y: -0.3052997589111328,
    address: "Bravissimo London - Ealing<br/>28 High Street<br/>Ealing<br/>London, W5 5DB",
    iwloc: "000474e1780a24fcd2a10",
    ll: "51.511874,-0.304635",
    spn: "0.002818,0.006968"
};
	
//Bravissimo London, Oxford Circus
_shops[13] = { 
    id: 13,
    x: 51.5167548456364,
    y: -0.142006874084472,
    address: "Bravissimo London - Oxford Circus<br/>28 Margaret Street<br/>London<br/>W1W 8RZ",
    iwloc: "000474e17809a93098863",
    ll: "51.516858,-0.142018",
    spn: "0.002817,0.006968"
};
	
//Bravissimo Manchester
_shops[2] = { 
    id: 2,
    x: 53.48452805114983,
    y: -2.243582010269165,
    address: "Bravissimo Manchester<br/>The Triangle Centre<br/>Exchange Square<br/>Manchester<br/>M4 3TR",
    iwloc: "000474e17b9f8eaea2089",
    ll: "53.485147,-2.243244",
    spn: "0.002694,0.006968"
};
	
//Bravissimo Milton Keynes
_shops[20] = { 
    id: 20,
    x: 52.043167,
    y: -0.756365,
    address: "Bravissimo Milton Keynes<br/>90A Silbury Arcade<br/>thecentre:mk<br/>Milton Keynes<br/>MK9 3BE",
    iwloc: "000474e17ba00141b7599",
    ll: "52.043273,-0.756372",
    spn: "0.002785,0.006968"
};	

//Bravissimo Newcastle
_shops[8] = { 
    id: 8,
    x: 54.97180697270276,
    y: -1.6114819049835205,
    address: "Bravissimo Newcastle<br/>62-64 Grey Street<br/>Newcastle<br/>NE1 6AF",
    iwloc: "000474e17f36aaa4b5416",
    ll: "54.97213,-1.611514",
    spn: "0.002599,0.006968"
};

//Bravissimo Norwich
_shops[17] = { 
    id: 17,
    x: 52.629415,
    y: 1.295135,
    address: "Bravissimo Norwich<br/>31 London Road<br/>Norwich<br/>NR2 1HU",
    iwloc: "000474e17f37280d1a55d",
    ll: "52.629501,1.295062",
    spn: "0.002748,0.006968"
};	
	
//Bravissimo Nottingham
_shops[10] = { 
    id: 10,
    x: 52.953802674613215,
    y: -1.146773099899292,
    address: "Bravissimo Nottingham<br/>11 Pelham Street<br/>Nottingham<br/>NG1 2EH",
    iwloc: "000474e182cda1dfd43b7",
    ll: "52.953851,-1.146934",
    spn: "0.002728,0.006968"
};
	
//Bravissimo Oxford
_shops[5] = { 
    id: 5,
    x: 51.75419358327193,
    y: -1.2578809261322021,
    address: "Bravissimo Oxford<br/>8 Broad Street<br/>Oxford<br/>OX1 3AJ",
    iwloc: "000474e182ce1a89bf930",
    ll: "51.754028,-1.257827",
    spn: "0.002803,0.006968"
};	
	
//Bravissimo Solihull
_shops[3] = { 
    id: 3,
    x: 52.41247205962487,
    y: -1.7796027660369873,
    address: "Bravissimo Solihull<br/>Touchwood Shopping Centre<br/>Solihull<br/>B91 3GS",
    iwloc: "000474e1867b1b4aef1ee",
    ll: "52.412505,-1.779034",
    spn: "0.002762,0.006968"
};

function loadGMap() {
    var shop = _shops[_shopId];
    if (!GBrowserIsCompatible()) {
        return;
    }
    $("#map").show();
    var map = new GMap2($.$("map"));
    map.setCenter(new GLatLng(shop.x, shop.y), 15);
    var point = new GLatLng(shop.x, shop.y);
    var gi = new GIcon();
    gi.image = ROOT_URL + "images/shops/shop_icon_purple.png";
    gi.iconSize = new GSize(90, 59);
    gi.iconAnchor = new GPoint(72, 57);
    gi.infoWindowAnchor = new GPoint(84, 59);            
    markerOptions = { icon:gi };
    var marker = new GMarker(point, markerOptions);
    GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(shop.address);
    });        
    map.addOverlay(marker);
    map.enableDragging();        
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());


    $a = $('<a target="_blank" class="get-directions">Get directions &gt;</a>');
    $a.attr("href", _mapLinkBase + "&ll=" + shop.ll + "&iwloc=" + shop.iwloc + "&spn=" + shop.spn);

    $(".shopmap .inside").append($a);
}

page.onload(loadGMap);