var map=null;var miniMap=null;var points=new Array();var markers=new Array();var markersContinent=new Array();var markersCountries=new Array();var polylines=new Array();var iconFrom=null;var iconFromActive=null;var iconTo=null;var iconToActive=null;var iconStation=null;var iconStationActive=null;var iconPlace=null;var iconCountry=null;var iconContinent=null;var listIsActive=0;var locationType="";var wheelEvent="";var id_more="";var routeJs="";var conJs="";var numPicLoaded=null;var pointMouseMove=null;var countryOnFocus=null;var countryZoom=0;var zoomPoint=null;var zoomFactor=null;var markerIsActiveHidden=null;var wheelEvent=0;var mapIsLoading=0;var mini=new GOverviewMapControl(new GSize(100,100));function loadMapSingle(){imagePreload("/framework/graphics/bm/icon_marker_start_active.png","/framework/graphics/bm/icon_marker_end_active.png","/framework/graphics/bm/icon_marker_station_active.png");if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map"));map.setCenter(new GLatLng(0,0),0);map.addControl(mini);mini.hide(true);loadIcons()}locationType=document.getElementsByName("travelroute_type")[0].value;if(locationType=="place"){if(document.getElementsByName("travelroute_location_place_point")[0]){var locationStringFrom=document.getElementsByName("travelroute_location_place_point")[0].value;var pointFrom=locationStringFrom.split(";");var point=new GLatLng(pointFrom[0],pointFrom[1]);setNewMarker(point,pointFrom[2],pointFrom[3],pointFrom[4])}}else{if(document.getElementsByName("travelroute_location_from_point")[0]){var locationStringFrom=document.getElementsByName("travelroute_location_from_point")[0].value;var pointFrom=locationStringFrom.split(";");var point=new GLatLng(pointFrom[0],pointFrom[1]);setNewMarker(point,pointFrom[2],pointFrom[3],pointFrom[4])}if(document.getElementsByName("travelroute_location_to_point")[0]){var locationStringTo=document.getElementsByName("travelroute_location_to_point")[0].value;var pointTo=locationStringTo.split(";");var point=new GLatLng(pointTo[0],pointTo[1]);setNewMarker(point,pointTo[2],pointTo[3],pointTo[4])}if(document.getElementsByName("travelroute_location_to_more_point")[0]){var locationStringTo=document.getElementsByName("travelroute_location_to_more_point")[0].value;var pointMoreTo=locationStringTo.split("|");pointMoreTo.pop();for(var i in pointMoreTo){if(pointMoreTo[i]){var pointTo=pointMoreTo[i].split(";");var point=new GLatLng(pointTo[0],pointTo[1]);setNewMarker(point,pointTo[2],pointTo[3],pointTo[4])}}}}setMapZoomAndCenterToFitMarkers();routeJs=eval("("+document.getElementsByName("routeJs")[0].value+")")}function loadIcons(){var a=true;if(window.clipboardData&&document.compatMode){a=window.XMLHttpRequest?true:false}else{if(window.clipboardData){a=false;if(!document.createDocumentFragment){a=false}}else{if(document.doctype&&!window.print){a=false}}}iconFrom=new GIcon();iconFrom.image="/framework/graphics/bm/icon_marker_start.png";iconFrom.shadow="/framework/graphics/bm/icon_marker_start_shadow.png";iconFrom.iconSize=new GSize(20,46);iconFrom.shadowSize=new GSize(39,28);iconFrom.iconAnchor=new GPoint(10,0);iconFromActive=new GIcon();iconFromActive.image="/framework/graphics/bm/icon_marker_start_active.png";iconFromActive.shadow="/framework/graphics/bm/icon_marker_start_shadow.png";iconFromActive.iconSize=new GSize(20,46);iconFromActive.shadowSize=new GSize(39,28);iconFromActive.iconAnchor=new GPoint(10,0);iconTo=new GIcon();iconTo.image="/framework/graphics/bm/icon_marker_end.png";iconTo.shadow="/framework/graphics/bm/icon_marker_end_shadow.png";iconTo.iconSize=new GSize(27,34);iconTo.shadowSize=new GSize(45,34);iconTo.iconAnchor=new GPoint(27,34);iconToActive=new GIcon();iconToActive.image="/framework/graphics/bm/icon_marker_end_active.png";iconToActive.shadow="/framework/graphics/bm/icon_marker_end_shadow.png";iconToActive.iconSize=new GSize(27,34);iconToActive.shadowSize=new GSize(45,34);iconToActive.iconAnchor=new GPoint(27,34);iconStation=new GIcon();iconStation.image="/framework/graphics/bm/icon_marker_station.png";iconStation.shadow="/framework/graphics/bm/icon_marker_station_shadow.png";iconStation.iconSize=new GSize(37,29);iconStation.shadowSize=new GSize(52,29);iconStation.iconAnchor=new GPoint(18,18);iconStation.infoWindowAnchor=new GPoint(37,0);iconStationActive=new GIcon();iconStationActive.image="/framework/graphics/bm/icon_marker_station_active.png";iconStationActive.shadow="/framework/graphics/bm/icon_marker_station_shadow.png";iconStationActive.iconSize=new GSize(37,29);iconStationActive.shadowSize=new GSize(52,29);iconStationActive.iconAnchor=new GPoint(18,18);iconContinent=new GIcon();iconContinent.image="/framework/graphics/bm/icon_marker_continent.png";iconContinent.shadow="/framework/graphics/bm/icon_marker_continent_shadow.png";iconContinent.iconSize=new GSize(52,52);iconContinent.shadowSize=new GSize(79,52);iconContinent.iconAnchor=new GPoint(26,26);iconCountry=new GIcon();iconCountry.image="/framework/graphics/bm/icon_marker_country.png";iconCountry.shadow="/framework/graphics/bm/icon_marker_country_shadow.png";iconCountry.iconSize=new GSize(16,27);iconCountry.shadowSize=new GSize(30,27);iconCountry.iconAnchor=new GPoint(0,27);iconCountryBig=new GIcon();iconCountryBig.image="/framework/graphics/bm/icon_marker_country_big.png";iconCountryBig.shadow="/framework/graphics/bm/icon_marker_country_big_shadow.png";iconCountryBig.iconSize=new GSize(30,53);iconCountryBig.shadowSize=new GSize(57,53);iconCountryBig.iconAnchor=new GPoint(0,53);iconPlace=new GIcon();iconPlace.image="/framework/graphics/bm/icon_marker_place_small.png";iconPlace.shadow="/framework/graphics/bm/icon_marker_place_small_shadow.png";iconPlace.iconSize=new GSize(26,20);iconPlace.shadowSize=new GSize(37,20);iconPlace.iconAnchor=new GPoint(13,10);iconPlace.infoWindowAnchor=new GPoint(26,0);if(a!=true){iconFrom.image="/framework/graphics/bm/icon_marker_start.gif";iconFromActive.image="/framework/graphics/bm/icon_marker_start_active.gif";iconTo.image="/framework/graphics/bm/icon_marker_end.gif";iconToActive.image="/framework/graphics/bm/icon_marker_end_active.gif";iconStation.image="/framework/graphics/bm/icon_marker_station.gif";iconStationActive.image="/framework/graphics/bm/icon_marker_station_active.gif";iconContinent.image="/framework/graphics/bm/icon_marker_continent.gif";iconCountry.image="/framework/graphics/bm/icon_marker_country.gif";iconCountryBig.image="/framework/graphics/bm/icon_marker_country_big.gif";iconPlace.image="/framework/graphics/bm/icon_marker_place_small.gif"}}function setMapZoomAndCenterToFitMarkers(){if(points.length>0){map.setCenter(new GLatLng(points[0][0].lat(),points[0][0].lng()),14);var bounds=map.getBounds();var n=0.04;for(var i=0;i<points.length;i++){var lat=points[i][0].lat();var lng=points[i][0].lng();if(points[i][2]=="0"){bounds.extend(new GLatLng(lat-n,lng-n));bounds.extend(new GLatLng(lat,lng-n));bounds.extend(new GLatLng(lat,eval(lng+"+"+n)));bounds.extend(new GLatLng(lat-n,eval(lng+"+"+n)))}else{if(points[i][2]==points.length-1){bounds.extend(new GLatLng(lat,lng-n));bounds.extend(new GLatLng(eval(lat+"+"+n),lng-n));bounds.extend(new GLatLng(eval(lat+"+"+n),eval(lng+"+"+n)));bounds.extend(new GLatLng(lat,eval(lng+"+"+n)))}else{bounds.extend(new GLatLng(lat-n,lng-n));bounds.extend(new GLatLng(eval(lat+"+"+n),lng-n));bounds.extend(new GLatLng(eval(lat+"+"+n),eval(lng+"+"+n)));bounds.extend(new GLatLng(lat-n,eval(lng+"+"+n)))}}}if(locationType=="place"){map.setZoom(11)}else{map.setZoom(map.getBoundsZoomLevel(bounds))}map.setCenter(bounds.getCenter())}}function setNewMarker(point,address,position,image){if(position<1){if(locationType=="place"){var marker=new GMarker(point,{icon:iconPlace,title:address})}else{var marker=new GMarker(point,{icon:iconFrom,title:js_tr.travelroute["start"].replace(/&eacute;/g,"�")+": "+address})}}else{if(points.length==1){var marker=new GMarker(point,{icon:iconStation,title:js_tr.travelroute["station"].replace(/&ecirc;/g,"�")+" 2: "+address})}else{var marker=new GMarker(point,{icon:iconTo,title:js_tr.travelroute["finish"].replace(/&eacute;/g,"�")+": "+address})}}points.push(new Array(point,address,position,image));if(points.length>2){var markersNew=new Array()}else{var markersNew=markers}for(var i in markers){map.removeOverlay(markers[i]);if(points.length>2){if(i>0){var title=markers[i].getTitle().split(":");var stationName=title[1].replace(/^\s/g,"");markersNew[i]=new GMarker(markers[i].getLatLng(),{icon:iconStation,title:js_tr.travelroute["station"].replace(/&ecirc;/g,"�")+" "+eval(i+"+"+1)+": "+stationName})}else{markersNew[i]=markers[i]}}}markers=markersNew;markers.push(marker);for(var i in markers){map.addOverlay(markers[i])}for(var i in polylines){map.removeOverlay(polylines[i])}polylines=new Array();if(points.length>1){for(var i=0;i<points.length-1;i++){var start=points[i][0];var end=points[i+1][0];var polyline=new GPolyline([start,end],"#4444bb",4,1);polylines.push(polyline);map.addOverlay(polyline)}}}function loadMap(){imagePreload("/framework/graphics/bm/icon_marker_start_active.png","/framework/graphics/bm/icon_marker_end_active.png","/framework/graphics/bm/icon_marker_station_active.png");if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map"));map.setCenter(new GLatLng(25,10),1);map.addMapType(G_PHYSICAL_MAP);map.setMapType(G_PHYSICAL_MAP);loadIcons();geocoder=new Geocoder();geocoder.init="myDb";GEvent.addListener(map,"zoomend",checkZoom);GEvent.addListener(map,"mousemove",logMouseMove);var a=new Function("fx","closeWindow(1)");GEvent.addListener(map,"movestart",a);loadContinent();showLoading()}}function loadContinent(){geocoder.continent=unescape(document.getElementsByName("countriesJs")[0].value);geocoder.onSuccess=processContinent;geocoder.getContinent()}function processContinent(req){conJs=eval("("+req+")");for(var i in markersContinent){map.removeOverlay(markersContinent[i])}for(var i in conJs.continent){var myfunc=new Function("fx",'processCountries("'+conJs.continent[i].code+'","'+i+'")');marker=new GMarker(new GLatLng(parseFloat(conJs.continent[i].lat),parseFloat(conJs.continent[i].lng)),{icon:iconContinent,title:unescape(conJs.continent[i].name)+" ("+js_tr.travelroute["routes"]+": "+conJs.continent[i].route+", "+html_decode(js_tr.travelroute["places"])+": "+conJs.continent[i].place+")"});markersContinent.push(marker);GEvent.addListener(marker,"click",myfunc);map.addOverlay(marker)}var nav=document.getElementsByName("nav")[0].value;if(nav){var navx=nav.split("|");var country=navx[0];var point=navx[1];var zoom=navx[2];var coords=point.split(";");zoomPoint=new GLatLng(coords[0],coords[1]);zoomFactor=zoom;showCountryOnMap(country)}else{var countryCode=document.getElementsByName("showCountry")[0].value;if(countryCode){showCountry(countryCode)}else{if(mapIsLoading==1){removeLoading()}}}}function processCountries(c,a){for(var b in markersContinent){map.removeOverlay(markersContinent[b])}for(var b in markers){map.removeOverlay(markers[b])}for(var b in markersCountries){map.removeOverlay(markersCountries[b])}for(var b in conJs.countries){if(conJs.countries[b].lat!=null){var d=new Function("fx",'showCountry("'+conJs.countries[b].code+'")');if(conJs.countries[b].route==null){route=0}else{route=conJs.countries[b].route}if(conJs.countries[b].place==null){place=0}else{place=conJs.countries[b].place}marker=new GMarker(new GLatLng(parseFloat(conJs.countries[b].lat),parseFloat(conJs.countries[b].lng)),{icon:iconCountry,title:unescape(conJs.countries[b].country)+" ("+js_tr.travelroute["routes"]+": "+route+", "+html_decode(js_tr.travelroute["places"])+": "+place+")"});markersCountries.push(marker);GEvent.addListener(marker,"click",d);map.addOverlay(marker)}}map.setCenter(markersContinent[a].getLatLng(),2)}function showLoading(){document.getElementById("mapLoading").style.display="block";mapIsLoading=1}function removeLoading(){document.getElementById("mapLoading").style.display="none";mapIsLoading=0}function showCountry(a){countryZoom=1;showCountryOnMap(a)}function enableWheelZoom(){if(document.getElementsByName("wheelZoom")[0].checked==true){map.enableScrollWheelZoom();if(GEvent.addDomListener){wheelEvent=GEvent.addDomListener(map.getContainer(),"DOMMouseScroll",this.wheel)}document.getElementById("map").onmousewheel=this.wheel}else{map.disableScrollWheelZoom();if(wheelEvent){GEvent.removeListener(wheelEvent)}document.getElementById("map").onmousewheel=""}}function wheel(a){wheelEvent=1;if(!a){a=window.event}if(a.preventDefault){a.preventDefault()}a.returnValue=false}function setMapTyp(a){if(a=="normal"){map.setMapType(G_NORMAL_MAP);document.getElementsByName("typ")[0].checked=true}else{if(a=="hybrid"){map.setMapType(G_HYBRID_MAP);document.getElementsByName("typ")[1].checked=true}else{if(a=="physical"){map.setMapType(G_PHYSICAL_MAP);document.getElementsByName("typ")[2].checked=true}else{if(a=="satellit"){map.setMapType(G_SATELLITE_MAP);document.getElementsByName("typ")[3].checked=true}}}}}function setCountry(){if(document.getElementsByName("travelroute_country")[0].selectedIndex){var a=document.getElementsByName("travelroute_country")[0].options[document.getElementsByName("travelroute_country")[0].selectedIndex].value;showCountry(a)}}function showCountryOnMap(b){closeWindow(1);setMapTyp("normal");countryOnFocus=b;for(var a=0;a<document.getElementsByName("travelroute_country")[0].options.length;a++){if(document.getElementsByName("travelroute_country")[0].options[a].value==b&&document.getElementsByName("travelroute_country")[0].options[a].selected==false){document.getElementsByName("travelroute_country")[0].options[a].selected=true}}geocoder.country=b;geocoder.onSuccess=processCoordsCountry;geocoder.getCoordsCountry()}function processCoordsCountry(req){var coords=eval("("+req+")");var country=countryOnFocus;for(var i in markersContinent){map.removeOverlay(markersContinent[i])}var counti=0;for(var i in conJs.countries){if(conJs.countries[i].lat!=null){if(conJs.countries[i].code.toLowerCase()==country.toLowerCase()){break}else{counti++}}}for(var i in markersCountries){map.removeOverlay(markersCountries[i])}markersCountries=new Array();if(markersCountries.length<1){for(var i in conJs.countries){if(conJs.countries[i].lat!=null){var myfunc=new Function("fx",'showCountry("'+conJs.countries[i].code+'")');if(map.getZoom()>=4){var iconCountrySize=iconCountryBig}else{var iconCountrySize=iconCountry}if(conJs.countries[i].route==null){route=0}else{route=conJs.countries[i].route}if(conJs.countries[i].place==null){place=0}else{place=conJs.countries[i].place}marker=new GMarker(new GLatLng(parseFloat(conJs.countries[i].lat),parseFloat(conJs.countries[i].lng)),{icon:iconCountrySize,title:unescape(conJs.countries[i].country)+" ("+js_tr.travelroute["routes"]+": "+route+", "+html_decode(js_tr.travelroute["places"])+": "+place+")"});markersCountries.push(marker);GEvent.addListener(marker,"click",myfunc)}}}for(var i in markersCountries){map.removeOverlay(markersCountries[i]);map.addOverlay(markersCountries[i])}map.removeOverlay(markersCountries[counti]);for(var i in markers){map.removeOverlay(markers[i])}markers=new Array();var point=new GLatLng(parseFloat(coords.lat),parseFloat(coords.lng));map.setCenter(point,parseInt(coords.zoom));for(var i in coords.selected){}for(var i in coords.selected){if(coords.selected[i].image&&coords.selected[i].image_plug_in=="Y"){var image="/framework/graphics/bm/travelroute/"+coords.selected[i].id+"/thumb_"+coords.selected[i].image}else{var image="/framework/graphics/bm/travelroute_no_pic_thumb.gif"}if(coords.selected[i].title_summary){var title=coords.selected[i].title_summary}else{var title=coords.selected[i].title}if(title.length>20){title=title.substr(0,20)+"..."}if(coords.selected[i].description_summary){var description=coords.selected[i].description_summary}else{if(coords.selected[i].description){var description=coords.selected[i].description}else{if(coords.selected[i].text_summary){var description=coords.selected[i].text_summary}else{var description=coords.selected[i].text}}}var more="";var link_more="";var info_more="";if(coords.selected[i].more){for(var j in coords.selected[i].more){if(coords.selected[i].more[j].image&&coords.selected[i].more[j].image_plug_in=="Y"){var image_more="/framework/graphics/bm/travelroute/"+coords.selected[i].more[j].id+"/thumb_"+coords.selected[i].more[j].image}else{var image_more="/framework/graphics/bm/travelroute_no_pic_thumb.gif"}if(coords.selected[i].more[j].title_summary){var title_more=coords.selected[i].more[j].title_summary}else{var title_more=coords.selected[i].more[j].title}if(title_more.length>30){title_more=title_more.substr(0,30)+"..."}if(coords.selected[i].more[j].description_summary){var description_more=coords.selected[i].more[j].description_summary}else{if(coords.selected[i].more[j].description){var description_more=coords.selected[i].more[j].description}else{if(coords.selected[i].more[j].text_summary){var description_more=coords.selected[i].more[j].text_summary}else{var description_more=coords.selected[i].more[j].text}}}link_more=link_more+'- <a href="'+location.protocol+"//"+location.host+"/travelroute.php?show="+coords.selected[i].more[j].id+"&country="+countryOnFocus+"&point="+coords.selected[i].more[j].lat+";"+coords.selected[i].more[j].lng+'&zoom=XXX" onmouseover="document.getElementById(\'window-'+coords.selected[i].more[j].id+"').style.display='block';\" onmouseout=\"document.getElementById('window-"+coords.selected[i].more[j].id+"').style.display='none';\">"+title_more+"</a><br />";info_more=info_more+'<div class="window windowOver" id="window-'+coords.selected[i].more[j].id+'"><div class="windowImage"><img src="'+image_more+'" alt=""/></div><h1>'+title_more+"</h1><p>"+description_more+"...</p></div></div>"}}var link="";var info="";if(link_more){link=link_more+'- <a href="'+location.protocol+"//"+location.host+"/travelroute.php?show="+coords.selected[i].id+"&country="+countryOnFocus+"&point="+coords.selected[i].lat+";"+coords.selected[i].lng+'&zoom=XXX" onmouseover="document.getElementById(\'window-'+coords.selected[i].id+"').style.display='block';\" onmouseout=\"document.getElementById('window-"+coords.selected[i].id+"').style.display='none';\">"+title+"</a>";info=info_more+'<div class="window windowOver" id="window-'+coords.selected[i].id+'"><div class="windowImage"><img src="'+image+'" alt=""/></div><h1>'+title+"</h1><p>"+description+"...</p></div></div>";var myHtml=encodeURI(info+'<div class="windowList" style="clear:both;">'+js_tr.travelroute["more_possible_routes"]+":<br/>"+link+'<img src="/framework/graphics/bm/icon_close.gif" alt="" onclick="closeWindow(1);" style="position:absolute;top:5px;right:5px;cursor:pointer;" /><img style="position:absolute;bottom:-10px;left:-1px;border:none;padding:0px;margin:0px;" src="/framework/graphics/bm/icon_anchor.gif" alt="" /></div>');var list=1}else{var myHtml=encodeURI('<div class="window"><div class="windowImage"><img src="'+image+'" alt=""/></div><h1>'+title+"</h1><p>"+description+'...</p><img style="position:absolute;bottom:-10px;left:-1px;border:none;padding:0px;margin:0px;" src="/framework/graphics/bm/icon_anchor.gif" alt="" /></div>');var list=0}if(coords.selected[i].type=="route"||link_more){iconRoute=iconStation}else{iconRoute=iconPlace}var myfunc=new Function("fx",'processInfoWindow("'+myHtml+'","'+i+'","'+list+'")');var myfuncShow=new Function("fy",'showRoute("'+coords.selected[i].id+'","'+coords.selected[i].lat+";"+coords.selected[i].lng+'")');marker=new GMarker(new GLatLng(parseFloat(coords.selected[i].lat),parseFloat(coords.selected[i].lng)),{icon:iconRoute});markers.push(marker);if(link_more){GEvent.addListener(marker,"mouseover",myfunc)}else{GEvent.addListener(marker,"mouseover",myfunc);GEvent.addListener(marker,"mouseout",closeWindow);GEvent.addListener(marker,"click",myfuncShow)}map.addOverlay(marker)}if(countryZoom==1){zoomCountry();countryZoom=0}else{map.setCenter(zoomPoint,parseInt(zoomFactor))}if(mapIsLoading==1){removeLoading()}}function zoomCountry(){if(markers.length>0){var c=map.getBounds();for(var b=0;b<markers.length;b++){var a=markers[b].getLatLng();c.extend(a)}map.setZoom(map.getBoundsZoomLevel(c));map.setCenter(c.getCenter())}}function infoWindow(d,e){var b=document.getElementsByName("more_"+e)[0].value;var c=b.split(";");if(id_more==""){id_more=0}if(d=="next"){var a=-1;id_more++;if(id_more>=c.length){id_more=0;a=2}document.getElementById(c[id_more+a]).style.display="none";document.getElementById(c[id_more]).style.display="block"}else{if(d=="last"){var a=1;id_more=id_more-1;if(id_more<0){id_more=c.length-1;a=-2}document.getElementById(c[id_more+a]).style.display="none";document.getElementById(c[id_more]).style.display="block"}}}function showRoute(c,a){var b=document.getElementsByName("travelroute_country")[0].options[document.getElementsByName("travelroute_country")[0].selectedIndex].value;window.location.href=location.protocol+"//"+location.host+"/travelroute.php?show="+c+"&country="+b+"&point="+a+"&zoom="+map.getZoom()}function closeWindow(a){if(listIsActive==0||a==1){document.getElementById("infoWindow").style.display="none";if(a==1){listIsActive=0}}else{markerIsActiveHidden=null}}function processInfoWindow(c,b,d){if(listIsActive==0){if(d==1){listIsActive=1;setTimeout(function(){listIsActive=0;if(markerIsActiveHidden){processInfoWindow(markerIsActiveHidden[0],markerIsActiveHidden[1]);markerIsActiveHidden=null}},800)}id_more="";var e=map.fromLatLngToContainerPixel(markers[b].getLatLng());document.getElementById("infoWindow").innerHTML=decodeURI(c.replace(/XXX/g,map.getZoom()));document.getElementById("infoWindow").style.display="block";var a=document.getElementById("infoWindow").offsetHeight;document.getElementById("infoWindow").style.top=(e.y+50-a)+"px";document.getElementById("infoWindow").style.left=(e.x+11)+"px"}else{if(d!=1){markerIsActiveHidden=new Array(c,b)}}}function processPoint(a){window.location.href="/travelroute.php?show="+a}function loadStation(order){if(order=="back"){if(document.getElementsByName("station_active")[0].value-1<0){var station=document.getElementsByName("station_all")[0].value}else{var station=document.getElementsByName("station_active")[0].value-1}}else{if(order=="next"){if(eval(document.getElementsByName("station_active")[0].value+"+"+1)>document.getElementsByName("station_all")[0].value){var station=0}else{var station=eval(document.getElementsByName("station_active")[0].value+"+"+1)}}else{var station=order}}if(station==0){var before=js_tr.travelroute["start"]+": ";var cm="startImg"}else{if(station==document.getElementsByName("station_all")[0].value){var before=js_tr.travelroute["finish"]+": ";var cm="endImg"}else{var before=js_tr.travelroute["station"]+" "+eval(station+"+"+1)+": ";var cm="stationImg"}}var title=before+unescape(routeJs.travelroutes_location[station].travelroutes_location_name);document.getElementById("headJs").className=cm;document.getElementById("headJs").innerHTML=title;if(routeJs.travelroutes_location[station].travelroutes_description_text_summary==null){var text=unescape(routeJs.travelroutes_location[station].travelroutes_description_text)}else{var text=unescape(routeJs.travelroutes_location[station].travelroutes_description_text_summary)}if(routeJs.travelroutes_image.station[station].length>0){document.getElementById("pictureContainer").className="";if(document.getElementById("pictureContainer").innerHTML==""){document.getElementById("pictureContainer").innerHTML=' <div class="picBgActive" id="picCon"><img src="#" id="mainPic" alt="'+js_tr.travelroute["zoom_photos"]+'" title="'+js_tr.travelroute["zoom_photos"]+'" onclick="showOverlay();" /></div><p id="pictureText"><a href="javascript:loadImage(\'back\');" class="left" id="leftPic"><< '+js_tr.travelroute["back"]+'</a><span class="pic" id="picText" style="visibiliy:visible;">'+js_tr.travelroute["pic"]+' <span id="number">1</span> '+js_tr.travelroute["from"]+' <span id="total">x</span></span><a href="javascript:loadImage(\'next\');" class="right" id="rightPic">'+js_tr.travelroute["next"]+" >></a></p>"}document.getElementById("picCon").style.visibility="visible";document.getElementById("picText").style.visibility="visible";document.getElementsByName("mainPicLoaded")[0].value="0";numPicLoaded="0";if(routeJs.travelroutes_image.station[station].length==1){document.getElementById("leftPic").style.visibility="hidden";document.getElementById("rightPic").style.visibility="hidden"}else{document.getElementById("leftPic").style.visibility="visible";document.getElementById("rightPic").style.visibility="visible"}document.getElementById("total").innerHTML=routeJs.travelroutes_image.station[station].length;document.getElementById("number").innerHTML=1;document.getElementById("mainPic").src="/framework/graphics/bm/travelroute/"+routeJs.tid+"/thumb_big_"+routeJs.travelroutes_image.station[station][0].name}else{document.getElementById("pictureContainer").innerHTML="";document.getElementById("pictureContainer").className="noPic"}document.getElementById("textJs").innerHTML=text;document.getElementById("navStation"+document.getElementsByName("station_active")[0].value).className="";document.getElementById("navStation"+station).className="active";if(document.getElementsByName("station_all")[0].value>4&&station>2&&station<(document.getElementsByName("station_all")[0].value-2)){document.getElementById("moreLeft").style.visibility="visible";document.getElementById("moreRight").style.visibility="visible";if(station==eval(document.getElementsByName("station_active")[0].value+"+"+1)){document.getElementById("navStation"+(station-2)).style.display="none";document.getElementById("navStation"+(eval(station+"+"+1))).style.display="block"}else{if(station==document.getElementsByName("station_active")[0].value-1){document.getElementById("navStation"+(eval(station+"+"+2))).style.display="none";document.getElementById("navStation"+(station-1)).style.display="block"}else{if(station>eval(document.getElementsByName("station_active")[0].value+"+"+1)||station<document.getElementsByName("station_active")[0].value-1){if(document.getElementsByName("station_active")[0].value<3){document.getElementById("navStation1").style.display="none";document.getElementById("navStation2").style.display="none";document.getElementById("navStation3").style.display="none"}else{if(document.getElementsByName("station_active")[0].value>(document.getElementsByName("station_all")[0].value-2)){document.getElementById("navStation"+(document.getElementsByName("station_all")[0].value-1)).style.display="none";document.getElementById("navStation"+(document.getElementsByName("station_all")[0].value-2)).style.display="none";document.getElementById("navStation"+(document.getElementsByName("station_all")[0].value-3)).style.display="none"}else{document.getElementById("navStation"+(eval(document.getElementsByName("station_active")[0].value+"+"+1))).style.display="none";document.getElementById("navStation"+(document.getElementsByName("station_active")[0].value-1)).style.display="none";document.getElementById("navStation"+(document.getElementsByName("station_active")[0].value)).style.display="none"}}document.getElementById("navStation"+(station-1)).style.display="block";document.getElementById("navStation"+(eval(station+"+"+1))).style.display="block";document.getElementById("navStation"+station).style.display="block"}}}}else{if(document.getElementsByName("station_all")[0].value>4&&station<4&&document.getElementsByName("station_active")[0].value>2){if(document.getElementsByName("station_active")[0].value<(document.getElementsByName("station_all")[0].value-2)){document.getElementById("navStation"+(eval(document.getElementsByName("station_active")[0].value+"+"+1))).style.display="none";document.getElementById("navStation"+(document.getElementsByName("station_active")[0].value-1)).style.display="none";document.getElementById("navStation"+(document.getElementsByName("station_active")[0].value)).style.display="none"}else{if(document.getElementsByName("station_active")[0].value>(document.getElementsByName("station_all")[0].value-3)){document.getElementById("navStation"+(document.getElementsByName("station_all")[0].value-1)).style.display="none";document.getElementById("navStation"+(document.getElementsByName("station_all")[0].value-2)).style.display="none";document.getElementById("navStation"+(document.getElementsByName("station_all")[0].value-3)).style.display="none";document.getElementById("moreRight").style.visibility="visible"}}document.getElementById("navStation0").style.display="block";document.getElementById("navStation1").style.display="block";document.getElementById("navStation2").style.display="block";document.getElementById("navStation3").style.display="block";document.getElementById("moreLeft").style.visibility="hidden"}else{if(document.getElementsByName("station_all")[0].value>4&&station>(document.getElementsByName("station_all")[0].value-3)){if(document.getElementsByName("station_active")[0].value!=document.getElementsByName("station_all")[0].value&&document.getElementsByName("station_active")[0].value>2){document.getElementById("navStation"+(eval(document.getElementsByName("station_active")[0].value+"+"+1))).style.display="none";document.getElementById("navStation"+(document.getElementsByName("station_active")[0].value-1)).style.display="none";document.getElementById("navStation"+(document.getElementsByName("station_active")[0].value)).style.display="none"}if(document.getElementsByName("station_active")[0].value!=document.getElementsByName("station_all")[0].value&&document.getElementsByName("station_active")[0].value<3){document.getElementById("navStation1").style.display="none";document.getElementById("navStation2").style.display="none";document.getElementById("navStation3").style.display="none";document.getElementById("moreLeft").style.visibility="visible"}document.getElementById("navStation"+document.getElementsByName("station_all")[0].value).style.display="block";document.getElementById("navStation"+(document.getElementsByName("station_all")[0].value-1)).style.display="block";document.getElementById("navStation"+(document.getElementsByName("station_all")[0].value-2)).style.display="block";document.getElementById("navStation"+(document.getElementsByName("station_all")[0].value-3)).style.display="block";document.getElementById("moreRight").style.visibility="hidden"}}}document.getElementsByName("station_active")[0].value=station;var markersNew=new Array();for(var i in markers){var title=markers[i].getTitle().split(":");var myfunc=new Function("fx",'loadStation("'+i+'")');if(i==0){if(i==station){markersNew[i]=new GMarker(markers[i].getLatLng(),{icon:iconFromActive,title:js_tr.travelroute["start"].replace(/&eacute;/g,"�")+": "+title[1]})}else{markersNew[i]=new GMarker(markers[i].getLatLng(),{icon:iconFrom,title:js_tr.travelroute["start"].replace(/&eacute;/g,"�")+": "+title[1]})}}else{if(i==markers.length-1){if(i==station){markersNew[i]=new GMarker(markers[i].getLatLng(),{icon:iconToActive,title:js_tr.travelroute["finish"].replace(/&eacute;/g,"�")+": "+title[1]})}else{markersNew[i]=new GMarker(markers[i].getLatLng(),{icon:iconTo,title:js_tr.travelroute["finish"].replace(/&eacute;/g,"�")+": "+title[1]})}}else{if(i==station){markersNew[i]=new GMarker(markers[i].getLatLng(),{icon:iconStationActive,title:js_tr.travelroute["station"].replace(/&ecirc;/g,"�")+" "+eval(i+"+"+1)+": "+title[1]})}else{markersNew[i]=new GMarker(markers[i].getLatLng(),{icon:iconStation,title:js_tr.travelroute["station"].replace(/&ecirc;/g,"�")+" "+eval(i+"+"+1)+": "+title[1]})}}}GEvent.addListener(markersNew[i],"click",myfunc)}for(var i in markers){map.removeOverlay(markers[i]);map.addOverlay(markersNew[i])}markers=markersNew}function loadImage(order){var num=document.getElementsByName("mainPicLoaded")[0].value;var station=document.getElementsByName("station_active")[0].value;if(order=="back"){num--}else{if(order=="next"){num++}}if(num>routeJs.travelroutes_image.station[station].length-1){num=0}else{if(num<0){num=routeJs.travelroutes_image.station[station].length-1}}document.getElementById("mainPic").src="/framework/graphics/bm/travelroute/"+routeJs.tid+"/thumb_big_"+routeJs.travelroutes_image.station[station][num].name;document.getElementsByName("mainPicLoaded")[0].value=num;numPicLoaded=num;document.getElementById("number").innerHTML=eval(num+"+"+1)}function pictureBoxLoadImage(order){if(numPicLoaded!=null){var num=numPicLoaded}else{if(document.getElementsByName("stationPic_active")[0].value=="all"){var num=document.getElementsByName("allPicLoaded")[0].value}else{if(document.getElementsByName("stationPic_active")[0].value=="all2"){var num=document.getElementsByName("all2PicLoaded")[0].value}else{if(document.getElementsByName("stationPic_active")[0].value!="null"){var num=document.getElementsByName("stationPicLoaded"+document.getElementsByName("stationPic_active")[0].value)[0].value}else{var num=document.getElementsByName("mainPicLoaded")[0].value}}}}if(document.getElementsByName("stationPic_active")[0].value!="null"){var station=document.getElementsByName("stationPic_active")[0].value}else{var station=document.getElementsByName("station_active")[0].value}if(order=="back"){num--}else{if(order=="next"){num++}}if(document.getElementsByName("stationPic_active")[0].value=="all"||document.getElementsByName("stationPic_active")[0].value=="all2"){if(num>routeJs.travelroutes_image.all.length-1){num=0}else{if(num<0){num=routeJs.travelroutes_image.all.length-1}}document.getElementById("pictureBoxImage").src="/framework/graphics/bm/travelroute/"+routeJs.tid+"/pic_"+routeJs.travelroutes_image.all[num].name}else{if(num>routeJs.travelroutes_image.station[station].length-1){num=0}else{if(num<0){num=routeJs.travelroutes_image.station[station].length-1}}document.getElementById("pictureBoxImage").src="/framework/graphics/bm/travelroute/"+routeJs.tid+"/pic_"+routeJs.travelroutes_image.station[station][num].name}numPicLoaded=num;document.getElementById("pictureBoxNumber").innerHTML=eval(num+"+"+1)}function loadImageStation(b,a){if(b=="all"){document.getElementById("allPic").src="/framework/graphics/bm/travelroute/"+routeJs.tid+"/thumb_big_"+routeJs.travelroutes_image.all[a].name;document.getElementsByName("allPicLoaded")[0].value=a}else{if(b=="all2"){document.getElementById("allPic2").src="/framework/graphics/bm/travelroute/"+routeJs.tid+"/thumb_big_"+routeJs.travelroutes_image.all[a].name;document.getElementsByName("all2PicLoaded")[0].value=a}else{document.getElementById("stationPic"+b).src="/framework/graphics/bm/travelroute/"+routeJs.tid+"/thumb_big_"+routeJs.travelroutes_image.station[b][a].name;document.getElementsByName("stationPicLoaded"+b)[0].value=a}}}function showOverlay(overall){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight}}var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth}else{windowWidth=self.innerWidth}windowHeight=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight}else{if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight}}}if(yScroll<windowHeight){pageHeight=windowHeight}else{pageHeight=yScroll}if(xScroll<windowWidth){pageWidth=xScroll}else{pageWidth=windowWidth}document.getElementById("overlay").style.width=pageWidth+"px";document.getElementById("overlay").style.height=pageHeight+"px";if(typeof(overall)=="undefined"){var num=document.getElementsByName("mainPicLoaded")[0].value;numPicLoaded=document.getElementsByName("mainPicLoaded")[0].value;var station=document.getElementsByName("station_active")[0].value;document.getElementsByName("stationPic_active")[0].value="null"}else{if(overall=="all"){var num=document.getElementsByName("allPicLoaded")[0].value;numPicLoaded=document.getElementsByName("allPicLoaded")[0].value;document.getElementsByName("stationPic_active")[0].value="all"}else{if(overall=="all2"){var num=document.getElementsByName("all2PicLoaded")[0].value;numPicLoaded=document.getElementsByName("all2PicLoaded")[0].value;document.getElementsByName("stationPic_active")[0].value="all2"}else{var num=document.getElementsByName("stationPicLoaded"+overall)[0].value;numPicLoaded=document.getElementsByName("stationPicLoaded"+overall)[0].value;var station=overall;document.getElementsByName("stationPic_active")[0].value=overall}}}if(overall=="all"||overall=="all2"){document.getElementById("pictureBox").innerHTML='<div id="pictureBoxContent"><div class="pictureBoxPlace"><img src="/framework/graphics/bm/travelroute/'+routeJs.tid+"/pic_"+routeJs.travelroutes_image.all[num].name+'" id="pictureBoxImage" onclick="javascript:pictureBoxLoadImage(\'next\');" /></div><p id="pictureBoxText"><a id="pictureBoxLeftPic" class="fleft backward" href="javascript:pictureBoxLoadImage(\'back\');">'+js_tr.travelroute["back"]+'</a><span class="pictureBoxPic">'+js_tr.travelroute["pic"]+' <span id="pictureBoxNumber">'+eval(num+"+"+1)+"</span> "+js_tr.travelroute["from"]+' <span id="pictureBoxTotal">'+routeJs.travelroutes_image.all.length+'</span></span><a id="pictureBoxRightPic" class="fright forward" href="javascript:pictureBoxLoadImage(\'next\');">'+js_tr.travelroute["next"]+'</a></p></div><div class="pictureBoxClose" onclick="closeOverlay();">'+js_tr.travelroute["close_window"]+"</div>";if(routeJs.travelroutes_image.all.length==1){document.getElementById("pictureBoxLeftPic").style.visibility="hidden";document.getElementById("pictureBoxRightPic").style.visibility="hidden"}}else{document.getElementById("pictureBox").innerHTML='<div id="pictureBoxContent"><div class="pictureBoxPlace"><img src="/framework/graphics/bm/travelroute/'+routeJs.tid+"/pic_"+routeJs.travelroutes_image.station[station][num].name+'" id="pictureBoxImage" onclick="javascript:pictureBoxLoadImage(\'next\');" /></div><p id="pictureBoxText"><a id="pictureBoxLeftPic" class="fleft backward" href="javascript:pictureBoxLoadImage(\'back\');">'+js_tr.travelroute["back"]+'</a><span class="pictureBoxPic">'+js_tr.travelroute["pic"]+' <span id="pictureBoxNumber">'+eval(num+"+"+1)+"</span> "+js_tr.travelroute["from"]+' <span id="pictureBoxTotal">'+routeJs.travelroutes_image.station[station].length+'</span></span><a id="pictureBoxRightPic" class="fright forward" href="javascript:pictureBoxLoadImage(\'next\');">'+js_tr.travelroute["next"]+'</a></p></div><div class="pictureBoxClose" onclick="closeOverlay();">'+js_tr.travelroute["close_window"]+"</div>";if(routeJs.travelroutes_image.station[station].length==1){document.getElementById("pictureBoxLeftPic").style.visibility="hidden";document.getElementById("pictureBoxRightPic").style.visibility="hidden"}}document.getElementById("overlay").style.display="block";document.getElementById("pictureBox").style.display="block";if(document.getElementById("overlay").addEventListener){document.getElementById("overlay").addEventListener("click",closeOverlay,false)}else{if(document.getElementById("overlay").attachEvent){document.getElementById("overlay").attachEvent("onclick",closeOverlay)}}}function closeOverlay(){document.getElementById("overlay").style.display="none";document.getElementById("pictureBox").style.display="none"}function checkZoom(c,b){closeWindow();if(b>c&&c>=3){map.addMapType(G_NORMAL_MAP);map.setMapType(G_NORMAL_MAP)}if(b<c&&b<3){map.addMapType(G_PHYSICAL_MAP);map.setMapType(G_PHYSICAL_MAP)}if(b<2){if(markersCountries.length>0){map.clearOverlays();markersCountries=new Array()}for(var e in markersContinent){map.removeOverlay(markersContinent[e]);map.addOverlay(markersContinent[e]);map.setCenter(new GLatLng(25,10),1)}}else{if(b==2&&c<2){for(var e in markers){map.removeOverlay(markers[e])}if(markersCountries.length<1){if(wheelEvent==1){var a=pointMouseMove}else{var a=map.getCenter()}numbers=new Array();for(var e in conJs.continent){numbers.push(a.distanceFrom(new GLatLng(conJs.continent[e].lat,conJs.continent[e].lng)))}numbers.sort(numSort);for(var e in conJs.continent){if(a.distanceFrom(new GLatLng(conJs.continent[e].lat,conJs.continent[e].lng))==numbers[0]){var f=conJs.continent[e].code;var d=e;break}}processCountries(f,d)}else{for(var e in markersCountries){map.removeOverlay(markersCountries[e]);map.addOverlay(markersCountries[e])}}}else{if(b<=3&&c>3){var h=document.getElementsByName("travelroute_country")[0].options[document.getElementsByName("travelroute_country")[0].selectedIndex].value;for(var e in markersCountries){map.removeOverlay(markersCountries[e])}markersCountries=new Array();for(var e in conJs.countries){if(conJs.countries[e].lat!=null){var g=new Function("fx",'showCountry("'+conJs.countries[e].code+'")');if(conJs.countries[e].route==null){route=0}else{route=conJs.countries[e].route}if(conJs.countries[e].place==null){place=0}else{place=conJs.countries[e].place}marker=new GMarker(new GLatLng(parseFloat(conJs.countries[e].lat),parseFloat(conJs.countries[e].lng)),{icon:iconCountry,title:unescape(conJs.countries[e].country)+" ("+js_tr.travelroute["routes"]+": "+route+", "+html_decode(js_tr.travelroute["places"])+": "+place+")"});markersCountries.push(marker);if(conJs.countries[e].code!=h){GEvent.addListener(marker,"click",g);map.addOverlay(marker)}}}}else{if(b>=4&&c<4){var h=document.getElementsByName("travelroute_country")[0].options[document.getElementsByName("travelroute_country")[0].selectedIndex].value;for(var e in markersCountries){map.removeOverlay(markersCountries[e])}markersCountries=new Array();for(var e in conJs.countries){if(conJs.countries[e].lat!=null){var g=new Function("fx",'showCountry("'+conJs.countries[e].code+'")');if(conJs.countries[e].route==null){route=0}else{route=conJs.countries[e].route}if(conJs.countries[e].place==null){place=0}else{place=conJs.countries[e].place}marker=new GMarker(new GLatLng(parseFloat(conJs.countries[e].lat),parseFloat(conJs.countries[e].lng)),{icon:iconCountryBig,title:unescape(conJs.countries[e].country)+" ("+js_tr.travelroute["routes"]+": "+route+", "+html_decode(js_tr.travelroute["places"])+": "+place+")"});markersCountries.push(marker);if(conJs.countries[e].code!=h){GEvent.addListener(marker,"click",g);map.addOverlay(marker)}}}}else{if(b>=5){}}}}}wheelEvent=0}function logMouseMove(a){pointMouseMove=a}function numSort(d,c){return d-c}function printRoute(c,a){if(a){var b="/travelroute.php?print&id="+c+"&nopic"}else{var b="/travelroute.php?print&id="+c}window.open(b,"print","scrollbars=yes,toolbar=no,menubar=yes,resizable=yes,width=780,height=560,top=20,left=20")}function html_decode(b){var c=false;try{if(c==false){c=document.createElement("textarea")}c.innerHTML=b;return c.value}catch(a){return b}}function imagePreload(){document.preload=new Array();if(document.images){for(var a=0;a<imagePreload.arguments.length;a++){document.preload[a]=new Image();document.preload[a].src=imagePreload.arguments[a]}}};
