/*
* Copyright (c) 2005-2006 Andriy Bidochko.  
* http://www.mapbuilder.net
*
* The script has been generated by MapBuilder.net service and released to the customer under 
* The GNU General Public License (GPL), which can be found at: http://www.opensource.org/licenses/gpl-license.php
* 
* This program is free software; you can redistribute it and/or modify it under the terms of the 
* GNU General Public License as published by the Free Software Foundation; 
* either version 2 of the License, or any later version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
* for more details.
*/


//That function will return the element of the array returned by map.getMapTypes() that identifies the current map
function getCurrentMapTypeNumber(oMap){
  var type=-1;
  for(var ix=0;ix<oMap.getMapTypes().length;ix++){
    if(oMap.getMapTypes()[ix]==oMap.getCurrentMapType())
      type=ix;
  }
  return type;

} 

// Creates a marker whose info window displays the given number
function createMarker(point, html, icon, oOptions) {
  if (usePDMarker)
  {
  	var marker = new PdMarker(point, icon, oOptions.label);
  	/* Doesn't work in APIs > 2.64
  	 * marker.setTooltip(oOptions.label);
  	 * marker.setOpacity((oOptions.opasity ? oOptions.opasity : 100));
  	 */
  }
  else
  {
  	var marker = new GMarker(point, icon);
  }

  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
  });

  return marker;
}

// Zoom map to. Used from InfoWindow
function ZoomMapTo(num) {
  // Get current zoom level
  var currentZoom = map.getZoom();
  // Re-center map
  newzoom = (currentZoom > 17) ? 17 : ((currentZoom == 0) ? 0 : (currentZoom + 1));
  //V2-V1 compatability 
  map.setCenter(aLocations[num][3], newzoom);
}

// Function is called when sidebar item is clicked or we are dealing with group boxes.
function myInfoWindowHtml(num)
{
  // Map rendering with open info window is very slow. Lets center map first.
  map.setCenter(aLocations[num][3]);
  // Use markeropenInfoWindowHtml(html)
  aLocations[num][0].openInfoWindowHtml(aLocations[num][2]);
}

/* Side Bar */

// Creates a locations list and put it into side bar
function createSideBar() {
  var oUL = document.createElement("ul");
  // write links into document.
  for (var i=0; i<aLocations.length; i++) {
    var linkElem = document.createElement("a");
    var listElem = document.createElement("li");
    linkElem.innerHTML = aLocations[i][1];

    // must use this approach instead.
    linkElem.href = "javascript:myInfoWindowHtml(" + i + ");";
    listElem.appendChild(linkElem);
    oUL.appendChild(listElem);
  }
  try 
  {
	  document.getElementById("LocationList").appendChild(oUL);
  }
  catch(e)
  {
  	// do nothing
  }

}


// Function is called to show/hide location list 
var LocationListVisible = true;
function ProcessLocationList()
{
  if (LocationListVisible)
  {
    // Hide sidebar
    document.getElementById("LocationList").style.display="none";
    document.getElementById("SideBarActionLink").innerHTML = "+";
  }
  else
  {
    // Show sidebar
    document.getElementById("LocationList").style.display="block";
    document.getElementById("SideBarActionLink").innerHTML = "-";
  }
  LocationListVisible = !LocationListVisible;
}

/* EOF Side Bar */

/* Directions */
var MBDirectionFormBox = false; 

function  MBDirectionFormState(mode, force) {

  var MBCurrID = document.getElementById("MBLocID").value;
  document.getElementById("addr1").value = aLocations[MBCurrID][0].getPoint().lat() + ", " + aLocations[MBCurrID][0].getPoint().lng() + " ("+ aLocations[MBCurrID][1] +")";
  if (mode=='to') {
    document.getElementById("MBDirectionAddr").innerHTML = 'Start address';
    document.getElementById("addr1").name = 'daddr';
    document.getElementById("addr2").name = 'saddr';
  }
  else {
    document.getElementById("MBDirectionAddr").innerHTML = 'End address';
    document.getElementById("addr1").name = 'saddr';
    document.getElementById("addr2").name = 'daddr';
  }

  if (force) {
    document.getElementById('MBDirectionForm').style.display = (MBDirectionFormBox ? 'none' : 'block');
  }
  else {
    document.getElementById('MBDirectionForm').style.display = 'block';
  }
  MBDirectionFormBox = (!MBDirectionFormBox);
}

// Print Directions Form
function GetDirectionForm(LocID) {
  return "<div class=\"IWDirections\">[<a onclick=\"MBDirectionFormState('to', true);\" href=\"javascript:void(0)\">+</a>] Directions:&nbsp;<a onclick=\"MBDirectionFormState('to', false);\" href=\"javascript:void(0)\">To here</a>&nbsp;-&nbsp;<a onclick=\"MBDirectionFormState('from', false);\" href=\"javascript:void(0)\">From here</a><div id=\"MBDirectionForm\" style=\"display:none\"><form action=\"http://maps.google.com/maps\" target=\"_blank\" method=\"get\"><input id=\"addr1\" name=\"daddr\" value=\"0,0(NAME)\" type=\"hidden\"><input id=\"MBLocID\" name=\"MBLocID\" value=\""+LocID+"\" type=\"hidden\"><div id=\"MBDirectionAddr\" style=\"padding-top: 0.2em; width: 290px;\">Start address</div><div style=\"width: 290px;\"><input value=\"\" id=\"addr2\" style=\"width: 16em;\" name=\"saddr\" onload=\"this.select()\" type=\"text\"></div><div style=\"width: 290px;\"><input value=\"Get Directions\" type=\"submit\"></div></form></div></div>"
}
GetGoogleMapsAPIVersion = function() {
    var v = 0;
    var scripts = document.getElementsByTagName("SCRIPT")
    for (var i=0; i<scripts.length; i++) {
        var pattern = /\/maps([0-9])?(\.?[0-9]+)(\.api)?\.js/;
        var m = pattern.exec(scripts[i].src);
        if (m != null) {
            if (m[1] == null) { v = parseFloat('1'+m[2]); }
            else { v = parseFloat(m[1]+m[2]); }
            break;
        }
    }
    return v;
}

function MapBuilder(oMap){ 
    /* Insert MapBuilder Logo */
    var info=document.createElement('div');
    info.id='MapBuilderInfo';
    info.style.position='absolute';
    info.style.right='1px';
    info.style.bottom='25px';
    info.style.backgroundColor='transparent';
    info.style.zIndex=25500;
    		info.innerHTML='<a id="CreatedByMapBuilder" href="http://www.mapbuilder.net" title="Powered by MapBuilder.net v2.02"><img src="http://mapbuilder.net/img/mo24.gif" alt="Powered By MapBuilder.net v2.02" style="border:0; margin: 2px;"/></a>';
        oMap.getContainer().appendChild(info);
}


    // Global Variables
    // set map variable
    var map = null;
    //set up array of locations
    var aLocations = new Array;

    /*************************** Configuration Options ***************************/
    /*PDMarker is used to display tooltips when the user hovers over the markers.
    * PDMarker is a LGPL library provided by Peter Jones. 
    * For details see http://wwww.pixeldevelopment.com/pdmarker.asp
    */
    var usePDMarker = false;

    // Create a base "tiny" red  icon that specifies the shadow, icon dimensions, etc.
    var iconsm = new GIcon();
    iconsm.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
    iconsm.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
    iconsm.iconSize = new GSize(12, 20);
    iconsm.shadowSize = new GSize(20, 18);
    iconsm.iconAnchor = new GPoint(6, 20);
    iconsm.infoWindowAnchor = new GPoint(5, 1);

    // Create a base "large" red icon that specifies the shadow, icon dimensions, etc.
    var iconbig = new GIcon();
    iconbig.image = "http://www.google.com/mapfiles/marker.png";
    iconbig.shadow = "http://www.google.com/mapfiles/shadow50.png";
    iconbig.iconSize = new GSize(20, 34);
    iconbig.shadowSize = new GSize(37, 34);
    iconbig.iconAnchor = new GPoint(6, 34);
    iconbig.infoWindowAnchor = new GPoint(5, 1);

    // Custom Icon
    var iconcustom = new GIcon(iconbig);
    iconcustom.shadow = '';


MapBuilder.prototype.renderMap=function(){
  //Render Map Locations 
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      // Center the map to the default location and set map type
      map.setCenter(new GLatLng(51.590722643120145, -121.35498046875), 6, map.getMapTypes()[0]);
      	  
      // Initialize variables
      var point = null;
      var footerHtml = null;
      var InfoHTML = null;
      var marker = null;
      /* Options used for PDMarker initialization:
      * label: tooltip text
      * opasity: tooltip opasity
      */
      var options = {};

      // Add locations
	
      point = new GLatLng(50.44794032958957, -119.18844223022461);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(0)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">ARMSTRONG COLLISION</div><div class=\"IWContent\">3750 Pleasant Valley Road<BR>Box 539<BR>Armstrong, B.C.<BR>V0E 1B0<BR>Phone: 250-546-3300<BR>Fax: 250-546-3376<BR><A href=\"http://www.qualityassured.ca/armstrong.html\" target=_self>more information</A></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[0] = new Array(marker, "ARMSTRONG COLLISION", InfoHTML, point);
	
      point = new GLatLng(49.280436, -122.975107);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(1)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">BC COLLISIONS</div><div class=\"IWContent\">6101 E. Hastings Street<br>Burnaby, BC V5B 1R9<br>Phone : 604-299-3211<br>Fax : 604-291-7411<br>Contact : Gord<br><a href=\"http://qualityassured.bc.ca/BCCollisions.html\">click here for more information</a><br><br></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[1] = new Array(marker, "BC COLLISIONS", InfoHTML, point);
	
      point = new GLatLng(49.25298857814229, -123.06764602661133);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(2)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">IVAN'S AUTOBODY</div><div class=\"IWContent\">3550 Commercial Street<br>Vancouver, BC V5N 4E9<br>Phone: 604-879-8915<br>Fax: 604-879-2256<br>Contact: Ivan<br><a href=\"http://qualityassured.bc.ca/IvansAutobody.html\">click here for more information</a><br></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[2] = new Array(marker, "IVAN'S AUTOBODY", InfoHTML, point);
	
      point = new GLatLng(49.030777776230806, -123.86539936065674);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(3)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">LITTLE VALLEY RESTORATIONS</div><div class=\"IWContent\">13070 Thomas Road<br>Ladysmith, BC V9G 1L9<br>Phone: 250-245-3022<br>Fax: 250-245-3042<br>Contact: John<br><a href=\"http://qualityassured.bc.ca/LittleValley.html\">click here for more information</a><br></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[3] = new Array(marker, "LITTLE VALLEY RESTORATIONS", InfoHTML, point);
	
      point = new GLatLng(49.220007780433995, -122.64866888523102);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(4)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">MEADOWRIDGE COLLISION</div><div class=\"IWContent\">11973 207th Street<br>Maple Ridge, BC V2X 1X6<br>Phone: 604-465-8636<br>Fax: 604-465-1160<br>Contact: Tony<br><a href=\"http://qualityassured.bc.ca/meadowCollision.html\">click here for more information</a><br><br></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[4] = new Array(marker, "MEADOWRIDGE COLLISION", InfoHTML, point);
	
      point = new GLatLng(53.913346, -122.743687);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(5)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">NORGATE AUTOBODY</div><div class=\"IWContent\">615 First Avenue<br>Prince George, BC V2L 3M5<br>Phone: 250-563-0321<br>Fax: 250-563-2811<br>Contact: Kent<br><a href=\"http://qualityassured.bc.ca/norgate.html\">click here for more information</a><br></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[5] = new Array(marker, "NORGATE AUTOBODY", InfoHTML, point);
	
      point = new GLatLng(49.04996391647356, -122.30302333831787);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(6)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">PARAMOUNT AUTOBODY</div><div class=\"IWContent\">33258 South Fraser Way<BR>Abbotsford, BC V2S 2B3<BR>Phone: 604-855-3302<BR>Fax: 604-855-3375<BR>Contact: Mark McLeod<BR><A href=\"http://qualityassured.bc.ca/paramount-autobody.html\">click here for more information<BR></A></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[6] = new Array(marker, "PARAMOUNT AUTOBODY", InfoHTML, point);
	
      point = new GLatLng(49.130183380879295, -122.3008131980896);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(7)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">RAYDAR AUTOBODY</div><div class=\"IWContent\">7077 Mershon Street<br>Mission, BC V2V 2Y6<br>Phone: 604-826-3778<br>Fax: 604-826-6601<br>Contact: Lonnie<br><a href=\"http://qualityassured.bc.ca/RaydarAutobody.html\">click here for more information</a><br></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[7] = new Array(marker, "RAYDAR AUTOBODY", InfoHTML, point);
	
      point = new GLatLng(50.058874561717424, -125.27525424957275);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(8)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">RICH'S AUTO COLLISION</div><div class=\"IWContent\">3989 N. Island Hwy<br>Campbell River, B.C<br>Phone: 250-287-8258<br>Fax: 250-287-2432<br>Contact: Rich<br><a href=\"http://qualityassured.bc.ca/richsauto.html\">click here for more information</a><br><br></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[8] = new Array(marker, "RICH'S AUTO COLLISION", InfoHTML, point);
	
      point = new GLatLng(49.107656, -122.657727);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(9)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">SUNSHINE AUTOBODY</div><div class=\"IWContent\">20370 Logan Avenue<br>Langley, BC V3A 4L9<br>Phone: 604-530-4810<br>Fax: 604-530-6912<br>Contact: Mike<br><a href=\"http://qualityassured.bc.ca/SunshineAutobody.html\">click here for more information</a><br></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[9] = new Array(marker, "SUNSHINE AUTOBODY", InfoHTML, point);
	
      point = new GLatLng(49.318214, -124.298649);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(10)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">TERMINAL AUTO BODY</div><div class=\"IWContent\"><p style=\"margin-top: 0pt; margin-bottom: 0pt;\">P.O. Box 1929 </p>440 E. Island Highway<p style=\"margin-top: 0pt; margin-bottom: 0pt;\">Parksville, BC V9P 2H7</p><p style=\"margin-top: 0pt; margin-bottom: 0pt;\">Phone: 250-248-2082</p><p style=\"margin-top: 0pt; margin-bottom: 0pt;\">Fax: 250-248-5144</p><p style=\"margin-top: 0pt; margin-bottom: 0pt;\">Contact: Al<br></p><p style=\"margin-top: 0pt; margin-bottom: 0pt;\"><a href=\"http://qualityassured.bc.ca/TerminalAuto.html\">click here for more information<br></a></p></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[10] = new Array(marker, "TERMINAL AUTO BODY", InfoHTML, point);
	
      point = new GLatLng(49.26464, -123.004414);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(11)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">VAN-BURN COLLISION</div><div class=\"IWContent\">4459 Dawson Street<br>Burnaby, BC V5C 4B8<br>Phone: 604-298-3515<br>Fax: 604-298-9037<br>Contact: Dale<br><a href=\"http://qualityassured.bc.ca/VanBurnCollision.html\">click here for more information</a><br><br><br></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[11] = new Array(marker, "VAN-BURN COLLISION", InfoHTML, point);
	
      point = new GLatLng(49.305524, -123.03382);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(12)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">VICKERY COLLISION</div><div class=\"IWContent\">1419 Main Street<br>North Vancouver, BC V7J 1C9<br>Phone: 604-988-3234<br>Fax: 604-988-5599<br>Contact: Mike<br><a href=\"http://qualityassured.bc.ca/VickeryCollision.html\">click here for more information</a><br><br></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[12] = new Array(marker, "VICKERY COLLISION", InfoHTML, point);
	  
	   point = new GLatLng(49.513941, -115.772513);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(13)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">SIGNAL'S QUALITY ASSURED COLLISION - CRANBROOK</div><div class=\"IWContent\">16 COBHAM AVE <BR>W CRANBROOK, BC<BR> V1C 4G4<BR>Phone: 250-426-1128<BR>Fax: 250-426-0907<BR><A href=\"http://www.qualityassured.ca/signal-cranbrook.html\" target=_self>more information</A></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[13] = new Array(marker, "SIGNAL'S QUALITY ASSURED COLLISION- CRANBROOK", InfoHTML, point);
	  
	  point = new GLatLng(49.669579, -115.975961);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(14)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">SIGNAL'S QUALITY ASSURED COLLISION - KIMBERLEY</div><div class=\"IWContent\">90-302 AVE MARYSVILLE, BC <BR>V1A 3G5<BR>Phone: 250-427-7462<BR>Fax: 250-427-7264<BR><A href=\"http://www.qualityassured.ca/signal-kimberley.html\" target=_self>more information</A></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[14] = new Array(marker, "SIGNAL'S QUALITY ASSURED COLLISION - KIMBERLEY", InfoHTML, point);
	  
	  point = new GLatLng(49.876816, -119.458071);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(15)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">SPRINGFIELD AUTOBODY LTD.</div><div class=\"IWContent\">100 – 1765 Springfield Road <BR>Kelowna, B.C. V1Y 5V5<BR>Phone: 250-860-9333<BR>Fax: 250-860-9331<BR><A href=\"http://www.qualityassured.ca/springfield-autobody.html\" target=_self>more information</A></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[15] = new Array(marker, "SPRINGFIELD AUTOBODY LTD.", InfoHTML, point);
	  
	  point = new GLatLng(49.15483266297372, -121.95604205131531);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(16)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">WEST END AUTOBODY LTD.</div><div class=\"IWContent\">45825 Airport Rd. <BR>Chilliwack, B.C. V2P 1A3<BR>W: 604-795-3513<BR>F: 604-792-0922<BR>Toll free: 1 800 567-2010<BR><A href=\"http://www.qualityassured.ca/westend-autobody.html\" target=_self>more information</A></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[16] = new Array(marker, "WEST END AUTOBODY LTD.", InfoHTML, point);
	  
	  point = new GLatLng(50.279029, -119.270153);
      footerHtml = "<div class=\"IWFooter\"><div class=\"IWFooterZoom\"><a href=\"javascript:void(0)\" onclick=\"ZoomMapTo(17)\">Zoom To</a></div>"   + "</div>";

      // Define Marker
      InfoHTML = "<div class=\"IW\"><div class=\"IWCaption\">SUNSHINE AUTOBODY VERNON LTD</div><div class=\"IWContent\">4504 29th Street,<BR>Vernon, B.C., V1T 5B9<BR>Phone: 250-542-4811<BR>Fax: 250-542-4817<BR><A href=\"http://www.qualityassured.ca/SunshineAutobodyVernon.html\" target=_self>more information</A></div>" + footerHtml + "</div>";
      iconbig.image = "http://www.mapbuilder.net/img/icons/marker_34_red.png";
      marker = createMarker(point, InfoHTML, iconbig, options);
      map.addOverlay(marker);
      aLocations[0] = new Array(marker, "SUNSHINE AUTOBODY VERNON LTD", InfoHTML, point);
	  
      // And finnaly create sidebar
      createSideBar();

}

