//Copyright © [Year(s)] Nokia Corporation and/or its subsidiary(-ies).
Fp.Modules.OwnerContent={init:function(){Fp.Gallery.init();},load:function(){this.data=Fp.POI.ownerContent;this.fillShortDescription(this.data);this.fillContent("description",this.data.description,this.data.languageOfDescription);this.fillContent("placename",Fp.POI.name);this.fillContent("opening-hours",this.prepareOpeningHours(this.data));this.fillContent("annual-closing",this.prepareAnnualClosing(this.data));this.fillContent("payment-methods",this.preparePaymentMethods(this.data));this.fillContent("opening-notes",this.data.openingNotes);this.fillContent("fax",this.data.fax);this.fillContent("phone",this.data.mobilePhone);this.fillContent("providedby",this.prepareProvidedBy(this.data));if(this.data.gallery){Fp.Gallery.load(this.data.gallery);}else{Fp.Gallery.hideGalleryThumbnails();}},setupEvents:function(){new Fp.Utils.Events.addTapEvent({element:Fp.byId("owner-content-more-info"),onEvent:Fp.Utils.bind(this.maximise,this)});new Fp.Utils.Events.addTapEvent({element:Fp.byId("owner-content-short-description"),onEvent:Fp.Utils.bind(this.maximise,this)});},fillContent:function(a,b,c){if(false==!!b){Fp.Utils.addClass(Fp.byId("owner-content-"+a+"-container"),"hide");return false;}if(c){if(Fp.Lang.isLangRTL(c)){Fp.Utils.addClass(Fp.byId("owner-content-"+a+"-container"),"isRTL");}else{Fp.Utils.removeClass(Fp.byId("owner-content-"+a+"-container"),"isRTL");}}Fp.byId("owner-content-"+a).innerHTML=b;Fp.Modules.toggleLoader();Fp.Utils.removeClass(Fp.byId("owner-content-"+a+"-container"),"hide");},prepareOpeningHours:function(b){if(!b.openingHours){return false;}var a=b.openingHours,d=[],c;for(c in a){d.push(a[c].dayOfWeek);d.push(" - ");d.push(a[c].openFrom);d.push(" / ");d.push(a[c].openTo);d.push("<br/>");}return d.join("");},preparePaymentMethods:function(a){if(!a.paymentMethods||!a.paymentMethods.paymentMethod){return false;}var c=[],b;for(b in a.paymentMethods.paymentMethod){c.push(a.paymentMethods.paymentMethod[b].name);}if(c.length>0){return c.join("");}return false;},prepareAnnualClosing:function(a){if(!a.annualClosings){return false;}var c=[],b;for(b in a.annualClosings){c.push(a.annualClosings[b].closedFrom);c.push(" - ");c.push(a.annualClosings[b].closedTo);c.push("<br />");}if(c.length>0){return c.join("");}return false;},prepareProvidedBy:function(a){if(!a.provider){return false;}var c,b=[Language["places.providedBy"],": ",a.provider];if(a.providerUrl){c=Fp.Settings.nativeGoToUrl+encodeURI(a.providerUrl);b=[Language["places.providedBy"],' <a dir="ltr" href="',c,'">',a.provider,"</a>"];}if(b.length>0){return b.join("");}return false;},fillShortDescription:function(a){if(!this.data.gallery){Fp.Utils.addClass(Fp.byId("owner-content-short-description"),"no-gallery");}else{Fp.Utils.removeClass(Fp.byId("owner-content-short-description"),"no-gallery");}return Fp.Utils.addTruncatedString({element:Fp.byId("owner-content-short-description"),text:a.description});},maximise:function(){Fp.byId("OwnerContent-gallery-max").insertBefore(Fp.Gallery.thumbnailHolder,Fp.byId("detail-gallery-thumbcount"));Fp.Modules.maximise();Fp.Tracking.track("moreInformation");},minimise:function(){this.refresh();Fp.Modules.minimise();},refresh:function(){Fp.byId("OwnerContent-gallery-min").appendChild(Fp.Gallery.thumbnailHolder);}};