var AdviceType={Advice_Intersection:0,Advice_ConfirmationPOI:1,Advice_StartRouteAdvice:3};var NearbyPoiRelation={Poi_None:0,Poi_BeforeAdvice:1,Poi_AtAdvice:2,Poi_AfterAdvice:3};var NearbyPoiType={Poi_TouristInformation:400,Poi_HistoricalMonument:403,Poi_TouristAttraction:406,Poi_Institute:414,Poi_Cinema:426,Poi_BusinessFacility:430,Poi_Hotel:450,Poi_Hotel2:451,Poi_Motel:452,Poi_Restaurant:460,Poi_CafePub:461,Poi_BanquetMarriageHall:462,Poi_ShoppingCenter:470,Poi_Market:473,Poi_Stadium:480,Poi_GolfCourse:483,Poi_SportsCenter:486,Poi_NaturePark:490,Poi_Beach:493,Poi_GovernmentOffice:500,Poi_PoliceStation:502,Poi_Embassy:506,Poi_FireStation:507,Poi_Cemetary:532,Poi_Church:540,Poi_Mosque:541,Poi_Temple:542,Poi_Buddhist:544,Poi_Hindu:545,Poi_Sikh:546,Poi_Jain:547,Poi_Hospital:560,Poi_Pharmacy:562,Poi_Ambulance:565,Poi_BloodBank:566,Poi_PostOffice:570,Poi_Bank:580,Poi_VehicleRepair:600,Poi_PetrolStation:610,Poi_Rentacar:620,Poi_Parking:630,Poi_RailwayStation:640,Poi_BusStation:644,Poi_Airport:650,Poi_CarDealer:670,Poi_Apartment:831,Poi_HillStation:832,Poi_RestaurantContinental:833,Poi_FastFood:834,Poi_IndianRestaurant:835,Poi_OrientalRestaurant:836,Poi_ShoppingOther:837,Poi_Shopping:838,Poi_ShoppingRetail:839};var SimpleAdvice={adv_invalid:-1,adv_sharp_right:0,adv_right:1,adv_bear_right:2,adv_straight_ahead:3,adv_bear_left:4,adv_left:5,adv_sharp_left:6,adv_turn_around:7,adv_enter_round_about:8,adv_round_about_1:9,adv_round_about_2:10,adv_round_about_3:11,adv_round_about_4:12,adv_round_about_5:13,adv_round_about_6:14,adv_round_about_7:15,adv_round_about_8:16,adv_shift_right:17,adv_shift_left:18,adv_take_highway_exit:19,adv_destination_reached:20,adv_take_ferry:24};var IntersectionShape={IntersectionShape_Unknown:0,IntersectionShape_T:1,IntersectionShape_Y:2};var C2P={0:"Tourist Information Centre",1:"Restaurant - Pubs & Bars",2:"Roadside Diner",3:"Wildlife Sanctuary",4:"Insurance & Financial",5:"Individual Housing - Famous",6:"Traffic Check Post",7:"Dharamshalas",8:"Metro Station",9:"Restaurant - Continental",10:"Bird Sanctuary",11:"Resorts",12:"Open Parking Areas",13:"Bus Stop",14:"Tourist Attraction - Catchall",15:"Traffic Signal",16:"Institution",17:"Swimming Pool",18:"Heart hospital",19:"Shopping Plaza, Complex",20:"Dam",21:"Department Store",22:"Golf Course",23:"Sunset Point",24:"Automotive Dealers-Car",25:"Telecom",26:"Town",27:"Car Rental",28:"Blood bank",29:"Auditoriums",30:"Ski-lift Station",31:"Airline Access",32:"Police Chowki",33:"Shopping Markets",34:"Tour Operator",35:"University or College",36:"Casino",37:"Sunrise Point",38:"Vantage Point",39:"Lake",40:"Banks & Money Exchanger",41:"Other Worship Places",42:"Recreation Facility",43:"Tea Garden",44:"Island",45:"Marina",46:"Library",47:"Zoo",48:"Nature Other",49:"Youth Hostels",50:"Ski Resort",51:"Fire Station",52:"Church",53:"Local Administrative Offices",54:"Beach",55:"Warehouse/ Godowns",56:"Restaurant - Fast Food",57:"Toll Location",58:"Police Other",59:"School",60:"Shopping Malls",61:"Customs",62:"Camping",63:"Court House",64:"Restaurant - Others",65:"Hotels - Premium",66:"Shopping Retail Shops",67:"Hindu Temple",68:"Museums",69:"Automotive Stores/Automotive Others",70:"Theatre",71:"Ayurveda & Yoga",72:"Cooking Gas Stations & Services",73:"Adventure Sports",74:"Hotels - Budget",75:"Farm Houses",76:"Parking",77:"Post and Telegraph Office",78:"Government Office",79:"Ferry Terminal",80:"Metro/Local & Main Railway Station",81:"Parking Garage",82:"Rest Area",83:"Ambulance Service",84:"BPO",85:"Stadium",86:"Airport - Non Commercial",87:"Airport - Commercial",88:"Mental hospital",89:"Apartment",90:"Other Shopping Centers - Catchall",91:"Sea Port",92:"Amusement Park, Water Parks",93:"Orthopedic hospital",94:"Hill Station",95:"Water Fall",96:"Village",97:"Banquet & Marriage Hall",98:"Major Tourist Park/Garden",99:"Mandi - Sabzi mandi, fish Mandi etc.",100:"Commercial Complex & Building",101:"Local Railway Station",102:"ATM",103:"Forest",104:"Water Spring",105:"Embassies & Consulates",106:"Cinema",107:"Railway Bridge",108:"Bus Terminal",109:"Media & Advertising",110:"Individual House Not Famous",111:"Club",112:"CNG Station",113:"Railway Station",114:"Jain Temple",115:"Gym",116:"Eye Hospital",117:"Sports Complex",118:"Other Community Services - catchall",119:"Other Commercial Centres",120:"Medical Store",121:"Eye Bank",122:"Gurudwara",123:"Helipad",124:"Kindergarten, Play School, Day care",125:"Crematorium, Burial Ground",126:"Motoring Organization Office",127:"Dental hospital",128:"Historical Monument - Catch all",129:"Optometrist",130:"Bus and Truck Parking",131:"Police Station",132:"Oil & Petroleum",133:"Shopping Retail Chain",134:"Sporting Venues - Catchall",135:"Restaurant - Indian/Multicuisine",136:"Industrial Centres",137:"Petrol Pump",138:"Homeopathic Hospital",139:"Major Hospitals & Nursing Homes",140:"Buddhist Sites",141:"Restaurant - Oriental",142:"Islamic",143:"Automotive Repair",144:"Art Galleries",145:"Bowling Centre",146:"Exhibition or Conference/Culture Centre, Fairs",147:"Vetinary Hospital",148:"Animal and Bird Sighting",149:"Pathological Laboratory.",150:"Clinic, Dispensry and Health Care Centres",151:"Forts & Palaces",152:"Vocational College/Education others"};var WorldOrientation={Orientation_Unknown:0,Orientation_North:1,Orientation_NorthEast:2,Orientation_East:3,Orientation_SouthEast:4,Orientation_South:5,Orientation_SouthWest:6,Orientation_West:7,Orientation_NorthWest:8};var PoiRelationToRoad={PoiRoad_None:0,PoiRoad_Left:1,PoiRoad_Right:2};var x=new Array();var EnglishAdvisor={lane_count:null,advice_lane_count:null,is_left_road_country:false,masked_lane_info:null,advice_to_text:function(advice){var advice_text="";this.lane_count=advice.lane_info.length;this.advice_lane_count=advice.masked_lane_info.length;this.masked_lane_info=advice.masked_lane_info;if(advice.country_code in{372:0,470:0,826:0,356:0,586:0,36:0,554:0,710:0,196:0})this.is_left_road_country=true;x.push(advice.advice_type);switch(advice.advice_type){case AdviceType.Advice_Intersection:advice_text=this.intersection_advice_to_text(advice);break;case AdviceType.Advice_ConfirmationPOI:advice_text=this.confirmation_poi_advice_to_text(advice);break;case AdviceType.Advice_StartRouteAdvice:advice_text=this.start_advice_to_text(advice);break}var i=0;if(advice_text.charAt(0)=='<'){while(advice_text.charAt(i)!='>')i++;i++}if(advice_text.charAt(advice_text.length-1)==" ")advice_text=advice_text.substr(0,advice_text.length-1);return advice_text.substr(0,i)+advice_text.charAt(i).toUpperCase()+advice_text.substr(i+1)+"."},intersection_advice_to_text:function(advice){var advice_text="";var used_word_at=false;var has_good_highway_advice=false;var manouver_text_added=false;if(advice.manouver==SimpleAdvice.adv_destination_reached)return"destination reached";if(advice.manouver==SimpleAdvice.adv_take_ferry){advice_text="<b>take ferry</b> ";if(advice.location_name.length>0)advice_text+="<i>"+advice.location_name+"</i> ";advice_text+="from <i>"+advice.entry_road_name+"</i> to <i>"+advice.exit_road_name+"</i>";return advice_text}if(advice.first_intersection_from_prev_advice){if(this.is_roundabout_advice(advice.manouver)==false){advice_text="at next intersection ";used_word_at=true}}else if(advice.signpost_exit_number.length>0){if(this.is_roundabout_advice(advice.manouver)==false){advice_text="at exit <i>"+advice.signpost_exit_number+"</i> ";used_word_at=true;if(advice.location_name.length>0)advice_text+="(<i>"+advice.location_name+"</i>)";has_good_highway_advice=true}}else if((advice.manouver==SimpleAdvice.adv_take_highway_exit)&&(advice.location_name.length>0)){advice_text="at highway intersection <i>"+advice.location_name+"</i> ";has_good_highway_advice=true}else if(advice.intersection_shape==IntersectionShape.IntersectionShape_T){if(this.is_roundabout_advice(advice.manouver)==false){advice_text="at the end of the road ";used_word_at=true}}else if(advice.intersection_shape==IntersectionShape.IntersectionShape_Y){if(this.is_roundabout_advice(advice.manouver)==false){advice_text="at fork ";used_word_at=true}}if(has_good_highway_advice==false){if(advice.poi_relation_to_advice==NearbyPoiRelation.Poi_BeforeAdvice){advice_text="after "+this.get_poi_description(advice.poi_description.type_ID,advice.poi_description.brand_name)+" "}else if(advice.poi_relation_to_advice==NearbyPoiRelation.Poi_AtAdvice){advice_text="at "+this.get_poi_description(advice.poi_description.type_ID,advice.poi_description.brand_name)+" ";used_word_at=true}else if((advice.manouver==SimpleAdvice.adv_left)&&(advice.num_left_roads_since_prev_advice!=-1)){advice_text="take the "+this.create_ordinal_string(advice.num_left_roads_since_prev_advice+1)+" <b>left</b>";manouver_text_added=true}else if((advice.manouver==SimpleAdvice.adv_right)&&(advice.num_right_roads_since_prev_advice!=-1)){advice_text="take the "+this.create_ordinal_string(advice.num_right_roads_since_prev_advice+1)+" <b>right</b>";manouver_text_added=true}}if(manouver_text_added==false)advice_text+=this.simple_advice_to_text(advice.manouver);if(this.advice_lane_count>0){advice_text+=" "+this.get_lane_info();if(advice.immediate_follow_manouver==SimpleAdvice.adv_invalid)advice_text+=" "}if(advice.immediate_follow_manouver!=SimpleAdvice.adv_invalid){if(advice.immediate_follow_manouver!=SimpleAdvice.adv_destination_reached)advice_text+=", then ";else advice_text+=" and ";if(advice.manouver==advice.immediate_follow_manouver)advice_text+="again ";advice_text+=this.simple_advice_to_text(advice.immediate_follow_manouver)+" ";if(advice.immediate_follow_manouver==SimpleAdvice.adv_destination_reached)return advice_text}else{advice_text+=" "}if(advice.merge_onto_highway){if(advice.signpost_label.length>0)advice_text+="towards <i>"+advice.signpost_label+"</i> ";advice_text+="and merge on ";if(advice.exit_road_name.length>0)advice_text+="<i>"+advice.exit_road_name+"</i> ";advice_text+="highway "}else{if(advice.signpost_label.length>0){advice_text+="towards <i>"+advice.signpost_label+"</i> "}else if((advice.manouver!=SimpleAdvice.adv_straight_ahead)&&(advice.manouver!=SimpleAdvice.adv_turn_around)){if((advice.entry_road_name==advice.exit_road_name)&&(advice.entry_road_name.length>0)){advice_text+="to stay on <i>"+advice.exit_road_name+"</i> "}else if(advice.exit_road_name.length>0){if(used_word_at)advice_text+="onto ";else advice_text+="at ";advice_text+="<i>"+advice.exit_road_name+"</i> "}}else if(advice.manouver==SimpleAdvice.adv_straight_ahead){if((advice.entry_road_name==advice.exit_road_name)&&(advice.entry_road_name.length>0)){advice_text+="to stay on <i>"+advice.exit_road_name+"</i> "}else if(advice.exit_road_name.length>0){advice_text+="on ";advice_text+="<i>"+advice.exit_road_name+"</i> "}}else if(advice.manouver==SimpleAdvice.adv_turn_around){if((advice.location_name.length>0)&&(used_word_at))advice_text+="at <i>"+advice.location_name+"</i> "}if(advice.poi_relation_to_advice==NearbyPoiRelation.Poi_AfterAdvice){advice_text+=" and you will pass by "+this.get_poi_description(advice.poi_description.type_ID,advice.poi_description.brand_name)+" ";if(advice.poi_description.relation_to_road==PoiRelationToRoad.PoiRoad_Left)advice_text+="on your left";if(advice.poi_description.relation_to_road==PoiRelationToRoad.PoiRoad_Right)advice_text+="on your right"}}return advice_text},confirmation_poi_advice_to_text:function(advice){var advice_text="";if(advice.poi_relation_to_advice==NearbyPoiRelation.Poi_AtAdvice){if(advice.entry_road_name.length>0)advice_text="while driving on <i>"+advice.entry_road_name+"</i> ";advice_text+="you will pass by "+this.get_poi_description(advice.poi_description.type_ID,advice.poi_description.brand_name)+" ";if(advice.poi_description.relation_to_road==PoiRelationToRoad.PoiRoad_Left)advice_text+="on your left";if(advice.poi_description.relation_to_road==PoiRelationToRoad.PoiRoad_Right)advice_text+="on your right"}return advice_text},start_advice_to_text:function(advice){var advice_text="";if(advice.border_crossing_name.length>0)advice_text="<b>cross the border</b> to <i>"+advice.border_crossing_name+"</i>. Continue ";else advice_text="head ";if(advice.start_orientation!=WorldOrientation.Orientation_Unknown)advice_text+=" <b>"+this.get_orientation_text(advice.start_heading)+"</b> ";else if(advice.location_name.length>0)advice_text="start ";if(advice.entry_road_name.length>0)advice_text+="on <i>"+advice.entry_road_name+"</i> ";if(advice.location_name.length>0)advice_text+="towards <i>"+advice.location_name+"</i> ";if(advice_text.length==0)advice_text="begin the journey";if(advice.immediate_follow_manouver!=SimpleAdvice.adv_invalid){if((advice.immediate_follow_manouver==SimpleAdvice.adv_destination_reached)||(this.is_roundabout_advice(advice.immediate_follow_manouver)))advice_text+=" and ";else advice_text+=" then ";advice_text+=this.simple_advice_to_text(advice.immediate_follow_manouver)+" ";if(this.is_roundabout_advice(advice.immediate_follow_manouver))advice_text+=" from the roundabout"}return advice_text},get_poi_description:function(poi_type_ID,brand_name){switch(poi_type_ID){case NearbyPoiType.Poi_TouristInformation:return"tourist info center";case NearbyPoiType.Poi_HistoricalMonument:return"a historical monument (<i>"+brand_name+"</i>)";case NearbyPoiType.Poi_TouristAttraction:return"a tourist attraction (<i>"+brand_name+"</i>)";case NearbyPoiType.Poi_Institute:return"<i>"+brand_name+"</i> institute";case NearbyPoiType.Poi_Cinema:return"<i>"+brand_name+"</i> cinema";case NearbyPoiType.Poi_BusinessFacility:return"<i>"+brand_name+"</i> business facility";case NearbyPoiType.Poi_Hotel:return"<i>"+brand_name+"</i> hotel";case NearbyPoiType.Poi_Hotel2:return"<i>"+brand_name+"</i> hotel";case NearbyPoiType.Poi_Motel:return"<i>"+brand_name+"</i> motel";case NearbyPoiType.Poi_Restaurant:return"<i>"+brand_name+"</i> restaurant";case NearbyPoiType.Poi_CafePub:return"<i>"+brand_name+"</i> cafe";case NearbyPoiType.Poi_BanquetMarriageHall:return"<i>"+brand_name+"</i> banquet hall";case NearbyPoiType.Poi_ShoppingCenter:return"a shopping center";case NearbyPoiType.Poi_Market:return"a market";case NearbyPoiType.Poi_Stadium:return"a stadium";case NearbyPoiType.Poi_GolfCourse:return"a golf course";case NearbyPoiType.Poi_SportsCenter:return"a sports center";case NearbyPoiType.Poi_NaturePark:return"a park";case NearbyPoiType.Poi_Beach:return"a beach";case NearbyPoiType.Poi_GovernmentOffice:return"<i>"+brand_name+"</i> government office";case NearbyPoiType.Poi_PoliceStation:return"a police station";case NearbyPoiType.Poi_Embassy:return"<i>"+brand_name+"</i> embassy";case NearbyPoiType.Poi_FireStation:return"a fire station";case NearbyPoiType.Poi_Cemetary:return"a cemetary";case NearbyPoiType.Poi_Church:return"a church";case NearbyPoiType.Poi_Mosque:return"a mosque";case NearbyPoiType.Poi_Hindu:return"<i>"+brand_name+"</i>";case NearbyPoiType.Poi_Temple:return"a temple";case NearbyPoiType.Poi_Buddhist:return"<i>"+brand_name+"</i>";case NearbyPoiType.Poi_Sikh:return"<i>"+brand_name+"</i>";case NearbyPoiType.Poi_Jain:return"<i>"+brand_name+"</i>";case NearbyPoiType.Poi_Hospital:return"a hospital";case NearbyPoiType.Poi_Pharmacy:return"a pharmacy";case NearbyPoiType.Poi_Ambulance:return"an ambulance";case NearbyPoiType.Poi_BloodBank:return"a blood bank";case NearbyPoiType.Poi_Bank:return"<i>"+brand_name+"</i> bank";case NearbyPoiType.Poi_VehicleRepair:return"<i>"+brand_name+"</i> vehicle repair";case NearbyPoiType.Poi_PetrolStation:return"<i>"+brand_name+"</i> petrol station";case NearbyPoiType.Poi_Rentacar:return"<i>"+brand_name+"</i> rent-a-car";case NearbyPoiType.Poi_Parking:return"parking lot / garage";case NearbyPoiType.Poi_RailwayStation:return"a railway station";case NearbyPoiType.Poi_BusStation:return"a bus station";case NearbyPoiType.Poi_Airport:return"an airport";case NearbyPoiType.Poi_CarDealer:return"<i>"+brand_name+"</i> car dealer";case NearbyPoiType.Poi_Apartment:return"<i>"+brand_name+"</i>";case NearbyPoiType.Poi_HillStation:return"<i>"+brand_name+"</i>";case NearbyPoiType.Poi_RestaurantContinental:return"<i>"+brand_name+"</i> continental restaurant";case NearbyPoiType.Poi_FastFood:return"<i>"+brand_name+"</i> fast food restaurant";case NearbyPoiType.Poi_IndianRestaurant:return"<i>"+brand_name+"</i> Indian restaurant";case NearbyPoiType.Poi_OrientalRestaurant:return"<i>"+brand_name+"</i> Oriental restaurant";case NearbyPoiType.Poi_ShoppingOther:return"<i>"+brand_name+"</i>";case NearbyPoiType.Poi_Shopping:return"<i>"+brand_name+"</i> shopping center";case NearbyPoiType.Poi_ShoppingRetail:return"<i>"+brand_name+"</i>"}switch(poi_type_ID-(poi_type_ID%10)){case NearbyPoiType.Poi_Stadium:return"a stadium";case NearbyPoiType.Poi_Hotel:return"<i>"+brand_name+"</i> hotel";case NearbyPoiType.Poi_Hotel2:return"<i>"+brand_name+"</i> hotel";case NearbyPoiType.Poi_Motel:return"<i>"+brand_name+"</i> motel";case NearbyPoiType.Poi_Restaurant:return"<i>"+brand_name+"</i> restaurant";case NearbyPoiType.Poi_Restaurant:return"<i>"+brand_name+"</i> restaurant";case NearbyPoiType.Poi_Rentacar:return"<i>"+brand_name+"</i> rent-a-car";case NearbyPoiType.Poi_Pharmacy:return"a pharmacy";case NearbyPoiType.Poi_Hospital:return"a hospital";case NearbyPoiType.Poi_PetrolStation:return"<i>"+brand_name+"</i> petrol station";case NearbyPoiType.Poi_ShoppingCenter:return"a shopping center";case NearbyPoiType.Poi_VehicleRepair:return"<i>"+brand_name+"</i> vehicle repair";case NearbyPoiType.Poi_Embassy:return"<i>"+brand_name+"</i> embassy";case NearbyPoiType.Poi_Church:return"a church";case NearbyPoiType.Poi_CarDealer:return"<i>"+brand_name+"</i> car dealer";case NearbyPoiType.Poi_Bank:return"<i>"+brand_name+"</i> bank";case NearbyPoiType.Poi_Mosque:return"a mosque";case NearbyPoiType.Poi_Hindu:return"<i>"+brand_name+"</i>";case NearbyPoiType.Poi_Temple:return"a temple";case NearbyPoiType.Poi_Shopping:return"<i>"+brand_name+"</i> shopping center"}return"<i>"+brand_name+"</i>"},simple_advice_to_text:function(simpleAdvice){switch(simpleAdvice){case SimpleAdvice.adv_sharp_right:return"make <b>sharp right</b> turn";case SimpleAdvice.adv_right:return"turn <b>right</b>";case SimpleAdvice.adv_bear_right:return"<b>bear right</b>";case SimpleAdvice.adv_straight_ahead:return"continue <b>straight</b>";case SimpleAdvice.adv_bear_left:return"<b>bear left</b>";case SimpleAdvice.adv_left:return"turn <b>left</b>";case SimpleAdvice.adv_sharp_left:return"make <b>sharp left</b> turn";case SimpleAdvice.adv_turn_around:return"make <b>U-turn</b>";case SimpleAdvice.adv_enter_round_about:return"<b>enter</b> the roundabout";case SimpleAdvice.adv_round_about_1:return"take <b>1st</b> exit";case SimpleAdvice.adv_round_about_2:return"take <b>2nd</b> exit";case SimpleAdvice.adv_round_about_3:return"take <b>3rd</b> exit";case SimpleAdvice.adv_round_about_4:return"take <b>4th</b> exit";case SimpleAdvice.adv_round_about_5:return"take <b>5th</b> exit";case SimpleAdvice.adv_round_about_6:return"take <b>6th</b> exit";case SimpleAdvice.adv_round_about_7:return"take <b>7th</b> exit";case SimpleAdvice.adv_round_about_8:return"take <b>8th</b> exit";case SimpleAdvice.adv_take_highway_exit:return"<b>leave</b> the highway";case SimpleAdvice.adv_destination_reached:return"you will reach your destination"}return""},is_roundabout_advice:function(simpleAdvice){switch(simpleAdvice){case SimpleAdvice.adv_round_about_1:case SimpleAdvice.adv_round_about_2:case SimpleAdvice.adv_round_about_3:case SimpleAdvice.adv_round_about_4:case SimpleAdvice.adv_round_about_5:case SimpleAdvice.adv_round_about_6:case SimpleAdvice.adv_round_about_7:case SimpleAdvice.adv_round_about_8:return true}return false},get_orientation_text:function(orientation){switch(orientation){case WorldOrientation.Orientation_North:return"north";case WorldOrientation.Orientation_NorthEast:return"north-east";case WorldOrientation.Orientation_East:return"east";case WorldOrientation.Orientation_SouthEast:return"south-east";case WorldOrientation.Orientation_South:return"south";case WorldOrientation.Orientation_SouthWest:return"south-west";case WorldOrientation.Orientation_West:return"west";case WorldOrientation.Orientation_NorthWest:return"north-west"}return""},create_ordinal_string:function(ordinal_num){switch(ordinal_num){case 1:return"1st";case 2:return"2nd";case 3:return"3rd";case 4:return"4th";case 5:return"5th"}return""},lanes_name:function(lanes,dir){var name="";name+=dir;name+=" ";if(lanes>1){name+=lanes;name+=" lanes"}else{name+="lane"}return name},lane_num:function(lane){if(this.is_left_road_country){return this.lane_count-lane}return lane+1},get_lane_info:function(){var lanes,road_lanes,lmin,lmax,i,l,ret;road_lanes=this.lane_count;lanes=this.advice_lane_count;lmin=this.advice_lane(0)>>9;lmax=lmin;ret=" using ";for(i=1;i<lanes;i++){l=this.advice_lane(i)>>9;if(l>lmax)lmax=l;if(l<lmin)lmin=l}if(lmax+1-lmin==lanes){if(lmax==road_lanes-1){ret+=this.lanes_name(lanes,"the left")}else if(lmin==0){ret+=this.lanes_name(lanes,"the right")}else{lmin=this.lane_num(lmin);lmax=this.lane_num(lmax);ret+="lanes ";ret+=lmin<lmax?lmin:lmax;ret+=lanes>2?" to ":" or ";ret+=lmax>lmin?lmax:lmin}}else{ret+="lanes ";if(this.is_left_road_country){for(i=lanes-1;i>=0;i--){if((i==0)&&(i<lanes-1)){ret+=" or "}else if(i>0){ret+=", "}l=this.advice_lane(i)>>9;ret+=lanes-l}}else{for(i=0;i<lanes;i++){if((i==lanes-1)&&(i>0)){ret+=" or "}else if(i>0){ret+=", "}l=this.advice_lane(i)>>9;ret+=l}}}return ret},advice_lane:function(i){if(i<0||i>=this.masked_lane_info.length){return-1}return this.masked_lane_info[i]}};
