function GoogleMapsItinerary(start, end, gmap, result_container, vars){	
		
		_this = this;
		_this.result_container = $('#'+result_container+'');
		//Langue par défaut
		_this.lang = 'fr';
		
		_this['fr'] = Array();
		_this['en'] = Array();
		
		_this['fr']['version-imprimable']  = "Version imprimable";
		_this['fr']['probleme-adresse'] = "Adresse inconnue";
		_this['fr']['arrivee-destination'] = "Vous êtes arrivé!";
		_this['fr']['votre-itineraire'] = "Votre itinéraire";
		
		_this['en']['version-imprimable']  = "Print version";
		_this['en']['probleme-adresse'] = "Address not found";
		_this['en']['arrivee-destination'] = "Vous êtes arrivé!";
		_this['en']['votre-itineraire'] = "Your itinerary";
		
		for(var a in vars){	
			switch(a){
			default:
			_this[a] = $vars[a];	
			break;		 
			}
		}

		_this.directionsService = new google.maps.DirectionsService();
		_this.directionsDisplay = new google.maps.DirectionsRenderer({suppressMarkers:true, polylineOptions:{strokeColor: "#0000ff",strokeOpacity: 0.9,strokeWeight: 2 } });

		_this.directionsDisplay.setMap(gmap);
		request = { origin:start,  destination:end, travelMode: google.maps.DirectionsTravelMode.DRIVING };
		_this.directionsService.route(request, function(result, status) {
			if (status == google.maps.DirectionsStatus.OK) {
				_this.result = result;
				_this.directionsDisplay.setDirections(_this.result);
				var start_loc = _this.result.routes[0].legs[0].start_location;
				var marker = new google.maps.Marker({ position: start_loc,  title:"Départ" });
				marker.setMap(map);
				if(_this.result_container != null){
					etapes = _this.result.routes[0].legs[0].steps;
					_this.printResult(etapes);
				}
			}	else{
				alert(_this[_this.lang]['probleme-adresse']);
			}
		});
		
		_this.printResult = function(steps){
			_this.pdf_results = "<table style='width:700px' align='center' cellpadding='5'>";
			_this.pdf_results+="<tr><td colspan=2 style='font-size:15px;color:#874A70;font-weight:bold;'>"+_this[_this.lang]['votre-itineraire']+"</td></tr>";			
			var num = steps.length;
			for(i=0;i<num;i++){
				var s = steps[i];
				_this.printStep(s,i);
			}
			_this.printFinalStep();
			_this.pdf_results+= "</table>";
			$("#textarea-itineraire").attr('value',_this.pdf_results);
		}

		_this.printStep = function(step,i){			
			var $container = $('<div></div>').addClass("iti-step");
			_this.result_container.append($container);
			var $number = $('<div></div>').addClass("iti-step-number").html(i+1);
			$container.append($number);
			var $indic = $('<div></div>').addClass("iti-step-indication").html(step.instructions);
			$container.append($indic);	
			_this.pdf_results+="<tr><td class='iti-pdf-number'>"+Math.round(i+1)+"</td><td class='iti-pdf-indication'>"+step.instructions+"</td></tr>";
		}
		
		_this.printFinalStep = function(){		
			var $container = $('<div></div>').addClass("iti-step");
			_this.result_container.append($container);
			var $indic = $('<div  style="position:relative; float:left; line-height:30px;margin-left:10px"></div>').html(_this[_this.lang]['arrivee-destination']);
			$container.append($indic);
			_this.pdf_results+="<tr><td></td><td>"+_this[_this.lang]['arrivee-destination']+"</td></tr>";
		}
}
