//Copyright © [Year(s)] Nokia Corporation and/or its subsidiary(-ies).
Fp.Menu.Navigate={elemIdPrefix:"menu-navigate-",buttons:[{name:"walk",hook:Fp.Api.C2Aid.WALK_TO,trackingFunc:"walkToClicked"},{name:"drive",hook:Fp.Api.C2Aid.NAVIGATE_TO,trackingFunc:"driveToClicked"},{name:"add",hook:Fp.Api.C2Aid.ADD_TO_ROUTE,trackingFunc:"addToRouteClicked"}],init:function(){this.setupEvents(this.fireAction);},setupEvents:function(c){if(typeof c!=="function"){return false;}for(var b=0,a=this.buttons.length;b<a;b++){new Fp.Utils.Events.addTapEvent({element:Fp.byId(this.elemIdPrefix+this.buttons[b].name),onEvent:Fp.Utils.bind(c,this,[this.buttons[b]])});}},fireAction:function(b){if(!b||!b.hook){return false;}var a=b.func||function(){Fp.Api.fireC2A({hook:b.hook});};if(b.trackingFunc&&Fp.Tracking.trackingOn){Fp.Tracking.track(b.trackingFunc,{callback:function(){a();}});}else{a();}}};