scripts/database.js
/**
 * Driver function for adding a Custom Route to the Drop-Down Lists and Database
 * @param {String} modelURL The URL of the Custom Model used
 * @param {number} travelMethod The ID of the Travel Method that was used to travel along the Route
 * @param {number} modelID The ID of the Model in the Database that was used to travel along the Route
 */
Driver function for adding a Custom Route to the Drop-Down Lists and Database
@param {String} modelURL The URL of the Custom Model used
@param {number} travelMethod The ID of the Travel Method that was used to travel along the Route
@param {number} modelID The ID of the Model in the Database that was used to travel along the Route
Driver function for adding a Custom Route to the Drop - Down Lists and Database @param { String } modelURL The URL of the Custom Model used @param { number } travelMethod The ID of the Travel Method that was used to travel along the Route @param { number } modelID The ID of the Model in the Database that was used to travel along the Route
function addNewCustomRoute(modelURL, travelMethod, modelID) {
	var routeType = "Custom";
	var maxCustomItems = 5;
	var menuSection = "route";
	if(customItemEntered($("#route"))) {
		var startLocation = $("#customRouteFrom").val().capitalize();
		var endLocation = $("#customRouteTo").val().capitalize();
		var optGroup = determineMenuItemOptGroup(routeType, menuSection);
		setRouteOptGroupValAndText(startLocation, endLocation, optGroup);
		addNewCustomRouteToDatabase(startLocation, endLocation, routeType, travelMethod, modelID, modelURL);
		var removeOldRoutesCB = function(ddlVal) {
			routePoints = tokenizeRouteValue(new Object(), ddlVal)
			removeOldCustomRoutesFromDB(routePoints.from, routePoints.to);
		};
		removeOldCustomOptEntries(optGroup, maxCustomItems, removeOldRoutesCB);
	}
}
function addNewCustomRoute ( modelURL , travelMethod , modelID ) { var routeType = "Custom" ; var maxCustomItems = 5 ; var menuSection = "route" ; if ( customItemEntered ( $ ( "#route" ) ) ) { var startLocation = $ ( "#customRouteFrom" ) . val ( ) . capitalize ( ) ; var endLocation = $ ( "#customRouteTo" ) . val ( ) . capitalize ( ) ; var optGroup = determineMenuItemOptGroup ( routeType , menuSection ) ; setRouteOptGroupValAndText ( startLocation , endLocation , optGroup ) ; addNewCustomRouteToDatabase ( startLocation , endLocation , routeType , travelMethod , modelID , modelURL ) ; var removeOldRoutesCB = function ( ddlVal ) { routePoints = tokenizeRouteValue ( new Object ( ) , ddlVal ) removeOldCustomRoutesFromDB ( routePoints . from , routePoints . to ) ; } ; removeOldCustomOptEntries ( optGroup , maxCustomItems , removeOldRoutesCB ) ; } }
Driver function for adding a Custom Route to the Drop-Down Lists and Database
 @param {String} modelURL The URL of the Custom Model used
 @param {number} travelMethod The ID of the Travel Method that was used to travel along the Route
 @param {number} modelID The ID of the Model in the Database that was used to travel along the Route
Driver function for adding a Custom Route to the Drop - Down Lists and Database @param { String } modelURL The URL of the Custom Model used @param { number } travelMethod The ID of the Travel Method that was used to travel along the Route @param { number } modelID The ID of the Model in the Database that was used to travel along the Route
//Check the user has selected to enter a New Cusrom Route