function load() {
  if(typeof window.GMap2 == 'function') {
    // function exists, so we can now call it
    setupMap();
  }

}


function unload() {
  if(typeof window.GUnload == 'function') {
    // function exists, so we can now call it
    GUnload();
  }


}

function setupMap() {
      if (GBrowserIsCompatible()) {
         var icon = new GIcon();
         icon.image = "http://www.google.com/intl/en_de/mapfiles/ms/icons/ltblue-dot.png";
        addIcon(icon);

        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(43.668198,-79.407451), 15);
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
       point = new GLatLng(43.668198,-79.407451);
      gmarker = new GMarker(point, icon);
      map.addOverlay(gmarker);
      gmarker.openInfoWindowHtml("<div class='infowindow'><strong>Walmer Centre Theatre<br />188 Lowther Ave.<br /> Toronto<\/strong><\/div>");
      }
}

function addIcon(icon) { // Add icon attributes

 icon.shadow = "http://www.google.com/mapfiles/shadow50.png";
 icon.iconSize = new GSize(32, 32);
 icon.shadowSize = new GSize(37, 34);
 icon.iconAnchor = new GPoint(15, 34);
 icon.infoWindowAnchor = new GPoint(19, 2);
 icon.infoShadowAnchor = new GPoint(18, 25);
}

function showWindow() {
win = new Window({className: "alphacube", title: "Trailer", width:450, height:410, destroyOnClose: true, recenterAuto:false}); 
win.getContent().update("<div id=\"trailer\"><p><object width=\"425\" height=\"344\"><param name=\"movie\" value=\"http://www.youtube.com/v/cnKwbHbLBoo&hl=en&rel=0\"></param><embed src=\"http://www.youtube.com/v/cnKwbHbLBoo&hl=en&rel=0\" type=\"application/x-shockwave-flash\" width=\"425\" height=\"344\"></embed></object></p></div>"); 
win.setZIndex(30000);

win.showCenter();
}
