function isJsEnabled() {
  if (typeof document.jsEnabled == 'undefined') {
    // Note: ! casts to boolean implicitly.
    document.jsEnabled = !(
     !document.getElementsByTagName ||
     !document.createElement        ||
     !document.createTextNode       ||
     !document.documentElement      ||
     !document.getElementById);
  }
  return document.jsEnabled;
}


if (isJsEnabled()) {
  document.documentElement.className = 'js';
}

function addLoadEvent(func) {
  var oldOnload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  }
  else {
    window.onload = function() {
      oldOnload();
      func();
    }
  }
}

function addUnLoadEvent(func) {
  var oldOnUnload = window.onunload;
  if (typeof window.onunload != 'function') {
    window.onunload = func;
  }
  else {
    window.onunload = function() {
      oldOnUnload();
      func();
    }
  }
}

function centerzoominit2(LAT,LNG,GSCALE) {
    map.setCenter(new GLatLng(LAT,LNG), GSCALE);
}
function centerzoomsg() {
var boundsg = new GLatLngBounds(new GLatLng(1.26, 103.65), new GLatLng(1.48, 103.99));
    map.setCenter(new GLatLng(1.37, 103.82), map.getBoundsZoomLevel(boundsg));
}
function TextualZoomControl() {
}
TextualZoomControl.prototype = new GControl();

TextualZoomControl.prototype.initialize = function(map) {
  var container = document.createElement("div");

  var zoomInDiv = document.createElement("div");
  this.setButtonStyle_(zoomInDiv);
  container.appendChild(zoomInDiv);
  zoomInDiv.appendChild(document.createTextNode("(+) Zoom In"));
  GEvent.addDomListener(zoomInDiv, "click", function() {
    map.zoomIn();
  });

  var zoomOutDiv = document.createElement("div");
  this.setButtonStyle_(zoomOutDiv);
  container.appendChild(zoomOutDiv);
  zoomOutDiv.appendChild(document.createTextNode("(-) Zoom Out"));
  GEvent.addDomListener(zoomOutDiv, "click", function() {
    map.zoomOut();
  });

  map.getContainer().appendChild(container);
  return container;
}

TextualZoomControl.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10, 15));
}
// Sets the proper CSS for the given button element.
TextualZoomControl.prototype.setButtonStyle_ = function(button) {
  button.style.textDecoration = "underline";
  button.style.color = "#0000cc";
  button.style.backgroundColor = "#bfb";
  button.style.font = "small Arial";
  button.style.border = "1px outset black";
  button.style.padding = "1px";
  button.style.marginBottom = "3px";
  button.style.textAlign = "center";
  button.style.width = "90px";
  button.style.cursor = "pointer";
}
// Main program - runs on page load.
function gmapload2(LAT,LNG,GSCALE) {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map1"));
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.addControl(new TextualZoomControl());
    map.setCenter(new GLatLng(LAT,LNG), GSCALE, G_NORMAL_MAP);
  }
}

function createMarker(lat, lng, x, y) {
  var marker = new GMarker(new GLatLng(lat,lng), {title : x});
  marker.bindInfoWindowHtml(y);
  return marker;
}