function loadMapComm(id) {
	$('#mapInfo').load('/js/function.php?mapId='+id);
}
/*******************************************************    FUNZIONE BASE64 PER CONTENUTI JAVASCRIPT */

var jbase64 = {
 _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
 encode : function (input) {
  var output = "";
  var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
  var i = 0;
  input = jbase64._utf8_encode(input);
  while (i < input.length) {
   chr1 = input.charCodeAt(i++);
   chr2 = input.charCodeAt(i++);
   chr3 = input.charCodeAt(i++);
   enc1 = chr1 >> 2;
   enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
   enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
   enc4 = chr3 & 63;
   if (isNaN(chr2)) {
    enc3 = enc4 = 64;
   } else if (isNaN(chr3)) {
    enc4 = 64;
   }
   output = output +
   this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
   this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
  }
  return output;
 },
 decode : function (input) {
  var output = "";
  var chr1, chr2, chr3;
  var enc1, enc2, enc3, enc4;
  var i = 0;
  input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
  while (i < input.length) {
   enc1 = this._keyStr.indexOf(input.charAt(i++));
   enc2 = this._keyStr.indexOf(input.charAt(i++));
   enc3 = this._keyStr.indexOf(input.charAt(i++));
   enc4 = this._keyStr.indexOf(input.charAt(i++));
   chr1 = (enc1 << 2) | (enc2 >> 4);
   chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
   chr3 = ((enc3 & 3) << 6) | enc4;
   output = output + String.fromCharCode(chr1);
   if (enc3 != 64) {
    output = output + String.fromCharCode(chr2);
   }
   if (enc4 != 64) {
    output = output + String.fromCharCode(chr3);
   }
  }
  output = jbase64._utf8_decode(output);
  return output;
 },
 _utf8_encode : function (string) {
  string = string.replace(/\r\n/g,"\n");
  var utftext = "";
  for (var n = 0; n < string.length; n++) {
   var c = string.charCodeAt(n);
   if (c < 128) utftext += String.fromCharCode(c);
   else if((c > 127) && (c < 2048)) {
    utftext += String.fromCharCode((c >> 6) | 192);
    utftext += String.fromCharCode((c & 63) | 128);
   } else {
    utftext += String.fromCharCode((c >> 12) | 224);
    utftext += String.fromCharCode(((c >> 6) & 63) | 128);
    utftext += String.fromCharCode((c & 63) | 128);
   }
  }
  return utftext;
 },
 _utf8_decode : function (utftext) {
  var string = "";
  var i = 0;
  var c = c1 = c2 = 0;
  while ( i < utftext.length ) {
   c = utftext.charCodeAt(i);
   if (c < 128) {
    string += String.fromCharCode(c);
    i++;
   } else if((c > 191) && (c < 224)) {
    c2 = utftext.charCodeAt(i+1);
    string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
    i += 2;
   } else {
    c2 = utftext.charCodeAt(i+1);
    c3 = utftext.charCodeAt(i+2);
    string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
    i += 3;
   }
  }
  return string;
 }
}



// FUNZIONI PER LA MAPPA V3
var i, infoBox;
i = 1;
var myZindex = 0;

function setMarkers(mapId, optiones, zoom, mapType, showCursor, multiple, showBox, openBox) {
	if (multiple == undefined) multiple = false;
	var multipleCategory = "";
	if(multiple != false && multiple !== true){
		multipleCategory = multiple;
		multiple = true;
	}
	if (showBox == undefined) showBox = false;
	if (openBox == undefined) openBox = false;
	if (showBox || openBox != false) infoBox = new BFInfoWindow();
	var myMarker = new Array();
	myMarker['iconsize'] = "30,30";
	myMarker['iconhancor'] = "0,15";
	for (names in optiones) myMarker[names] = optiones[names];
	var latlng = new google.maps.LatLng(myMarker['lat'], myMarker['lon']);
	if(mapType == undefined) mapType = "ROADMAP"; //ROADMAP - SATELLITE - HYBRID - TERRAIN 
	if(showCursor == undefined) showCursor = false;
    var myOptions = {
		disableDefaultUI: showCursor,
		zoom: zoom,
		center: latlng,
		mapTypeId: google.maps.MapTypeId[mapType]
    };
    var maps = new google.maps.Map(document.getElementById(mapId), myOptions);
	
	var myLatLng = new google.maps.LatLng(myMarker['lat'], myMarker['lon']);
	if (multiple){
		if(multipleCategory != "") multipleCategory = "?catId="+ multipleCategory;
		downloadUrl("/assets/interestPoint.php"+ multipleCategory, function(data, responseCode) {

  			var markers_def = data.documentElement.getElementsByTagName("marker");
			for (var i_def=0; i_def<markers_def.length; i_def++) {
				if(openBox != false && openBox == markers_def[i_def].getAttribute("id")){
					var marker = new google.maps.Marker({
						position: new google.maps.LatLng(parseFloat(markers_def[i_def].getAttribute("lat")), parseFloat(markers_def[i_def].getAttribute("lng"))),
						map: maps,
						title: markers_def[i_def].getAttribute("name"),
						icon: markers_def[i_def].getAttribute("idImg"),
						zIndex: myZindex + 1
					});
					openInfoBox(marker, base_64.decode(markers_def[i_def].getAttribute("ballon")), maps);
				} else if(openBox == false){
					var marker = new google.maps.Marker({
						position: new google.maps.LatLng(parseFloat(markers_def[i_def].getAttribute("lat")), parseFloat(markers_def[i_def].getAttribute("lng"))),
						map: maps,
						title: markers_def[i_def].getAttribute("name"),
						icon: markers_def[i_def].getAttribute("idImg"),
						zIndex: myZindex + 1
					});
					
					google.maps.event.addListener(marker, "mouseover", function() {
						this.setZIndex(myZindex + 1);
						myZindex = myZindex + 1;
					});
	
					if(markers_def[i_def].getAttribute("url") != "") {
						if(showBox) attachInfoBox(marker, base_64.decode(markers_def[i_def].getAttribute("ballon")), maps, markers_def[i_def].getAttribute("url"));
						attachURL(marker, markers_def[i_def].getAttribute("url"));
					} else {
						if(showBox) attachInfoBox(marker, base_64.decode(markers_def[i_def].getAttribute("ballon")), maps);
					}
					myZindex++;
				}
			}
		});
	} else {
		var marker = new google.maps.Marker({
			position: myLatLng,
			map: maps,
			icon: myMarker['icon']
		});
	}
	var marker = new google.maps.Marker({
		position: new google.maps.LatLng(45.51748533496342, 12.683565616607666),
		map: maps,
		title: "Hotel Orizzonte",
		icon:'/images/icon_hotel.png',
		zIndex: 10000000000
	});
	
}
var infowindow;
function attachURL(marker, url) {
	google.maps.event.addListener(marker, "click", function() {
		location.href = url;
	});
}
function attachInfoBox(marker, text, myMap, url) {
	google.maps.event.addListener(marker, "mouseover", function() {
		infoBox.setContent(text);
		infoBox.setUrl(url);
		infoBox.open(myMap, marker);
		this.setZIndex(myZindex + 1);
		myZindex = myZindex + 1;
	});
	google.maps.event.addListener(marker, "mouseout", function() {
		infoBox.close();
	});
}
function openInfoBox(marker, text, myMap) {
	var myLatLan = marker.getPosition();
	myMap.setCenter(myLatLan);
	infoBox.setContent(text);
	infoBox.open(myMap, marker);
}
var base_64 = {
	_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
	encode : function (input) {
		var output = "";
		var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
		var i = 0;
		input = base_64._utf8_encode(input);
		while (i < input.length) {
			chr1 = input.charCodeAt(i++);
			chr2 = input.charCodeAt(i++);
			chr3 = input.charCodeAt(i++);
			enc1 = chr1 >> 2;
			enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
			enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
			enc4 = chr3 & 63;
			if (isNaN(chr2)) {
				enc3 = enc4 = 64;
			} else if (isNaN(chr3)) {
				enc4 = 64;
			}
			output = output +
			this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
			this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
		}
		return output;
	},
	decode : function (input) {
		var output = "";
		var chr1, chr2, chr3;
		var enc1, enc2, enc3, enc4;
		var i = 0;
		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
		while (i < input.length) {
			enc1 = this._keyStr.indexOf(input.charAt(i++));
			enc2 = this._keyStr.indexOf(input.charAt(i++));
			enc3 = this._keyStr.indexOf(input.charAt(i++));
			enc4 = this._keyStr.indexOf(input.charAt(i++));
			chr1 = (enc1 << 2) | (enc2 >> 4);
			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
			chr3 = ((enc3 & 3) << 6) | enc4;
			output = output + String.fromCharCode(chr1);
			if (enc3 != 64) output = output + String.fromCharCode(chr2);
			if (enc4 != 64) output = output + String.fromCharCode(chr3);
		}
		output = base_64._utf8_decode(output);
		return output;
	},
	_utf8_encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
		for (var n = 0; n < string.length; n++) {
			var c = string.charCodeAt(n);
			if (c < 128) {
				utftext += String.fromCharCode(c);
			} else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			} else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
		}
		return utftext;
	},
	_utf8_decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;
		while ( i < utftext.length ) {
			c = utftext.charCodeAt(i);
			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			} else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			} else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}
		}
		return string;
	}
}

function createXmlHttpRequest(){
	try {
		if (typeof ActiveXObject != 'undefined') {
			return new ActiveXObject('Microsoft.XMLHTTP');
		} else if (window["XMLHttpRequest"]) {
			return new XMLHttpRequest();
		}
	} catch (e) {
		changeStatus(e);
	}
	return null;
}

function downloadUrl(url, callback) {
	var status = -1;
	var request = createXmlHttpRequest();
	if (!request) {
		return false;
	}
	
	request.onreadystatechange = function(){
		if (request.readyState == 4) {
			try {
				status = request.status;
			} catch (e) {
			}
			if (status == 200) {
				callback(request.responseXML, request.status);
				request.onreadystatechange = function() {};
			}
		}
	}
	request.open('GET', url, true);
	try {
		request.send(null);
	} catch (e) {
		changeStatus(e);
	}
}

// FINE MAPPA



/* BFInfoWindow mimics the InfoWindow class found Google Maps API v3 but allows
* the user to define their own info window styles.
* @author Peter Robinett, peter@bubblefoundry.com
* @version 0.1
*/
 
/* An BFInfoWindow is like an info window, but it displays under the marker,
* opens quicker, and has flexible styling. Overload its createElement to style the info window.
* @param {InfoWindowOptions} options An options object
* http://github.com/pr1001/BFInfoWindow/blob/master/bfinfowindow.js
*/
function BFInfoWindow(options) {
  google.maps.OverlayView.call(this);
  this.offsetVertical_ = -99;
  this.offsetHorizontal_ = -18;
  this.height_ = 80;
  this.width_ = 87;
  this.setMap(this.map_);
  this.setOptions(options);
}
BFInfoWindow.prototype = new google.maps.OverlayView();
var myMarkerNow;
BFInfoWindow.prototype.open = function(map, anchor) {
  	myMarkerNow = anchor;
	this.setLocation(anchor.position);
	this.latlng_ = this.getLocation();
	this.map_ = map;
	var self = this;
	/*this.boundsChangedListener_ = google.maps.event.addListener(this.map_, "bounds_changed", function() {
		return self.panMap.apply(self);
	});*/
  	this.setMap(this.map_);
};
BFInfoWindow.prototype.close = function() {this.setMap(null);};
BFInfoWindow.prototype.setOptions = function(options) {this.setValues(options);};
BFInfoWindow.prototype.setContent = function(content) {this.set("content", content);};
BFInfoWindow.prototype.getContent = function() {return this.get("content");};
BFInfoWindow.prototype.setUrl = function(myUrl) {this.set("url", myUrl);};
BFInfoWindow.prototype.getUrl = function() {return this.get("url");};
BFInfoWindow.prototype.setLocation = function(location) {this.set("location", location);};
BFInfoWindow.prototype.getLocation = function() {return this.get("location");};
BFInfoWindow.prototype.setZIndex = function(zIndex) {this.set("zIndex", zIndex);};
BFInfoWindow.prototype.getZIndex = function() {return this.get("zIndex");};
BFInfoWindow.prototype.remove = function() {if (this.myDiv) {this.myDiv.parentNode.removeChild(this.myDiv);this.myDiv = null;}};
BFInfoWindow.prototype.draw = function() {
  	this.createElement();
	if (!this.myDiv) return;
	var pixPosition = this.getProjection().fromLatLngToDivPixel(this.latlng_);
	if (!pixPosition) return;
	this.myDiv.style.width = this.width_ + "px";
	this.myDiv.style.left = (pixPosition.x + this.offsetHorizontal_) + "px";
	this.myDiv.style.height = this.height_ + "px";
	this.myDiv.style.top = (pixPosition.y + this.offsetVertical_) + "px";
	this.myDiv.style.display = 'block';

	this.myDiv.style.width = this.width_ + "px";
	this.myDiv.style.left = (pixPosition.x + this.offsetHorizontal_) + "px";
	this.myDiv.style.height = this.height_ + "px";
	this.myDiv.style.top = (pixPosition.y + this.offsetVertical_) + "px";
	this.myDiv.style.display = 'block';
	
	var mapDiv = this.map_.getDiv();
	var mapWidth = mapDiv.offsetWidth;
	var mapHeight = mapDiv.offsetHeight;
	var bounds = this.map_.getBounds();
	var boundsSpan = bounds.toSpan();
	var longSpan = boundsSpan.lng();
	var latSpan = boundsSpan.lat();
	var degWidth = (this.width_/mapWidth) * longSpan;
	var degHeight = (this.height_/mapHeight) * latSpan;
	
	if ((this.latlng_.lng() + (degWidth/2)) > bounds.getNorthEast().lng()) {
		this.myDiv.style.left = pixPosition.x - (((this.latlng_.lng() + degWidth) - bounds.getNorthEast().lng())/longSpan*mapWidth) - 20 + "px";}
	if ((this.latlng_.lng() - (degWidth/2)) < (bounds.getSouthWest().lng())) {
		new_posit = pixPosition.x + this.width_  - (((this.latlng_.lng() + degWidth) - bounds.getSouthWest().lng())/longSpan*mapWidth) + 10 + "px";
		this.myDiv.style.left = new_posit;}
	if ((this.latlng_.lat()) < (bounds.getSouthWest().lat())+((this.offsetVertical_ + this.height_)/mapHeight*latSpan)) {
		this.myDiv.style.top = (pixPosition.y - this.offsetVertical_ - this.height_) + "px";
	}
};
BFInfoWindow.prototype.createElement = function() {
  	var panes = this.getPanes();
	var div = this.myDiv;
	if (!div) {
		div = this.myDiv = document.createElement("div");
		div.style.border = "0px none";
		div.style.position = "absolute";
		//div.style.background = "url('/images/iconMarkerBig.png')";
		div.style.background = "url('/images/icon_big.png')";
		div.style.width = this.width_ + "px";
		div.style.height = this.height_ + "px";
		//alert(this.getZIndex());
		//div.style.zIndex = this.getZIndex();
		var contentDiv = document.createElement("div");
		contentDiv.id = "BFInfoWindow_content";
		contentDiv.innerHTML = this.getContent();
		div.appendChild(contentDiv);
		div.style.display = 'none';
		panes.floatPane.appendChild(div);
		//this.panMap();
	} else if (	div.parentNode && div.parentNode != panes.floatPane) {
		div.parentNode.removeChild(div);
		panes.floatPane.appendChild(div);
		document.getElementById("BFInfoWindow_content").innerHTML = this.getContent();
	} else {
		if(document.getElementById("BFInfoWindow_content")){
			document.getElementById("BFInfoWindow_content").innerHTML = this.getContent();
		}
	}
};

BFInfoWindow.prototype.removeBFInfoWindow = function(ib) {
	return function() {
		ib.setMap(null);
	};
};
BFInfoWindow.prototype.panMap = function() {
	var map = this.map_;
	var bounds = map.get_bounds();
	if (!bounds) return;
	var position = this.latlng_;
	var iwWidth = this.width_;
	var iwHeight = this.height_;
	var iwOffsetX = this.offsetHorizontal_;
	var iwOffsetY = this.offsetVertical_;
	var padX = 40;
	var padY = 40;
	var mapDiv = map.getDiv();
	var mapWidth = mapDiv.offsetWidth;
	var mapHeight = mapDiv.offsetHeight;
	var boundsSpan = bounds.toSpan();
	var longSpan = boundsSpan.lng();
	var latSpan = boundsSpan.lat();
	var degPixelX = longSpan / mapWidth;
	var degPixelY = latSpan / mapHeight;
	var mapWestLng = bounds.getSouthWest().lng();
	var mapEastLng = bounds.getNorthEast().lng();
	var mapNorthLat = bounds.getNorthEast().lat();
	var mapSouthLat = bounds.getSouthWest().lat();
	var iwWestLng = position.lng() + (iwOffsetX - padX) * degPixelX;
	var iwEastLng = position.lng() + (iwOffsetX + iwWidth + padX) * degPixelX;
	var iwNorthLat = position.lat() - (iwOffsetY - padY) * degPixelY;
	var iwSouthLat = position.lat() - (iwOffsetY + iwHeight + padY) * degPixelY;
	var shiftLng = (iwWestLng < mapWestLng ? mapWestLng - iwWestLng : 0) + (iwEastLng > mapEastLng ? mapEastLng - iwEastLng : 0);
	var shiftLat = (iwNorthLat > mapNorthLat ? mapNorthLat - iwNorthLat : 0) + (iwSouthLat < mapSouthLat ? mapSouthLat - iwSouthLat : 0);
	var center = map.get_center();
	var centerX = center.lng() - shiftLng;
	var centerY = center.lat() - shiftLat;
	map.set_center(new google.maps.LatLng(centerY, centerX));
	google.maps.event.removeListener(this.boundsChangedListener_);
	this.boundsChangedListener_ = null;
};

/*******************************************************    SCRIPT GOOGLEMAPS */

var infowindow,maps;var setDirection={options:{dirContainer:document.getElementById('dirContainer'),dirService:"",dirRenderer:"",myMarker:"",mapId:"",zoom:"",mapType:"",showCursor:""},set:function(mapId,optiones,zoom,mapType,showCursor){setDirection.options.mapId=mapId;setDirection.options.zoom=zoom;setDirection.options.mapType=mapType;setDirection.options.showCursor=showCursor;setDirection.options.myMarker=new Array();for(names in optiones)setDirection.options.myMarker[names]=optiones[names];setDirection.options.myMarker['infowindow']='<div id="ballon" class="ballon"><h5>'+setDirection.options.myMarker['labelTitle']+'</h5>'+setDirection.options.myMarker['infowindow']+'<br /><br />'+setDirection.options.myMarker['labelCalculate']+'<br /><a href="javascript:;" onclick="setDirection.init(\'<h5>'+setDirection.options.myMarker['labelTitle']+'</h5><br />'+setDirection.options.myMarker['labelCalculate']+'\', \''+setDirection.options.myMarker['labelFrom']+'\', \''+setDirection.options.myMarker['labelTo']+'\', \'FROM\', \''+setDirection.options.myMarker['lat']+', '+setDirection.options.myMarker['lon']+'\');" title="'+setDirection.options.myMarker['labelCalculate']+'"><strong>'+setDirection.options.myMarker['labelFrom']+'</strong></a> - <a href="javascript:;" onclick="setDirection.init(\'<h5>'+setDirection.options.myMarker['labelTitle']+'</h5><br />'+setDirection.options.myMarker['labelCalculate']+'\', \''+setDirection.options.myMarker['labelFrom']+'\', \''+setDirection.options.myMarker['labelTo']+'\', \'TO\', \''+setDirection.options.myMarker['lat']+', '+setDirection.options.myMarker['lon']+'\');" title="'+setDirection.options.myMarker['labelCalculate']+'"><strong>'+setDirection.options.myMarker['labelTo']+'</strong></a></div>';setDirection.openMap();},openMap:function(){if(maps==''||maps==undefined){var latlng=new google.maps.LatLng(setDirection.options.myMarker['lat'],setDirection.options.myMarker['lon']);if(setDirection.options.mapType==undefined)setDirection.options.mapType="ROADMAP";if(setDirection.options.showCursor==undefined)setDirection.options.showCursor=false;var myOptions={disableDefaultUI:setDirection.options.showCursor,mapTypeControl:true,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},zoom:setDirection.options.zoom,center:latlng,mapTypeId:google.maps.MapTypeId[setDirection.options.mapType]};maps=new google.maps.Map(document.getElementById(setDirection.options.mapId),myOptions);var myLatLng=new google.maps.LatLng(setDirection.options.myMarker['lat'],setDirection.options.myMarker['lon']);var marker=new google.maps.Marker({position:myLatLng,map:maps,icon:setDirection.options.myMarker['icon'],zIndex:10000});if(setDirection.options.myMarker['infowindow']!=""){infowindow=new google.maps.InfoWindow({content:setDirection.options.myMarker['infowindow'],maxWidth:350,position:myLatLng,zIndex:100});infowindow.open(maps,infowindow);google.maps.event.addListener(marker,"click",function(){infowindow.open(maps,infowindow);});}}},init:function(myText,from,to,direction,latLan){if(document.getElementById('ballon')){setDirection.options.dirService=new google.maps.DirectionsService();setDirection.options.dirRenderer=new google.maps.DirectionsRenderer();var myFormDirection,textDirection;if(direction=="FROM"){myFormDirection='<form name="direction" action="javascript:;" method="get"><input id="from-input" type="hidden" value="'+latLan+'" />';myFormDirection+='<input id="to-input" type="text" value="" class="inputE" />';myFormDirection+='<input class="inputB" onclick="setDirection.getDirections(document.getElementById(\'from-input\').value, document.getElementById(\'to-input\').value);" type="button" value=">" /></form>';textDirection=myText+'<br /><strong>'+from+'</strong> - <a href="javascript:;" onclick="setDirection.init(\''+myText+'\', \''+from+'\', \''+to+'\', \'TO\', \''+latLan+'\');"><strong>'+to+'</strong></a>'+myFormDirection;}else{myFormDirection='<form name="direction" action="javascript:;" method="get"><input id="from-input" type="text" value="" class="inputE" />';myFormDirection+='<input id="to-input" type="hidden" value="'+latLan+'" />';myFormDirection+='<input class="inputB" onclick="setDirection.getDirections(document.getElementById(\'from-input\').value, document.getElementById(\'to-input\').value);" type="button" value=">" /></form>';textDirection=myText+'<br /><a href="javascript:;" onclick="setDirection.init(\''+myText+'\', \''+from+'\', \''+to+'\', \'FROM\', \''+latLan+'\');"><strong>'+from+'</strong></a> - <strong>'+to+'</strong>'+myFormDirection;} document.getElementById('ballon').innerHTML=textDirection;}},getDirections:function(fromStr,toStr){var dirRequest={origin:fromStr,destination:toStr,travelMode:google.maps.DirectionsTravelMode.DRIVING,unitSystem:google.maps.DirectionsUnitSystem.METRIC,provideRouteAlternatives:true};setDirection.options.dirService.route(dirRequest,setDirection.showDirections);},showDirections:function(dirResult,dirStatus){if(dirStatus!=google.maps.DirectionsStatus.OK){if(typeof(dirStatusError)!=undefined){alert(dirStatusError+"\n(Google reports: "+dirStatus+")");}else{alert("The address entered was not found\n(Google reports: "+dirStatus+")");}return;}$('html,body').animate({scrollTop:$('#'+setDirection.options.mapId).offset().top-20},1000);setDirection.openMap();setDirection.options.dirRenderer.setMap(null);setDirection.options.dirRenderer.setMap(maps);$('#dirContainer').html('');setDirection.options.dirRenderer.setPanel(document.getElementById('dirContainer'));setDirection.options.dirRenderer.setDirections(dirResult);}};
