function RegionManager() {
	this.regions = {};
	this.dests = {};
	this.destsByDestId = {};
	this.toursByTourId = {};
}

RegionManager.prototype.addRegion = function( region ) {
	if( this.regions[region.destid] == null ) {
		this.regions[region.destid] = region;
	}
}

RegionManager.prototype.getRegion = function( regionId ) {
	return this.regions[regionId];
}

RegionManager.prototype.addDestination = function( dest ) {
	if( this.regions[dest.regionId] != null ) {
		if( this.dests[dest.regionId] == null ) {
			this.dests[dest.regionId] = [];
		}
		
		this.dests[dest.regionId].push( dest );
	}
	
	this.destsByDestId[dest.destid] = dest;
}

RegionManager.prototype.addTour = function( tour ) {
	if( this.regions[tour.regionId] != null ) {
		if( this.dests[tour.regionId] == null ) {
			this.dests[tour.regionId] = [];
		}
		
		this.dests[tour.regionId].push( tour );
	}
	
	this.toursByTourId[tour.destid] = tour;
}

RegionManager.prototype.getAllDestinationsFor = function( regionId ) {
	return this.dests[regionId];
}

RegionManager.prototype.getDestination = function( destId ) {
	return this.destsByDestId[destId];
}

RegionManager.prototype.getTour = function( tourId ) {
	return this.toursByTourId[tourId];
}

RegionManager.prototype.clear = function() {
	this.dests = [];
	this.regions = [];
	this.destsByDestId = {};
	this.toursByTourId = {};
}
