function mailIt(form) {
  var data = document.dataForm
  var userInfo = ""

  // comment out the next line if you want to hardcode the reciepient
  // then add 'foo@bar.com' to the 'mailform' action attribute
  // (i.e. -- ACTION="mailto:foo@bar.com")
  form.action += data.recipient.value
  
  // comment out the next line if you want to hardcode the subject
  // then add '?subject=example' to the 'mailform' action attribute.
  // You must hardcode an address before you can hardcode a subject.
  // (i.e. -- ACTION="mailto:foo@bar.com?subject=example")
  form.action += "?subject=" + data.subject.value

  userInfo += "Page Title:  " + document.title + "\n"
  userInfo += "Mailed From: " + document.location + "\n\n"

  form.mailBody.value = userInfo + data.body.value
  return true
}


function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != "function") {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function iniciarMapa() {
    
    if (GBrowserIsCompatible()) { 
  
      function createDefaultMarker(point,html) {
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        return marker;
      }

      // Display the map, with some controls and set the initial location 
      var map = new GMap2(document.getElementById("sitioMapa_"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(40.194715,-8.432652), 19);
      map.addMapType(G_PHYSICAL_MAP);
	  map.setMapType(G_HYBRID_MAP);

      	// Criar icon for concptsmile
		var icon = new GIcon();
		icon.image = "images/praxis_gmap.png";
		icon.iconSize = new GSize(48, 50); //Pixel size(width,height)
		icon.shadowSize = new GSize(104, 70); //Pixel size(width,height)
		icon.iconAnchor = new GPoint(10, 50); //Top left corner of the icon image at which this icon is anchored to the map.
	  	icon.infoWindowAnchor = new GPoint(35, 5); //Pixel coordinate relative to the top left corner of the icon image at which the INFO WINDOW is anchored to this icon (tipo iconAnchor). APAGAR se nao usar Info Windows

	    //Funcao Criar Marker com Info Windows
		function fMarker(point,icon,html){
			var marker = new GMarker(point,icon);
			GEvent.addListener(marker, "click", function() {
	   		 marker.openInfoWindowHtml(html); //Tamanho minimo e' de 250px
			});	
			return marker;
		}

		//conceptsmile
		var point = new GLatLng(40.194715,-8.432652);
		var html = "<h4>CERVEJARIA PRAXIS</h4><p>Urb. Quinta da V&aacute;rzea, Lote 29<br>Santa Clara, 3040-380 Coimbra<br>Portugal<br><br></p><p><strong>GPS:</strong> 40&deg; 11' 40.97'' N / -8&deg; 25' 57.55'' W</p><p>&nbsp;</p>";
		var marker = fMarker(point,icon,html);
		map.addOverlay(marker);
    }
	   
    
    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
}

window.onunload = GUnload;
addLoadEvent(iniciarMapa);
