﻿function TabOn(tab)
{
    if (tab.getAttribute("class") == "selectedPage" || tab.getAttribute("class") == "selectedSubPage") return;
    
    if (tab.getAttribute("class") == "nsSub")
    {
        tab.setAttribute("class","selectedSub");
    }
    else
    {
        tab.setAttribute("class","selected");
    }
}

function TabOff(tab)
{
    if (tab.getAttribute("class") == "selectedPage" || tab.getAttribute("class") == "selectedSubPage") return;
    
    if (tab.getAttribute("class") == "selectedSub")
    {
        tab.setAttribute("class","nsSub");
    }
    else
    {
        tab.setAttribute("class","ns");
    }
}

function Initialize()
{
    map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(1.3081872,103.8344557), 16);  
    map.setUIToDefault();
   
    var marker = new GMarker(new GLatLng(1.3081872,103.8344557));
    map.addOverlay(marker);

   // geocoder = new GClientGeocoder();
    //geocoder.getLocations(address, addToMap);
}

 function addToMap(response)
   {
      // Retrieve the object
      place = response.Placemark[0];

      // Retrieve the latitude and longitude
      point = new GLatLng(place.Point.coordinates[1],
                          place.Point.coordinates[0]);

      // Center the map on this point
      map.setCenter(point, 16);
      
      alert(point);

      // Create a marker
      marker = new GMarker(point);

      // Add the marker to map
      map.addOverlay(marker);

      // Add address information to marker
      //marker.openInfoWindowHtml(place.address);
   }
   
   var geocoder;
   var map;

   var restaurant = "The Old Mohawk Restaurant";
   var address = "22 Scotts Road, Singapore, Singapore";



