//Copyright © [Year(s)] Nokia Corporation and/or its subsidiary(-ies).

Fp.ConnectMenu={init:function(){this.setupEvents();this.setupVisuals();},setupVisuals:function(){this.toggleOneRow({element:Fp.byId("connectMenuCategory"),value:Fp.Lang.getCategLabel(Fp.POI.category.name),fillTheSame:true});this.toggleOneRow({element:Fp.byId("phone"),value:Fp.POI.contact.phone,elemToFill:Fp.byId("phone-value")});this.toggleOneRow({element:Fp.byId("website"),value:Fp.POI.contact.website});this.toggleOneRow({element:Fp.byId("email"),value:Fp.POI.contact.email});this.toggleOneRow({element:Fp.byId("rating"),value:Fp.POI.rating});this.toggleOneRow({element:Fp.byId("report-places"),value:(Fp.POI.isPlace&&Fp.POI.online)});},toggleOneRow:function(a){if(a&&a.element){if(!a.value){a.element.style.display="none";}else{a.element.style.display="block";if(a.elemToFill){a.elemToFill.innerHTML="";a.elemToFill.innerHTML=a.value;}if(a.fillTheSame===true){a.element.innerHTML="";a.element.innerHTML=a.value;}}}},setupEvents:function(){new Fp.Utils.addTapEvent({element:Fp.byId("phone"),onEvent:function(){Fp.Api.fireC2A({hook:Fp.Api.C2Aid.DIAL});},checkHeight:true});new Fp.Utils.addTapEvent({element:Fp.byId("rating"),onEvent:function(){Fp.Pages.showPage({name:Fp.Pages.PAGE.RATINGS});},checkHeight:true});new Fp.Utils.addTapEvent({element:Fp.byId("walk-to"),onEvent:function(){Fp.Api.fireC2A({hook:Fp.Api.C2Aid.WALK_TO});},checkHeight:true});new Fp.Utils.addTapEvent({element:Fp.byId("drive-to"),onEvent:function(){Fp.Api.fireC2A({hook:Fp.Api.C2Aid.NAVIGATE_TO});},checkHeight:true});new Fp.Utils.addTapEvent({element:Fp.byId("add-to-fav"),onEvent:function(){Fp.Api.fireC2A({hook:Fp.Api.C2Aid.SAVE_LANDMARK});},checkHeight:true});new Fp.Utils.addTapEvent({element:Fp.byId("website"),onEvent:function(){Fp.Api.fireC2A({hook:Fp.Api.C2Aid.BROWSE});},checkHeight:true});new Fp.Utils.addTapEvent({element:Fp.byId("send-place"),onEvent:function(){Fp.Api.fireC2A({hook:Fp.Api.C2Aid.SEND});},checkHeight:true});new Fp.Utils.addTapEvent({element:Fp.byId("email"),onEvent:function(){Fp.Api.fireC2A({hook:Fp.Api.C2Aid.MAILTO});},checkHeight:true});new Fp.Utils.addTapEvent({element:Fp.byId("add-to-route"),onEvent:function(){Fp.Api.fireC2A({hook:Fp.Api.C2Aid.ADD_TO_ROUTE});},checkHeight:true});new Fp.Utils.addTapEvent({element:Fp.byId("report-places"),onEvent:function(){Fp.Pages.showPage({name:Fp.Pages.PAGE.REPORTPLACE});Fp.Incident.prefillForms();},checkHeight:true});}};