function checkRouteLink(){
//Check RouteLink
	if(GET("start") != 'undefined' && GET("end") != 'undefined' 
		&& GET("pref") != 'undefined' && GET("lang") != 'undefined'){
		
			var start = GET("start");
			var end = GET("end");
			
			var viapos= new Array();
			var vialonlat= new Array();
			var tmp ;
			
			if (GET("noTollways") != 'undefined'){
				if (GET("noTollways") == 'true'){
					document.getElementById("cbTollway").checked = true;
				}else{
					document.getElementById("cbTollway").checked = false;
				}	
			} 
			if (GET("noMotorways") != 'undefined'){
				if (GET("noMotorways") == 'true'){
					document.getElementById("cbMotorway").checked = true;
				}else{
					document.getElementById("cbMotorway").checked = false;
				}	
			}
			
			routeready = true;
		
			var vias=GET('via');
			if (vias!= 'undefined' ){
				var viaPoints = vias.split(' ');
				var cVia = viaPoints.length;
				viaStorage = [];
				countVia=0;
				for (var i=0; i<cVia-1; i++){
					addViaCode();
					viapos.push(viaPoints[i].split(','));
					vialonlat.push(new OpenLayers.LonLat(viapos[i][0], viapos[i][1]).transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")));
					document.getElementById('tfViaSearch'+ (i+1)).value = 'Pos@: '+ viapos[i][0] + ' '+viapos[i][1];
					bounds = new OpenLayers.Bounds(vialonlat[i].lon,vialonlat[i].lat,getEdgeLonLat(vialonlat[i]).lon,getEdgeLonLat(vialonlat[i]).lat);
					viaPoint = new OpenLayers.Feature.Vector(bounds.toGeometry(),{icon:markerIconVia});
					viaPoint.bounds = bounds;
					viaPoint.name = 'Via';
					viaPoint.myId = i+1;
					viaPoint.style = viaPointStyle;
					viaPoint.lonlat = new OpenLayers.LonLat(vialonlat[i].lon,vialonlat[i].lat);
					viaPoint.marker = new OpenLayers.Marker(vialonlat[i], viaPoint.data.icon.clone(),(i+1),(i+1));
					lyRouteFeatures.addFeatures([viaPoint]);
					lyMarkers.addMarker(viaPoint.marker);
					viaStorage.push(viaPoint);
				}	
			}

			var startpos = start.split(',');
			var startlonlat = new OpenLayers.LonLat(startpos[0],startpos[1]).transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));				
			var endpos = end.split(',');
			var endlonlat = new OpenLayers.LonLat(endpos[0],endpos[1]).transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));
			
			document.getElementById('tfStartSearch').value = 'Pos@: ' + startpos[0] + ' ' + startpos[1];
			document.getElementById('tfEndSearch').value = 'Pos@: ' + endpos[0] + ' ' + endpos[1];
			
			bounds = new OpenLayers.Bounds(startlonlat.lon,startlonlat.lat,getEdgeLonLat(startlonlat).lon,getEdgeLonLat(startlonlat).lat);
			startPoint = new OpenLayers.Feature.Vector(bounds.toGeometry(),{icon:markerIconStart});
			startPoint.bounds = bounds;
			startPoint.name = 'Start';
			startPoint.myId = '';
			startPoint.style = startPointStyle;
			startPoint.lonlat = new OpenLayers.LonLat(startlonlat.lon,startlonlat.lat);
			startPoint.marker = new OpenLayers.Marker(startlonlat, startPoint.data.icon.clone());
			startPoint.lonlat = new OpenLayers.LonLat(startlonlat.lon,startlonlat.lat);
			lyMarkers.addMarker(startPoint.marker);
			lyRouteFeatures.addFeatures([startPoint]);
			startExists = true;
			
			
			bounds = new OpenLayers.Bounds(endlonlat.lon,endlonlat.lat,getEdgeLonLat(endlonlat).lon,getEdgeLonLat(endlonlat).lat);
			endPoint = new OpenLayers.Feature.Vector(bounds.toGeometry(),{icon:markerIconEnd});
			endPoint.bounds = bounds;
			endPoint.name = 'End';
			endPoint.myId = '';
			endPoint.style = endPointStyle;
			endPoint.lonlat = new OpenLayers.LonLat(endlonlat.lon,endlonlat.lat);
			endPoint.marker = new OpenLayers.Marker(endlonlat, endPoint.data.icon.clone());
			endPoint.lonlat = new OpenLayers.LonLat(endlonlat.lon,endlonlat.lat);
			lyMarkers.addMarker(endPoint.marker);
			lyRouteFeatures.addFeatures([endPoint]);
			endExists = true;
			
			checkGET();
			determineRouteLink(GET("pref"),GET("lang"));
		
			map.setCenter(startlonlat, 14);
			//document.getElementById('rbMap').click();
			map.div.oncontextmenu = function noContextMenu(e) {return false;};
	}else if((GET("start") != 'undefined')&&(startExists == false)){
		checkGET();
		var start = GET("start");
		var startpos = start.split(',');
		var startlonlat = new OpenLayers.LonLat(startpos[0],startpos[1]).transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));
		document.getElementById('tfStartSearch').value = 'Pos@: '+start;
		document.getElementById('tfEndSearch').value = '';

		bounds = new OpenLayers.Bounds(startlonlat.lon,startlonlat.lat,getEdgeLonLat(startlonlat).lon,getEdgeLonLat(startlonlat).lat);
		startPoint = new OpenLayers.Feature.Vector(bounds.toGeometry(),{icon:markerIconStart});
		startPoint.bounds = bounds;
		startPoint.name = 'Start';
		startPoint.myId = '';
		startPoint.style = startPointStyle;
		startPoint.lonlat = new OpenLayers.LonLat(startlonlat.lon,startlonlat.lat);
		startPoint.marker = new OpenLayers.Marker(startlonlat, startPoint.data.icon.clone());
		startPoint.lonlat = new OpenLayers.LonLat(startlonlat.lon,startlonlat.lat);
		lyMarkers.addMarker(startPoint.marker);
		lyRouteFeatures.addFeatures([startPoint]);
		startExists = true;
	}else if((GET("end") != 'undefined')&&(endExists ==false)){
		checkGET();
		var end = GET("end");
		var endpos = end.split(',');
		var endlonlat = new OpenLayers.LonLat(endpos[0],endpos[1]).transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));
		document.getElementById('tfEndSearch').value = 'Pos@: '+end;
		document.getElementById('tfStartSearch').value = '';
		
		bounds = new OpenLayers.Bounds(endlonlat.lon,endlonlat.lat,getEdgeLonLat(endlonlat).lon,getEdgeLonLat(endlonlat).lat);
		endPoint = new OpenLayers.Feature.Vector(bounds.toGeometry(),{icon:markerIconEnd});
		endPoint.bounds = bounds;
		endPoint.name = 'End';
		endPoint.myId = '';
		endPoint.style = endPointStyle;
		endPoint.lonlat = new OpenLayers.LonLat(endlonlat.lon,endlonlat.lat);
		endPoint.marker = new OpenLayers.Marker(endlonlat, endPoint.data.icon.clone());
		endPoint.lonlat = new OpenLayers.LonLat(endlonlat.lon,endlonlat.lat);
		lyMarkers.addMarker(endPoint.marker);
		lyRouteFeatures.addFeatures([endPoint]);
		endExists = true;
	}
	
	//Check PositionLink
	if(GET("position") != 'undefined' && GET("zoom") != 'undefined'){
		var position = GET("position");
		var position = position.split(',');
		var positionlonlat = new OpenLayers.LonLat(position[0],position[1]);
		lonlatzoom(positionlonlat, GET("zoom"));
		checkGET();
	}
	lyRouteFeatures.redraw();
}	
function checkGET(){
	if(GET("pref") != 'undefined'){
		var pref = GET("pref");
		//document.getElementsByName("r1")[0].value
//		if(pref == 'Fastest'){document.getElementsByName("r1")[0].value = 0;}
//		if(pref == 'Shortest'){document.getElementsByName("r1")[0].value = 1;}
//		if(pref == 'Pedestrian'){document.getElementsByName("r1")[0].value = 2;}
//		if(pref == 'Bicycle'){document.getElementsByName("r1")[0].value = 3;}
//		if(pref == 'BicycleMTB'){document.getElementsByName("r1")[0].value = 4;}
//		if(pref == 'BicycleRacer'){document.getElementsByName("r1")[0].value = 5;}
//		if(pref == 'BicycleSafety'){document.getElementsByName("r1")[0].value = 3;}

		if(pref == 'Fastest'){RadioButton("r1",0,3); document.Testform.selectRoutePref.selectedIndex = 0;}
		if(pref == 'Shortest'){RadioButton("r1",0,3); document.Testform.selectRoutePref.selectedIndex = 1;}
		if(pref == 'Pedestrian'){RadioButton("r1",1,3);}
		if(pref == 'Bicycle'){RadioButton("r1",2,3); document.Testform.selectRoutePref.selectedIndex = 0;}
		if(pref == 'BicycleMTB'){RadioButton("r1",2,3); document.Testform.selectRoutePref.selectedIndex = 1;}
		if(pref == 'BicycleRacer'){RadioButton("r1",2,3); document.Testform.selectRoutePref.selectedIndex = 2;}
		if(pref == 'BicycleSafety'){RadioButton("r1",2,3); document.Testform.selectRoutePref.selectedIndex = 3;}
		
		//if(pref == 'Fastest'){document.getElementById("selectRoutePref").selectedIndex = 0;}
		//if(pref == 'Shortest'){document.getElementById("selectRoutePref").selectedIndex = 1;}
		//if(pref == 'Pedestrian'){document.getElementById("selectRoutePref").selectedIndex = 2;}
		//if(pref == 'Bicycle'){document.getElementById("selectRoutePref").selectedIndex = 3;}
	}
	if(GET("lang") != 'undefined'){
		var lang = GET("lang");
		if(lang == 'en'){document.getElementById("selectLanguage").selectedIndex = 0;}
		if(lang == 'de'){document.getElementById("selectLanguage").selectedIndex = 1;}
		if(lang == 'fr'){document.getElementById("selectLanguage").selectedIndex = 2;}
		if(lang == 'es'){document.getElementById("selectLanguage").selectedIndex = 3;}
		if(lang == 'it'){document.getElementById("selectLanguage").selectedIndex = 4;}
	}
}
