function loadMap(x,y,adres) {
  if (GBrowserIsCompatible()) {
	var map = new GMap2(document.getElementById("map"));
	var point = new GLatLng(x,y);
	map.setCenter(point, 13);
	
	geocoder = new GClientGeocoder();

	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	
	map.addOverlay(createMarker(point, adres));

  }
}

function createMarker(point, text) {
  var marker = new GMarker(point);
  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(text);
  });
  return marker;
}


// Email obfuscator script 2.1 by Tim Williams, University of Arizona
// Random encryption key feature by Andrew Moulden, Site Engineering Ltd
// This code is freeware provided these four comment lines remain intact
// A wizard to generate this code is at http://www.jottings.com/obfuscator/

function obfuscator(coded, key,img){
  shift=coded.length
  link=""
  mail="";
  for (i=0; i<coded.length; i++) {
    if (key.indexOf(coded.charAt(i))==-1) {
      ltr = coded.charAt(i)
      link += (ltr)
    }
    else {     
      ltr = (key.indexOf(coded.charAt(i))-shift+key.length) % key.length
      link += (key.charAt(ltr))
    }
  }
  mail = "<a href='mailto:"+link+"'><img src='/images/"+img+"' border='0'></a>";
  return mail;	
 }

