﻿//  New functions for Hide & Show
//  works with all browsers..(IE5+, NS7+, Opera7+, Mozilla)
//  RS - 25/09/2003
function newHideObj(what)
{
	document.getElementById(what).style.visibility="hidden";
	document.getElementById(what).style.display="none";
}

function newShowObj(what)
{
	document.getElementById(what).style.visibility="";
	document.getElementById(what).style.display="inline";
	}

function newHideShowObj(what)
{
 if(document.getElementById(what).style.visibility=="hidden")
 {
	document.getElementById(what).style.visibility="";
	document.getElementById(what).style.display="inline";
		 }
 else
 {
 	document.getElementById(what).style.visibility="hidden";
	document.getElementById(what).style.display="none";
 }
}  
function showhideform(what)
 {
	if(what.value=="showform")
	{
		subsform.style.visibility="";
		subsform.style.display="block";
	}
	else 
	{
		subsform.style.visibility="hidden";
		subsform.style.display="none";
	}
 }
 
 // Google Map methods  created by Ilango 25/09/2007
 
    //<![CDATA[

   var geocoder;
   var map;
   var address;
  
   // validate Address
     function addValidate(getadd) { 
     address=getadd;
    // Create new map object
      if (GBrowserIsCompatible()) 
      { 
      map = new GMap2(document.getElementById("map"));
      }   
      // Create new geocoding object
      geocoder = new GClientGeocoder();
    
        geocoder.getLatLng( 
        address, 
        function(latlng) { 
        if (!latlng) { 
        alert(address + " not found"); 
        } else { 
        load()
            } 
            } 
    ); 
    } 

   // On page load, call this function
   function load()
   {
     // Retrieve location information, pass it to addToMap()
      geocoder.getLocations(address, addToMap);
   }

   // This function adds the point to the map

   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);

        // zoom control
        //map.addControl(new GSmallMapControl());

        // Views control 
        //map.addControl(new GMapTypeControl());

        // Create a marker
        // marker = new GMarker(point , new GIcon(G_DEFAULT_ICON,"../../images/tick_bullet.png"));
        marker = new GMarker(point);
        //map.addControl(new GOverviewMapControl(new GSize(50,50)));
        // Add the marker to map
        map.addOverlay(marker);
        //map.enableDoubleClickZoom();
        map.enableScrollWheelZoom();
        // arrowIcon.image = "../../images/tick_bullet.png";
        //  map.addOverlay(new GMarker(point, arrowIcon));
        // map.removeOverlay(marker);

        // Add address information to marker
        //marker.openInfoWindowHtml(place.address);

   }

    //]]>
    
    
    
