function TiagoApi(map_canvas, directions){

	TiagoApi = this;

	this.map = new GMap2(map_canvas);
	this.map.addControl(new GSmallMapControl());
	this.map.addControl(new GMapTypeControl());
		
	this.gdir = new GDirections(this.map, directions);
	
	this.baseIcon = new GIcon(G_DEFAULT_ICON);
	this.baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
	this.baseIcon.iconSize = new GSize(37, 34);
	this.baseIcon.shadowSize = new GSize(0, 34);
	this.baseIcon.iconAnchor = new GPoint(17, 34);
	this.baseIcon.infoWindowAnchor = new GPoint(9, 2);
	
	this.setDirections = function (fromAddress, toAddress, locale) {
	  this.gdir.load("from: " + fromAddress + " to: " + toAddress,
	  { "locale": locale , "getSteps":true});
	}	
	
	this.setCenter = function (address, level) {  
	  var geocoder = new GClientGeocoder();
	    geocoder.getLatLng(address,function(point) {
		        if (!point) {
		          alert('Endereço "' + address + '" não encontrado');
		        } else {
		          TiagoApi.map.setCenter(point,level);
		        }
	    });
	}
	
	this.createMarkerFromAddress = function (address, text) {  
		var geocoder = new GClientGeocoder();
	    geocoder.getLatLng(address,
	      function(point) {
		        if (!point) {
		          alert('Endereço "' + address + '" não encontrado');
		        } else {
		          TiagoApi.createMarkerFromPoint(point, text);
		        }
	    });
	}
	
	this.createMarkerFromPoint = function (point, text, icon) {  
	      var letteredIcon = new GIcon(this.baseIcon);  
		  if(icon == null){
		  letteredIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png";  
		  }else{
		  letteredIcon.image = icon;
		  }
		  
		  markerOptions = { icon:letteredIcon };	          
	      var marker = new GMarker(point, markerOptions);  
		  GEvent.addListener(marker, "click", 
		  		function() {    
		  			marker.openInfoWindowHtml(text);  
		  		});
		  TiagoApi.map.addOverlay(marker);
	}
	
}
