var printObj ='';

// ==================================================================
// Map configuartion
// ==================================================================

function initMdvMapConfig(name) {
	currentPage = document.getElementById('currentPage').value;

	if (currentPage == 'trafficSituation') {
		mdvMapConfig.add('serverURL', absoluteServerPath.vlTiles + mapTilesTraffic);
		mdvMapConfig.add('efaURL', absoluteServerPath.efa + '/liteVipVienna/XSLT_COORD_REQUEST');
		mdvMapConfig.add('transparentImg', imgPath + 'transparent.gif');
		mdvMapConfig.add('imagePath', imgPath);
		mdvMapConfig.add('network', 'vor');
		mdvMapConfig.add('trips.useJsonForPath', 'true');
        mdvMapConfig.add('trips.jsonServerURL', absoluteServerPath.efa + '/vip2/XSLT_TRIP_REQUEST2');
		mdvMapConfig.add('defaultScale', defaultScaleTraffic);
		mdvMapConfig.add('xCenterReal', mapCenterX);
		mdvMapConfig.add('yCenterReal', mapCenterY);
		mdvMapConfig.add('mapName', nameMap);
		mdvMapConfig.add('block', '100');
		mdvMapConfig.add('language', mapLanguage);
		mdvMapConfig.add('zoomOnDoubleClick', 'true');
		mdvMapConfig.add('cursorMove', imgPath + 'grabbing.cur');
		mdvMapConfig.add('useMagnifyGlass', 'true');
		mdvMapConfig.add('useBubbleOverflowForEFAInfo', 'true');
		trafficTiles = absoluteServerPath.mapBroker + trafficTilesTraffic;
	    trafficHost = absoluteServerPath.mapBroker + trafficHostTraffic;
	}
	else if (currentPage == 'trainSituation') {
		mdvMapConfig.add('serverURL', absoluteServerPath.vlTiles + mapTilesTrain);
		mdvMapConfig.add('efaURL', absoluteServerPath.efa + '/liteVipVienna/XSLT_COORD_REQUEST');
		mdvMapConfig.add('transparentImg', imgPath + 'transparent.gif');
		mdvMapConfig.add('imagePath', imgPath);
		mdvMapConfig.add('network', 'vor');
		mdvMapConfig.add('trips.useJsonForPath', 'true');
        mdvMapConfig.add('trips.jsonServerURL', absoluteServerPath.efa + '/vip2/XSLT_TRIP_REQUEST2');
		mdvMapConfig.add('defaultScale', defaultScaleTrain);
		mdvMapConfig.add('xCenterReal', mapCenterX);
		mdvMapConfig.add('yCenterReal', mapCenterY);
		mdvMapConfig.add('mapName', nameMap);
		mdvMapConfig.add('block', '100');
		mdvMapConfig.add('language', mapLanguage);
		mdvMapConfig.add('zoomOnDoubleClick', 'true');
		mdvMapConfig.add('cursorMove', imgPath + 'grabbing.cur');
		mdvMapConfig.add('useMagnifyGlass', 'true');
		mdvMapConfig.add('useBubbleOverflowForEFAInfo', 'true');
		trafficTiles = absoluteServerPath.mapBroker + trafficTilesTrain;
	    trafficHost = absoluteServerPath.mapBroker + trafficHostTrain;
	}
	else if (currentPage == 'parkingSituation') {
		mdvMapConfig.add('serverURL', absoluteServerPath.vlTiles + mapTilesParking);
		mdvMapConfig.add('efaURL', absoluteServerPath.efa + '/liteVipVienna/XSLT_COORD_REQUEST');
		mdvMapConfig.add('transparentImg', imgPath + 'transparent.gif');
		mdvMapConfig.add('imagePath', imgPath);
		mdvMapConfig.add('network', 'vor');
		mdvMapConfig.add('trips.useJsonForPath', 'true');
        mdvMapConfig.add('trips.jsonServerURL', absoluteServerPath.efa + '/vip2/XSLT_TRIP_REQUEST2');
		mdvMapConfig.add('defaultScale', defaultScaleParking);
		mdvMapConfig.add('xCenterReal', mapCenterX);
		mdvMapConfig.add('yCenterReal', mapCenterY);
		mdvMapConfig.add('mapName', nameMap);
		mdvMapConfig.add('block', '100');
		mdvMapConfig.add('language', mapLanguage);
		mdvMapConfig.add('zoomOnDoubleClick', 'true');
		mdvMapConfig.add('cursorMove', imgPath + 'grabbing.cur');
		//mdvMapConfig.add('useMagnifyGlass', 'true');
		mdvMapConfig.add('useBubbleOverflowForEFAInfo', 'true');
	}
	else {
		if (name=='ortho') {
			// satellite map configuration
			mdvOrthoMapConfig.add('serverURL', absoluteServerPath.mapTiles + satelliteTiles); 
			mdvOrthoMapConfig.add('efaURL', absoluteServerPath.efa + '/liteVipVienna/XSLT_COORD_REQUEST');
			mdvOrthoMapConfig.add('transparentImg', imgPath + 'transparent.gif');
			mdvOrthoMapConfig.add('imagePath', imgPath);
			mdvOrthoMapConfig.add('network', 'aut');
			mdvOrthoMapConfig.add('trips.useJsonForPath', 'true');
            mdvOrthoMapConfig.add('trips.jsonServerURL', absoluteServerPath.efa + '/vip2/XSLT_TRIP_REQUEST2');
			mdvOrthoMapConfig.add('defaultScale', defaultScaleMap);	
			mdvOrthoMapConfig.add('xCenterReal', mapCenterX);
			mdvOrthoMapConfig.add('yCenterReal', mapCenterY);
			mdvOrthoMapConfig.add('mapName', nameMap);
			mdvOrthoMapConfig.add('fileType', '.jpg');
			mdvOrthoMapConfig.add('block', '100');
			mdvOrthoMapConfig.add('zoomOnDoubleClick', 'true');
			mdvOrthoMapConfig.add('language', mapLanguage);
			mdvOrthoMapConfig.add('useMagnifyGlass', 'true');
			mdvOrthoMapConfig.add('cursorMove', imgPath + 'grabbing.cur');
			mdvOrthoMapConfig.add('useBubbleForEFAInfo', 'true');
			mdvOrthoMapConfig.add('useBubbleOverflowForEFAInfo', 'true');
			mdvOrthoMapConfig.add('useBubblePinForEFAInfo', 'true');
			mdvOrthoMapConfig.add('info.stop.size.width', '300');
			mdvOrthoMapConfig.add('info.stop.size.height', '200');
			mdvOrthoMapConfig.add('info.stop.only', 'true');
			mdvOrthoMapConfig.add('info.poi.size.width', '300');
			mdvOrthoMapConfig.add('info.poi.size.height', '95');
			mdvOrthoMapConfig.add('poiArea', 'true');
			
			// satellite mini map configuration
			mdvMiniOrthoConfig.add('serverURL', absoluteServerPath.mapTiles + satelliteMiniTiles);
			mdvMiniOrthoConfig.add('efaURL', absoluteServerPath.efa + '/liteVipVienna/XSLT_COORD_REQUEST');
			mdvMiniOrthoConfig.add('transparentImg', imgPath + 'transparent.gif');
			mdvMiniOrthoConfig.add('network', 'aut');
			mdvMiniOrthoConfig.add('defaultScale', defaultScaleMap);	
			mdvMiniOrthoConfig.add('xCenterReal', mapCenterX);
			mdvMiniOrthoConfig.add('yCenterReal', mapCenterY);
			mdvMiniOrthoConfig.add('mapName', nameMap);
			mdvMiniOrthoConfig.add('fileType', '.jpg');
			mdvMiniOrthoConfig.add('block', '100');
			mdvMiniOrthoConfig.add('zoomOnDoubleClick', 'true');	
			mdvMiniOrthoConfig.add('cursorMove', imgPath + 'grabbing.cur');
			
			// configuration of output map
			mdvOrthoMapConfig.add('tripURL', absoluteServerPath.efa + '/liteVipVienna/XSLT_TRIP_REQUEST2');
			mdvOrthoMapConfig.add('trips.marker.size.height', '200');
			mdvOrthoMapConfig.add('trips.marker.size.width', '300');
			mdvOrthoMapConfig.add('trips.polyline.size.height', '65');
			mdvOrthoMapConfig.add('trips.polyline.size.width', '300');
			mdvOrthoMapConfig.add('trips.polyline.opacity', '0.5');
			mdvOrthoMapConfig.add('trips.polyline.weight', '4');
			mdvOrthoMapConfig.add('motColour_0', '#0000FF');        // nicht belegt
			mdvOrthoMapConfig.add('motColour_1', '#FF0000');        // ubahn
			mdvOrthoMapConfig.add('motColour_2', '#00797A');        // s-bahn
			mdvOrthoMapConfig.add('motColour_3', '#F08D0D');        // bus
			mdvOrthoMapConfig.add('motColour_4', '#87602E');        // tram
			mdvOrthoMapConfig.add('motColour_5', '#0000FF');        // nicht belegt
			mdvOrthoMapConfig.add('motColour_6', '#0000FF');        // train
			mdvOrthoMapConfig.add('motColour_7', '#0000FF');        // nicht belegt
			mdvOrthoMapConfig.add('motColour_8', '#0000FF');        // anruf sammeltaxi
			mdvOrthoMapConfig.add('motColour_9', '#0000FF');        // nicht belegt
			mdvOrthoMapConfig.add('motColour_10', '#0000FF');       // nicht belegt
			mdvOrthoMapConfig.add('motColour_11', '#0000FF');       // nicht belegt
			mdvOrthoMapConfig.add('motColour_12', '#0000FF');       // nicht belegt
			mdvOrthoMapConfig.add('motColour_99', '#37EE37');       // fussweg
			mdvOrthoMapConfig.add('motColour_100', '#37EE37');     	// fussweg
			mdvOrthoMapConfig.add('motColour_101', '#009B00');      // fahrrad (bike & ride)    
			mdvOrthoMapConfig.add('motColour_102', '#009B00');      // fahrrad (take bike along)
			mdvOrthoMapConfig.add('motColour_103', '#08308A');      // pkw (kiss & ride)
			mdvOrthoMapConfig.add('motColour_104', '#08308A');      // pkw (park & ride)
			mdvOrthoMapConfig.add('motColour_105', '#0000FF');      // taxi 
			mdvOrthoMapConfig.add('motColour_106', '#08308A');      // pkw (monomodal)
			mdvOrthoMapConfig.add('motColour_107', '#009B00');      // fahrrad (monomodal)
			mdvOrthoMapConfig.add('motColour_108', '#0000FF');
		}
		else {
			// map configuration
			mdvMapConfig.add('serverURL', absoluteServerPath.mapTiles + mapTiles); 
			mdvMapConfig.add('efaURL', absoluteServerPath.efa + '/liteVipVienna/XSLT_COORD_REQUEST');
            mdvMapConfig.add('transparentImg', imgPath + 'transparent.gif');
			mdvMapConfig.add('imagePath', imgPath);
			mdvMapConfig.add('network', 'aut');
			mdvMapConfig.add('trips.useJsonForPath', 'true');
            mdvMapConfig.add('trips.jsonServerURL', absoluteServerPath.efa + '/vip2/XSLT_TRIP_REQUEST2');
			mdvMapConfig.add('defaultScale', defaultScaleMap);	
			mdvMapConfig.add('xCenterReal', mapCenterX);
			mdvMapConfig.add('yCenterReal', mapCenterY);
			mdvMapConfig.add('mapName', nameMap);
			mdvMapConfig.add('block', '100');;
			mdvMapConfig.add('zoomOnDoubleClick', 'true');
			mdvMapConfig.add('language', mapLanguage);
			mdvMapConfig.add('useMagnifyGlass', 'true');
			//mdvMapConfig.add('useCanvasRenderer', 'true');
			mdvMapConfig.add('cursorMove', imgPath + 'grabbing.cur');
			mdvMapConfig.add('useBubbleForEFAInfo', 'true');
			mdvMapConfig.add('useBubbleOverflowForEFAInfo', 'true');
			mdvMapConfig.add('useBubblePinForEFAInfo', 'true');
			mdvMapConfig.add('info.stop.size.width', '300');
			mdvMapConfig.add('info.stop.size.height', '200');
			mdvMapConfig.add('info.stop.only', 'true');
			mdvMapConfig.add('info.poi.size.width', '300');
			mdvMapConfig.add('info.poi.size.height', '95');
			mdvMapConfig.add('poiArea', 'true');
			
			// configuration of output map
			mdvMapConfig.add('tripURL', absoluteServerPath.efa + '/liteVipVienna/XSLT_TRIP_REQUEST2');
			mdvMapConfig.add('trips.marker.size.height', '200');
			mdvMapConfig.add('trips.marker.size.width', '300');
			mdvMapConfig.add('trips.polyline.size.height', '65');
			mdvMapConfig.add('trips.polyline.size.width', '300');
			mdvMapConfig.add('trips.polyline.opacity', '0.5');
			mdvMapConfig.add('trips.polyline.weight', '4');
			mdvMapConfig.add('motColour_0', '#0000FF');     // nicht belegt
			mdvMapConfig.add('motColour_1', '#FF0000');     // ubahn
			mdvMapConfig.add('motColour_2', '#00797A');     // s-bahn
			mdvMapConfig.add('motColour_3', '#F08D0D');     // bus
			mdvMapConfig.add('motColour_4', '#87602E');     // tram
			mdvMapConfig.add('motColour_5', '#0000FF');     // nicht belegt
			mdvMapConfig.add('motColour_6', '#0000FF');     // train
			mdvMapConfig.add('motColour_7', '#0000FF');     // nicht belegt
			mdvMapConfig.add('motColour_8', '#0000FF');     // anruf sammeltaxi
			mdvMapConfig.add('motColour_9', '#0000FF');     // nicht belegt
			mdvMapConfig.add('motColour_10', '#0000FF');    // nicht belegt
			mdvMapConfig.add('motColour_11', '#0000FF');    // nicht belegt
			mdvMapConfig.add('motColour_12', '#0000FF');    // nicht belegt
			mdvMapConfig.add('motColour_99', '#37EE37');    // fussweg
			mdvMapConfig.add('motColour_100', '#37EE37');   // fussweg
			mdvMapConfig.add('motColour_101', '#009B00');   // fahrrad (bike & ride)    
			mdvMapConfig.add('motColour_102', '#009B00');   // fahrrad (take bike along)
			mdvMapConfig.add('motColour_103', '#08308A');   // pkw (kiss & ride)
			mdvMapConfig.add('motColour_104', '#08308A');   // pkw (park & ride)
			mdvMapConfig.add('motColour_105', '#0000FF');   // taxi 
			mdvMapConfig.add('motColour_106', '#08308A');   // pkw (monomodal)
			mdvMapConfig.add('motColour_107', '#009B00');   // fahrrad (monomodal)
			mdvMapConfig.add('motColour_108', '#0000FF');
			
			// mini map configuration
			mdvMiniMapConfig.add('serverURL', absoluteServerPath.mapTiles + miniMapTiles);
			mdvMiniMapConfig.add('efaURL', absoluteServerPath.efa + '/liteVipVienna/XSLT_COORD_REQUEST');
			mdvMiniMapConfig.add('transparentImg', imgPath + 'transparent.gif');
			mdvMiniMapConfig.add('network', 'vor');
			mdvMiniMapConfig.add('defaultScale', defaultScaleMap);	
			mdvMiniMapConfig.add('xCenterReal', mapCenterX);
			mdvMiniMapConfig.add('yCenterReal', mapCenterY);
			mdvMiniMapConfig.add('mapName', nameMap);
			mdvMiniMapConfig.add('block', '100');
			mdvMiniMapConfig.add('zoomOnDoubleClick', 'true');	
			mdvMiniMapConfig.add('cursorMove', imgPath + 'grabbing.cur');
		}
		
		// coordinate reduction
		reductionList = [
		  { maxScale:   2500, epsilon:   1.0 },
		  { maxScale:   5200, epsilon:   1.5 },
		  { maxScale:  11000, epsilon:   2.5 },		  
		  { maxScale:  23000, epsilon:   5.0 },
		  { maxScale:  50000, epsilon:  10.0 },
		  { maxScale: 100000, epsilon:  20.0 },
		  { maxScale: 210000, epsilon: 100.0 }
		];
	}
}


// ==================================================================
// Common Map Functionality
// ==================================================================

// This function overwrite the setHeight function as it is not necessary for this interface
function setHeight () {}


// This function creates the layout specific map overlays.
// Parameter: 	target - map 
function createMapOverlays (target) {	
	if (currentPage == 'parkingSituation') {
		// Einkaufsstraße einer Parkraumbewirtschafteten Zone
		if (mapTilesParkingES !='') {
			target.ESOverlay = target.mdvMap.createOverlay('ESOverlay', mapTilesParkingES);
			target.mdvMap.addOverlay(target.ESOverlay);
		}
		// Parkraumbewirtschaftete Zone
		if (mapTilesParkingZone !='') {
			target.ZoneOverlay = target.mdvMap.createOverlay('ZoneOverlay', mapTilesParkingZone);
			target.mdvMap.addOverlay(target.ZoneOverlay);
		}
	}
}


// Toggle overlay (is works only if the magnify glas option is deactivated for map)
// Parameter:	id - id of the overlay
//				state [true|false] - display/hide overlay
function toggleOverlay(id, state) {
    var overlay =  mdvMap[id];
    if (overlay) {
        overlay.setActive(state);
        mdvMap.mdvMap.update();
    }
}


// ==================================================================
// Common Journey Planner Functionality
// ==================================================================

// Reset button
function resetButton (language, currentPage) {
	location.href='XSLT_TRIP_REQUEST2?language=' + language + '&itdLPxx_currentPage=' + currentPage;
}

// Creates rectangle zoom functionality
MDVMapHelper.prototype.createZoomRectangle = function () {
	if (enableZoomRect == 'true') {
		this.rectZoom = new MDVRectZoom(this.mdvMap, {
			opacity: 0.3,
			border: '2px solid #407ABA',
			useButton: true,
			buttonImg: 'panBtn.gif',
			buttonImgOver: 'panBtn.gif',
			buttonImgActive: 'panBtn.gif',
			buttonPosLeft: '30px',
			buttonPosTop: '280px',
            title: rectZoomTitle,
            alt: rectZoomTitle,
            titleActive: rectZoomTitleActive,
            altActive: rectZoomTitleActive
		});
	}
}


// ==================================================================
// Advanced Options
// ==================================================================

// This function includes /excludes the CAT airport shuttle
function toggleCAT (state) {
	if (document.forms[0].lineRestriction) {
		if (state)
			document.forms[0].lineRestriction.value = '400';
		else 
			document.forms[0].lineRestriction.value = '402';
	}
}

// This function includes/excludes the commuter train if train is included/excluded
function toggleCommuterTrain (state) {
	if (document.getElementById('MOTCommuterTrain')) {
		if (state) 
			document.getElementById('MOTCommuterTrain').name = 'inclMOT_1';
		else 
			document.getElementById('MOTCommuterTrain').name = 'MOTCommuterTrain';
	}
}


// ==================================================================
// Result Screen
// ==================================================================

// This function toggles the detailview of a Journey, displays the
// journey on the map and closes the detailview of all other
// journeys.
function toggleDetailview(index,noOfRoutes,sessionID,requestID){
	if (noOfRoutes == 1 && document.getElementById('detail_1')) {
		document.getElementById('detail_1').style.display='block';
		// show the journey on the map
		try { 
			mdvMap.displayJourney(sessionID, requestID, index);
			// remove park and ride symbols
			if(mdvMap.markerLayer) 
				mdvMap.parkAndRideLayer.removeAllMarkers();
		}
		catch (e){}
		
		// display wizard button
		if (document.getElementById('wizard'))
			document.getElementById('wizard').style.display='inline';
			
		// store open journey 
		if(document.getElementById('itdLPxx_displayJourney'))
			document.getElementById('itdLPxx_displayJourney').value = index;
	}
	else if (document.getElementById('detail_' + index) && document.getElementById('detail_' + index).style.display != 'block') {
		//close all detailviews
		for (var i=1; i <= noOfRoutes; i++) {
			if(document.getElementById('detail_' + i) && i != index) {
				document.getElementById('detail_' + i).style.display = 'none';
				document.getElementById('closeDetailButton_' + i).style.display = 'none';
				document.getElementById('openDetailButton_' + i).style.display = 'inline';
			}
		}
		// open selected detailview
		document.getElementById('detail_' + index).style.display = 'block';
		if (document.getElementById('closeDetailButton_' + index))
			document.getElementById('closeDetailButton_' + index).style.display = 'inline';
		if (document.getElementById('openDetailButton_' + index))
			document.getElementById('openDetailButton_' + index).style.display = 'none';
		// show the journey on the map
		try { 
			mdvMap.displayJourney(sessionID, requestID, index);
			// remove park and ride symbols
			if(mdvMap.markerLayer) 
				mdvMap.parkAndRideLayer.removeAllMarkers();
		}
		catch (e){}
		
		// display wizard button
		if (document.getElementById('wizard'))
			document.getElementById('wizard').style.display='inline';
			
		// store open journey 
		if(document.getElementById('itdLPxx_displayJourney'))
			document.getElementById('itdLPxx_displayJourney').value = index;
	}
	// close detailview
	else {
		if (document.getElementById('detail_' + index) ) {
			document.getElementById('detail_' + index).style.display='none';
			document.getElementById('closeDetailButton_' + index).style.display='none';
			document.getElementById('openDetailButton_' + index).style.display='inline';
		}
		// clear the map
		try {
			mdvMap.clearJourney();
		}
		catch (e) {}
		
		// hide wizard button
		if (document.getElementById('wizard'))
			document.getElementById('wizard').style.display='none';
			
		// store open journey 
		if(document.getElementById('itdLPxx_displayJourney'))
			document.getElementById('itdLPxx_displayJourney').value = '';	
	}
}


// ==================================================================
// Cycling Planner
// ==================================================================

function toggleCyclingRouteOption (routeType, active) {
	// activate selected route type an switch on corresponding description on the left hand side
	if (active) {
		if (routeType == 'leisureRoute') {
			document.getElementById('speedFactorBicycle').value = '100';
			document.getElementById('myRouteInfrastructure').checked = 'checked'; //genParamBicycleBool1
			document.getElementById('myRouteCyclingTracks').checked = 'checked'; //genParamBicycleBool2
			document.getElementById('myRouteNoElevation').checked = 'checked';
			document.forms[0].itdLPxx_individualRoute.value = '0';
		}
		else if (routeType == 'advancedRoute') {
			document.getElementById('speedFactorBicycle').value = '133';
			document.getElementById('myRouteInfrastructure').checked = 'checked';
			document.getElementById('myRouteCyclingTracks').checked = '';
			document.getElementById('myRouteNoElevation').checked = 'checked';
			document.forms[0].itdLPxx_individualRoute.value = '0';
		}
		else if (routeType == 'individualRoute') {
			document.forms[0].itdLPxx_individualRoute.value = '1';
			// plone
		    if (absoluteServerPath.mapTiles!='' && typeof mdv.its.toggleCyclingOptions === 'function') {
		        mdv.its.toggleCyclingOptions('advancedOptions_cycle_1');
			}
		}
	}
}


// This function toggles the cycling route option.
function toggleCyclingRouteType (routeType, active) {
	// activate selected route type 
	if (active) {
		if (routeType == 'leisureRoute') {
			document.getElementById('speedFactorBicycle').value = '100';
			document.getElementById('myRouteInfrastructure').value = 'true'; //genParamBicycleBool1
			document.getElementById('myRouteCyclingTracks').value = 'true'; //genParamBicycleBool2
			document.getElementById('useElevationData').value = 'true';
		}
		else if (routeType == 'advancedRoute') {
			document.getElementById('speedFactorBicycle').value = '133';
			document.getElementById('myRouteInfrastructure').value = 'true';
			document.getElementById('myRouteCyclingTracks').value = 'false';
			document.getElementById('useElevationData').value = 'true';
		}
	}
}


// This function toggles the cycling mode options links.
function toggleCyclingModeOption (cyclingMode, active) {
	// display options link
	if (active && (cyclingMode == 'takeBikeAlong' || cyclingMode == 'bikeAndRide')) {
		document.getElementById('cyclingOptionsLink').style.display = 'block';
		// display/hide additional otpions for bike & ride
		if (cyclingMode == 'bikeAndRide') { 
			document.forms[0].execInst.value= 'verifyOnly';
			toggleBikeAndRideOptions(true);
		}
		else {
			toggleBikeAndRideOptions(false);
			document.getElementById('bikeTakeAlong').value = '1';
		}
	}
	// hide options links
	else {
		document.getElementById('cyclingOptionsLink').style.display = 'none';
	}		
}


// ==================================================================
// Park and Ride
// ==================================================================

 // This function selects a park and ride parking
function submitParking (id, mode) {
	// stop of green zone
	if (mode == 'stop')
		document.forms[0].selPAStop.value = id;
	// parking
	else if (document.forms[0].selPA) 
		document.forms[0].selPA.value = id;
	// parking after monomodal journey 
	if (currentPage == 'journeyPlanner') {
		document.forms[0].action = '/park-and-ride';
		document.forms[0].command.value = 'mono2PR';
		document.forms[0].paID.value = id;
		document.forms[0].maxMonoTWoPT.value = '15';
		document.forms[0].itdLPxx_odvIdentified.value = '1';
		document.forms[0].itdLPxx_currentPage.value = 'parkAndRidePlanner';
		document.forms[0].direct.value = '1';
	}
	document.forms[0].execInst.value = '';
	document.forms[0].submit();
}







