
function myOnLoad()
{
		initialize();
}
function showT(q,level){ 
document.getElementById('sun').setAttribute('src',level+'newlistingo_images/'+q) 
} 
function contacusform(id)
{
	document.getElementById('direction').style.display='none';
	document.getElementById('contact').style.display=id;
	
	
}
function directionsform(id)
{
document.getElementById('contact').style.display='none';
document.getElementById('direction').style.display=id;
}
  var map = null;
    var geocoder = null;
      // Call this function when the page has been loaded
      function initialize()
	  {
        map = new GMap2(document.getElementById("map"));
		map.addControl(new GMapTypeControl()); // for different map type - satelite or map
		map.addControl(new GLargeMapControl());//adding big zoom control in map
		map.addControl(new GScaleControl()); // display scale at left bottom
		map.setCenter(new GLatLng(43.907787,-79.359741), 17);
        geocoder = new GClientGeocoder();
        var ele = document.forms['frmgmap'].elements;
		var splvalue;
		for(p=0;p<ele.length;p++)
	    {
             if(ele[p].type == 'hidden')
				{
					splvalue = ele[p].value;
				}
	    }
        showAddress(splvalue);
      }
     function showAddress(address)
	 {
	      if (geocoder) {
	        geocoder.getLatLng(
	          address,
	          function(point) {
	            if (!point) {
	              alert(address + " not found");
	            } else {
	              map.setCenter(point, 13);
	              var marker = new GMarker(point);
	              map.addOverlay(marker);
	              marker.openInfoWindowHtml(address);
	            }
	          }
	        );
	      }
    }

