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

Fp.Pages={PAGE:{RATINGS:"rating",MAIN:"main",REPORTPLACE:"reportplace",PREMIUM_DETAIL:"premium",OWNER_CONTENT:"ownercontent",REPORTPLACE:"reportplace",REPORTLOCATION:"reportlocation",REPORTINFORMATION:"reportinfo",REPORTINAPPROPRIATE:"reportinappropriate",LISTSELECTION:"listSelection",GALLERY:"detailGallery"},iframeOpen:false,pageData:null,history:[],open:function(a){if(a&&a.name){this.showPage(a);}},showPage:function(d){if(!d){return;}this.hideAllElements();var c=Fp.byId("premiumContentIFrame");if(c){c.onload=undefined;}if(this.pageData&&!d.fromHistory){this.history.push(this.pageData);}if(d.name){switch(d.name){case this.PAGE.MAIN:this.history=[];Fp.byId("page").style.display="block";Fp.byId("main").style.display="block";Fp.byId("connect-menu-panel").style.display="block";if(!Fp.POI.premiumContent&&!Fp.POI.isAdPlace){Fp.byId("connect-menu-panel").style.height="";Fp.byId("main").className="nopremium";}else{Fp.byId("premium-panel").style.display="block";Fp.byId("premium-small").style.display="block";Fp.byId("connect-menu-panel").style.width="";Fp.byId("premiumContainer").className="premium-container";Fp.byId("main").className="";}var b=Fp.Marquee.addStringEllipsis(Fp.byId("header-name")),a=Fp.Marquee.addStringEllipsis(Fp.byId("header-address")),e=Fp.byId("header");Fp.Marquee.animateString(Fp.byId("header-name"));Fp.Marquee.animateString(Fp.byId("header-address"));e.className=e.className.replace("truncated","");if(b||a){e.className+=" truncated";}break;case this.PAGE.OWNER_CONTENT:Fp.byId("main").style.display="block";Fp.byId("owner-content").style.display="block";break;case this.PAGE.PREMIUM_DETAIL:Fp.Popup.showLoader();c.src=d.url;c.onload=function(){Fp.Pages.iframeOpen=true;Fp.Popup.hideLoader(true);c.style.visibility="visible";c.style.height="100%";c.style.zIndex=10000;c.onload=undefined;};break;case this.PAGE.RATINGS:Fp.byId("ratepage").style.display="block";Fp.Marquee.addStringEllipsis(Fp.byId("ratepage-address"));Fp.Marquee.animateString(Fp.byId("ratepage-address"));break;case this.PAGE.REPORTPLACE:Fp.byId("reportpage").style.display="block";break;case this.PAGE.REPORTLOCATION:Fp.byId("reportlocation").style.display="block";break;case this.PAGE.REPORTINFORMATION:Fp.byId("reportinformation").style.display="block";break;case this.PAGE.REPORTINAPPROPRIATE:Fp.byId("reportInappropriate").style.display="block";break;case this.PAGE.LISTSELECTION:Fp.byId("listSelection").style.display="block";break;case this.PAGE.GALLERY:Fp.byId("detail-gallery").style.display="block";break;}}this.pageData=d;},back:function(){if(Fp.Popup&&Fp.Popup.isOpen){Fp.Popup.close();return;}var a=this.history.pop();if(!a){Fp.Api.fireC2A({hook:Fp.Api.C2Aid.PREV_VIEW});}else{if(a.backCallback){a.backCallback();}else{if(a.name){a.fromHistory=true;Fp.Pages.showPage(a);}}}},hideAllElements:function(){this.iframeOpen=false;Fp.byId("ajax-loader").style.display="none";Fp.byId("main").style.display="none";Fp.byId("ratepage").style.display="none";Fp.byId("reportpage").style.display="none";Fp.byId("reportlocation").style.display="none";Fp.byId("reportinformation").style.display="none";Fp.byId("connect-menu-panel").style.display="none";Fp.byId("premium-small").style.display="none";Fp.byId("premium-panel").style.display="none";Fp.byId("owner-content").style.display="none";Fp.byId("listSelection").style.display="none";Fp.byId("reportInappropriate").style.display="none";Fp.byId("detail-gallery").style.display="none";if(Fp.Popup&&Fp.Popup.isOpen){Fp.Popup.close();}var a=Fp.byId("premiumContentIFrame");if(a){a.style.visibility="hidden";a.style.height="0px";a.style.zIndex=-1;}Fp.isSplash=false;}};