﻿//alert('MapViewer.js?v=x included');

function IsPublicViewer() {
  var bResult = false;
  try {
    var sUrl = location.href.toLowerCase();

    bResult = (sUrl.indexOf('publicmapviewershell.aspx') >= 0) || (sUrl.indexOf('pm.aspx') >= 0);
    //bIsLocalhost = sUrl.indexOf('localhost') > 0;
  } catch (err) {
    alert(err);
  }

  return bResult;
  /*
  if (bIsPublicViewer){
  alert('yes - public viewer');
  }else{
  alert('no - not public viewer');
  } 
  */
}

function IsLocalhost() {
  var bResult = false;
  try {
    var sUrl = location.href.toLowerCase();

    bResult = sUrl.indexOf('localhost') > 0;
  } catch (err) {
    alert(err);
  }

  return bResult;
}

function ShowHideNavigatePointsButton(bHide) {
  if (
      (document.getElementById('MapViewer1_MapFooter1_imgNavigatePoints') != null)
        && (document.getElementById('MapViewer1_MapFooter1_lnkNavigatePoints1') != null)
        && (document.getElementById('MapViewer1_MapFooter1_lnkNavigatePoints2') != null)
      ) {
    if (bHide) {
      HideElement('MapViewer1_MapFooter1_imgNavigatePoints');
      HideElement('MapViewer1_MapFooter1_lnkNavigatePoints1');
      HideElement('MapViewer1_MapFooter1_lnkNavigatePoints2');
    } else {
      UnHideElement('MapViewer1_MapFooter1_imgNavigatePoints');
      UnHideElement('MapViewer1_MapFooter1_lnkNavigatePoints1');
      UnHideElement('MapViewer1_MapFooter1_lnkNavigatePoints2');
    }
  }
}


/* 
// A function to create the marker and set up the event window
// Dont try to unroll this function. It has to be here for the function closure
// Each instance of the function preserves the contends of a different instance
// of the "marker" and "html" variables which will be needed later when the event triggers.    
function CreateMarkerWithEventWindow(point,vHTML) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(vHTML);
});
return marker;
}

*/