// TomTom HD Traffic access library, $Revision: 38764 $

/// Following the Java conventions, the namespace for the tomtom HD Traffic service is com.tomtom.
var com;
if (!com) com = {};
else if (typeof com != 'object') throw new Error("com already exists and is not an object");

if (!com.tomtom) com.tomtom = {}
else if (typeof com.tomtom != 'object') throw new Error("com.tomtom already exists and is not an object");

/// Main access object is com.tomtom.Hdt
if (!com.tomtom.Hdt) com.tomtom.Hdt = {};

(function() {
    if (!com.tomtom.Hdt.regions) com.tomtom.Hdt.regions = {}
    com.tomtom.Hdt.regions.gb =
    {
        'default': {
            name: 'Great Britain', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 410},
            tiles: {x: -2,  y: 7, zoomLevel: 12},
            viewport: { x: 29, y: -87, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}} 
        },
        'East-Anglia': {
            name: 'East-Anglia', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            viewport: { x: -150, y: -92, align: { x: 'right', y: 'center'}, origin: {x: 'right', y: 'center'}},
            tiles: {x: -1, y: 45, zoomLevel: 9}
        },
        'Greater_London': {
            name: 'Greater London',
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -2, y: 87, zoomLevel: 8},
            viewport: { x: 65, y: -34, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}} 
        },
        'North_England': {
            name: 'North England', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -2, y: 24, zoomLevel: 10},
            viewport: { x: -85, y: -110, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}} 
        },
        'Scotland': {
            name: 'Scotland', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496,y: 410},
            tiles: {x: -3, y: 26, zoomLevel: 10},
            viewport: { x: 5, y: -210, align: { x: 'center', y: 'bottom'}, origin: {x: 'center', y: 'bottom'}} 
        },
        'South_East_England': {
            name: 'South East England', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -1, y: 44, zoomLevel: 9},
            viewport: { x: -111, y: -26, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}} 
        },
        'Wales': {
            name: 'Wales', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 410},
            tiles: {x: -3, y: 23, zoomLevel: 10},
            viewport: { x: 87, y: -103, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}} 
        },
        'West-Country': {
            name: 'West-Country', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -3, y: 23, zoomLevel: 10},
            viewport: { x: 211, y: 45, align: {y: 'center'}, origin: {y: 'center'}}
        },
        'Birmingham-Coventry': {
            name: 'Birmingham-Coventry', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -7, y: 177, zoomLevel: 7},
            viewport: { x: 129, y: -163, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}} 
        },
        'Bristol': {
            name: 'Bristol', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -9, y: 173, zoomLevel: 7},
            viewport: { x: 24, y: -3, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}} 
        },
        'Cardiff_and_Newport': {
            name: 'Cardiff and Newport', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -10, y: 173, zoomLevel: 7},
            viewport: { x: -59, y: -31, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}} 
        },
        'Derby_and_Nottingham': {
            name: 'Derby and Nottingham', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -5, y: 179, zoomLevel: 7},
            viewport: { x: -59, y: -163, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}} 
        },
        'Edinburgh': {
            name: 'Edinburgh', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -11, y: 194, zoomLevel: 7},
            viewport: { x: 96, y: -105, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}}
        },
        'Glasgow': {
            name: 'Glasgow', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -14, y: 194, zoomLevel: 7},
            viewport: { x: 95, y: 21, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}}
        },
        'Leeds_and_Bradford': {
            name: 'Leeds and Bradford', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -6, y: 183, zoomLevel: 7},
            viewport: { x: -8, y: -127, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}}
        },
        'Liverpool': {
            name: 'Liverpool', 
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -9, y: 182, zoomLevel: 7},
            viewport: { x: -119, y: 42, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}}
        },
        'London': {
            name: 'London',
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -2, y: 344, zoomLevel: 6},
            viewport: { x: -33, y: -116, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}}
        },
        'Manchester': {
            name: 'Manchester',
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -8, y: 182, zoomLevel: 7},
            viewport: { x: 35, y: -43, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}}
        },
        'Newcastle': {
            name: 'Newcastle',
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -6, y: 189, zoomLevel: 7},
            viewport: { x: -31, y: -50, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}}
        },
        'Preston': {
            name: 'Preston',
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -9, y: 183, zoomLevel: 7},
            viewport: { x: -76, y: -128, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}}
        },
        'Reading': {
            name: 'Reading',
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -4, y: 172, zoomLevel: 7},
            viewport: { x: 41, y: -176, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}}
        },
        'Sheffield': {
            name: 'Sheffield',
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -5, y: 182, zoomLevel: 7},
            viewport: { x: -54, y: -15, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}}
        },
        'Southampton': {
            name: 'Southampton',
            numberTiles: {x: 3, y: 3},
            size: {x: 496, y: 400},
            tiles: {x: -5, y: 170, zoomLevel: 7},
            viewport: { x: 0, y: -104, align: { x: 'center', y: 'center'}, origin: {x: 'center', y: 'center'}}
        },
        menu: {
            '': ['default'],
            regions: [
                'East-Anglia',
                'Greater_London',
                'North_England',
                'Scotland',
                'South_East_England',
                'Wales',
                'West-Country',
            ],
            cities: [
                'Birmingham-Coventry',
                'Bristol',
                'Cardiff_and_Newport',
                'Derby_and_Nottingham',
                'Edinburgh',
                'Glasgow',
                'Leeds_and_Bradford',
                'Liverpool',
                'London',
                'Manchester',
                'Newcastle',
                'Preston',
                'Reading',
                'Sheffield',
                'Southampton'
            ]
        },
        hierarchy: {
            'default': [
                'South_East_England',
                'East-Anglia',
                'Wales',
                'West-Country',
                'North_England',
                'Scotland',
            ],
            'East-Anglia': ['South_East_England', 'Wales'],
            'North_England': [
                'Birmingham-Coventry',
                'Derby_and_Nottingham',
                'Leeds_and_Bradford',
                'Liverpool',
                'Manchester',
                'Newcastle',
                'Preston',
                'Sheffield',
                'Wales'
            ],
            'South_East_England': [
                'Greater_London',
                'Reading',
                'East-Anglia',
                'Southampton',
                'Wales'
            ],
            'Wales': [
                'Birmingham-Coventry',
                'Bristol',
                'Cardiff_and_Newport',
                'Derby_and_Nottingham',
                'Liverpool',
                'Manchester',
                'Reading',
                'Sheffield',
                'Southampton',
                'East-Anglia',
                'South_East_England',
                'West-Country',
                'North_England',
            ],
            'West-Country': [
                'Birmingham-Coventry',
                'Bristol',
                'Cardiff_and_Newport',
                'Reading',
                'Southampton',
                'East-Anglia',
                'South_East_England',
                'Wales',
            ],
            'South_East_England': [
                'Greater_London', 'East-Anglia', 'Reading', 'Southampton'
            ]
        },
        overview: {
			numberTiles:	{ x:   2, y:   1 },
			size:			{ x: 150, y: 150 },
			tiles:			{ x:  -1, y:  23, zoomLevel: 10 },
			viewport:		{ x: 169, y: 327 }
		}
    }
})();
