//********************
//*** MAP TRACKING ***
//********************

function trackMap(map_str, action_str, info_str) {
//do: map tracking control

	switch (map_str.toLowerCase()) {
		case "hybrid":
			
			switch (action_str.toLowerCase()) {
				case "route":
					_info = info_str.split("|");
					trackSave(map_str, action_str, _info[0], _info[1], _info[2]);
					break;
			}
			
			break;
	}
}

function trackSave(map_str, action_str, from_str, to_str, air_str) {
//do: save into the maptracks table

	url_str = "http://www.travelspec.com/maps11/maps/common/config/maptrack.php?map=" + map_str + "&action=" + action_str + "&from=" + from_str + "&to=" + to_str + "&air=" + air_str + "&";

	if (window.XMLHttpRequest) 	{
		xhr = new XMLHttpRequest()
	} else if (window.ActiveXObject) {
		xhr = new ActiveXObject("Microsoft.XMLHTTP")
	}

	if (xhr != null) {
		xhr.open("GET", url_str, true);
		xhr.send(null);
	} else {
		alert("Your browser does not support XMLHTTP.")
	}
}
