//Copyright © [Year(s)] Nokia Corporation and/or its subsidiary(-ies).
Fp.Menu.Report={settings:{SYS_ID:"PlacesUI",CNT_TYPE:"PLACE"},init:function(){this.setupEvents();},setupEvents:function(){this.NotExist.setupEvents();this.WrongLocation.setupEvents();this.IncorrectInformation.init();this.Inappropriate.init();this.Duplicate.init();},showPage:function(){Fp.Pages.showPage({name:Fp.Pages.PAGE.REPORT});Fp.Menu.Report.IncorrectInformation.loadCategories();},initIncident:function(a){var b={incident:{contentType:Fp.Menu.Report.settings.CNT_TYPE,inlineContent:Fp.POI.placeId,incidentReporter:{originatorCountry:Fp.Settings.s60country,originatorId:Fp.Settings.s60ncim,karma:"",subOriginatorId:""},systemId:Fp.Menu.Report.settings.SYS_ID,reportType:a.reportType}};if(a.reportValue){b.incident.reportValue=a.reportValue;}return b;},sendIncident:function(b){Fp.Popup.show({name:Fp.Popup.NAME.LOADER});var c={url:Fp.Settings.mdURL,method:Fp.Ajax.Method.POST,onSuccess:Fp.Utils.bind(this.sendOk,this),onFailure:Fp.Utils.bind(this.sendFail,this),onTimeout:Fp.Utils.bind(this.sendFail,this),timeout:5};var a=new Fp.Ajax.Request(c);setTimeout(function(){a.sendJSON(b);},1);},sendOk:function(a,b){Fp.Popup.show({name:Fp.Popup.NAME.MESSAGE,message:Language["places.report.submittedMsg"]+". "+Language["places.report.thanksMsg"],timeout:2});Fp.Pages.showPage({name:Fp.Pages.PAGE.MAIN,fromHistory:true});Fp.Menu.Report.close();Fp.Tracking("placeReported",this.type);},sendFail:function(a,b){Fp.Popup.show({name:Fp.Popup.NAME.QUESTION,headerText:Language["places.report.errorMsg"],subText:Language["places.tryagain"],onYes:Fp.Utils.bind(this.post,this),onNo:Fp.Popup.hide});},close:function(){if(Fp.byId("reportDuplicateDetails").value!=""){Fp.byId("reportDuplicateDetails").value="";}}};