﻿function pageSpecificInit() {
  map.enableDoubleClickZoom();
/*
  GEvent.addListener(map, "moveend", function() {
    alert('moveen');
  });
  */
}

function addPageSpecificPointEvent(point)
{
  GEvent.addListener(point.marker, "click", function() {
    showInfoWindow(point.id);
  });
}

function composeInfoWindow(point) {
  var infoWinContent = '' +
    '<div class="pointTitle">' +
      decodeTextRender(point.title) +
    '</div>' +
    '<div style="margin-top:5px; margin-bottom:5px;">' +
      decodeTextRender(point.address) +
    '</div>' +
    '<div style="margin-top:5px; margin-bottom:5px;">' +
      decodeTextRender(point.desc) +
    '</div>' +
    '<a target="_blank" href="' + decodeTextRender(point.url) + '">' + decodeTextRender(point.urlTitle) + '</a>';
  return infoWinContent;
}


function hookGetMap()
{
  oldHandler = window.onload;
  var parentHook = function() { };
  try {
    var thisFrame = window.frameElement;
    if(thisFrame)
    {
      if(thisFrame.parentHook)
      {
        parentHook = thisFrame.parentHook;
      }
    }
  }
  catch(e) {
  }
  
  window.onload = function()
  {
    load();
    parentHook();
  }
  /*
  if(oldHandler)
  {
    GLog.write('hookGetMap next');
    window.onload = function()
    {
      load();
      oldHandler();
    }
  }
  else
  {
    GLog.write('hookGetMap first');  
    window.onload = function()
    {
      load();
    }
  }
  */
//  window.alert(xmap);
}
