window._hzlang = window._hzlang || {};
window.hzmr = window.hzmr || [];
/************* Start extracting text for spaceActions.js for locale en-GB **************/
(function(){var _hzxt={"Want to see what other Houzzers are working on?":"Want to see what other Houzz users are working on?"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for spaceActions.js  **************/
/************* Start spaceActions.js for locale en-GB **************/
try {function showAddToMyGalleryForm(e){}function showPostToForumForm(e,t){}function showAprilFoolsDialog(){HZ.spaceActions.AprilFoolsDialog||(HZ.spaceActions.AprilFoolsDialog=new HZ.spaceActions.AprilFoolsClass,HZ.spaceActions.AprilFoolsDialog.prepare()),HZ.ui.Yamdi.show(HZ.spaceActions.AprilFoolsDialog)}function showEmbedDialog(e){HZ.spaceActions.EmbedDialog.setSpaceId(e),HZ.ui.Yamdi.show(HZ.spaceActions.EmbedDialog)}HZ.ns("HZ.spaceActions"),HZ.spaceActions.QuestionDialog=new function(){var i,o,e,n,t,s,a=0,l=1,r=2,d=3,c=null,u=null,p=null,h=!1,g=!1,m=null,v="quotaReached";this.SPACE_TOPIC=14,this.PRODUCT_TOPIC=17,this.JSON_KEY_DAILY_QUESTIONS_QUOTA_EXCEEDED=null,this.JSON_KEY_SPACE_ID=null,this.JSON_KEY_QUESTIONS=null;var H=this.SPACE_TOPIC,f=_hgt("Ask a question about this photo.")+" ",b=_hgt("Ask a question about this product.")+" ",Z=_hgt("Your question was posted."),I=(_hgt("Write your question here. (ex: Love the chair! Where is it from?)"),_hgt("Write your question here. (ex: Love the chair! What is it made of?)"),"<div id='questionDialog_"+a+"'><div class='dialogTitle'>"+f+"</div><div class='dialogBody'><div class='dialogCenterCaption'>"+_hgt("Please wait...")+HZ.ui.AjaxThrobber.getThrobber()+"</div><div class='dialogControls'></div></div></div>"),S="<div id='questionDialog_"+l+"'><div class='dialogTitle'>"+f+"</div><div class='dialogBody'><div class='dialogStatus' id='questionQuotaExceeded'>"+_hgt("You've reached the maximum number of questions permitted per day. Please visit us again tomorrow if you have more questions.")+"</div><div class='dialogCaption' id='questionsListCaption'>"+_hgt("The answer you need may already be here:")+"</div><div class='dialogList' id='questionsList'></div><div class='dialogControls'></div></div></div>",A="<div id='questionDialog_"+r+"'><div class='dialogTitle'>"+f+"</div><div class='dialogBody'><form id='askQuestionForm' name='postToForumForm' action='javascript:;'><div class='dialogStatus' id='questionFormError'></div><div><input class='form-control' id='askQuestionInputTitle' type='text' maxlength='70' placeholder='"+_hgt("Write your question here. (ex: Love the chair! Where is it from?)")+"'></div><div><textarea class='form-control' id='askQuestionInputComment' placeholder='"+_hgt("Tell us the details here.")+"'></textarea></div><div id='questionsGuidelines'><div id='questionGuidelinesBody'>"+_hgt("Pros on Houzz are encouraged but not obligated to answer questions.<br/>Polite questions are more likely to receive responses.")+"</div></div><input type='submit' style='display:none'/><div class='dialogControls'></div></form></div></div>",_="<div id='questionDialog_"+d+"'><div class='dialogTitle'>"+Z+"</div><div class='dialogBody'><div id='askQuestionConfirmationMessage' class='pll prl'></div><div class='dialogControls'></div></div></div>";function y(){return H==HZ.spaceActions.QuestionDialog.PRODUCT_TOPIC}function w(e){var t="questionDialog_"+e;u.children().each(function(e){this.style.display=this.id==t?"block":"none"}),p.center()}function C(){p.hide(null)}function E(e){HZ.ui.AjaxThrobber.setInCall(!1),e.success&&(e[HZ.spaceActions.QuestionDialog.JSON_KEY_DAILY_QUESTIONS_QUOTA_EXCEEDED]||0<e[HZ.spaceActions.QuestionDialog.JSON_KEY_QUESTIONS].length?function(e){for(var t=e[HZ.spaceActions.QuestionDialog.JSON_KEY_QUESTIONS],e=(e[HZ.spaceActions.QuestionDialog.JSON_KEY_SPACE_ID],e[HZ.spaceActions.QuestionDialog.JSON_KEY_DAILY_QUESTIONS_QUOTA_EXCEEDED]),i="<ul>",o=0;o<t.length;o++){var s=t[o],a=parseInt(s.numberOfAnswers,10);switch(i+="<li><a href='javascript:HZ.spaceActions.QuestionDialog.openQuestionPage("+s.questionId+")'>"+s.title+"</a>",0<a&&(i+=" <span class='reply'>("),parseInt(s.numberOfAnswers,10)){case 0:break;case 1:i+=_hgt("1 reply");break;default:i+=_hgt("{replyCount} replies",{replyCount:s.numberOfAnswers})}0<a&&(i+=")</span>")}i+="</ul>",$("#questionsList").empty().append(i),$("#questionsListCaption")[0].style.display=0<t.length?"block":"none",$("#questionQuotaExceeded")[0].style.display=e?"block":"none",n[0].style.display=e?"none":"inline",w(l)}(e):D())}function k(e){$("#questionFormError").empty().append(e),e?$("#questionFormError").show():$("#questionFormError").hide(),$("[placeholder]","#askQuestionDialog").initPlaceHolders("refresh")}function D(){w(r)}function T(){if(!HZ.ui.AjaxThrobber.isInCall()){$("#askQuestionDialog").trigger("submit.question");var e=UIHelper.trim(i.value),t=UIHelper.trim(o.value);return""==e?k(_hgt("Please write your question.")):(HZ.ui.AjaxThrobber.setInCall(!0),$("#space-action__submit-question-button").attr("disabled","disabled"),HZ.ajaz.Services.postToForum(c,e,t,H,$.proxy(U,this))),!1}}function U(e){var t;$("#space-action__submit-question-button").removeAttr("disabled"),HZ.ui.AjaxThrobber.setInCall(!1),"true"==e.success?(t=_hgt("More questions about your project or decor?"),e[v]&&(t="<div class='overQuota'>"+_hgt("Please note: You have reached the maximum number of questions permitted per day.")+"</div>"+t),$("#askQuestionConfirmationMessage").empty().append(t),null!=m&&HZ.utils.Logger.sendEventLogOnce(m),w(d)):(HZ.ui.Yamdi.hide(this),HZ.ui.yamdi.Common.alert(e.error))}this.init=function(e,t){c=e},this.setDelegate=function(e){p=e},this.setTrackingEventSource=function(e){m=e},this.setShowLinkOnNewWindow=function(e){h=e},this.setQuestionTopic=function(e){H=e},this.setQuestionUpsellLink=function(e){s=e},this.openQuestionPage=function(e){e=HZ.utils.Links.getQuestionLink(e);h?window.open(e):window.location=e},this.getView=function(){return u||(u=$("<div id='askQuestionDialog'></div>").addClass("dialogFrame").append(I).append(S).append(A).append(_),e=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Submit"),"space-action__submit-question-button",$.proxy(T,this)),n=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("I have another question"),"",$.proxy(D,this)),t=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Go to Advice"),null,function(){window.location.href=s},null,null,"seeWorkButton"),$("body").append(u),$("#questionDialog_"+a+" .dialogControls",u).append(HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),null,null,null,null,"cancelButton")),$("#questionDialog_"+l+" .dialogControls",u).append(HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),null,null,null,null,"cancelButton")).append(n),$("#questionDialog_"+r+" .dialogControls",u).append(HZ.ui.AjaxThrobber.getThrobber()).append(HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),null,null,null,null,"cancelButton")).append(e),$("#questionDialog_"+d+" .dialogControls",u).append(HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("No Thanks"),null,null,null,null,"cancelButton")).append(t),$(".cancelButton",u).click($.proxy(C,this)),i=$("#askQuestionInputTitle")[0],$("#askQuestionInputTitle").charCount({css:"counter text-xs",counterElement:"div",allowed:70,prewarning:20,warning:10,counterText:_hgt("Characters Left")+" "}),o=$("#askQuestionInputComment")[0]),u},this.viewLoaded=function(){k(""),i.value="",$(i).trigger("change"),o.value="",HZ.ui.AjaxThrobber.setInCall(!1),g?$("[placeholder]","#askQuestionDialog").initPlaceHolders("refresh"):(g=!0,$("[placeholder]","#askQuestionDialog").initPlaceHolders({saveContainer:"#askQuestionDialog",saveEvent:"submit.question"}));var e=y()?b:f;y();HZ.utils.Config.isResponsive&&$("#askQuestionInputTitle").attr("placeholder",_hgt("Title")),$("#questionDialog_"+a+" .dialogTitle",u).html(e),$("#questionDialog_"+l+" .dialogTitle",u).html(e),$("#questionDialog_"+r+" .dialogTitle",u).html(e),y()?$("#questionsGuidelines").hide():$("#questionsGuidelines").show(),function(){w(a),HZ.ui.AjaxThrobber.setInCall(!0),HZ.spaceActions.getExistingQuestions(c,$.proxy(E,this))}()},this.viewUnloaded=function(){}},HZ.spaceActions.DontPrintDialog=new function(){var o=null,t=null,i="photo";this.setDelegate=function(e){0},this.lastInvokedDate=function(){return t},this.setLastInvokedDate=function(e){t=e},this.setPrintSubject=function(e){i=e},this.getPrintSubject=function(){return i},this.daysElapsedFromToday=function(){var e=this.currentDateAsTimestamp(),t=new Date(this.lastInvokedDate()),t=Math.abs(e-t);return Math.floor(t/864e5)},this.currentDateAsTimestamp=function(){return(new Date).getTime()},this.checkUserPref=function(t,i,e){!this.lastInvokedDate()||1<this.daysElapsedFromToday()?(this.setPrintSubject(e),this.setLastInvokedDate(this.currentDateAsTimestamp()),HZ.ajaz.Services.updateUserPreferences(15,null,function(e){}),HZ.utils.Logger.sendEventLog("dpd_shown"),HZ.ui.Yamdi.show(HZ.spaceActions.DontPrintDialog,null),(e=$("#continueToPrint"))&&e.click(function(e){HZ.utils.Logger.sendEventLog("dpd_print"),HZ.ui.Yamdi.hide(null),HZ.utils.Print.printUrl(t,i)})):HZ.utils.Print.printUrl(t,i)},this.getView=function(){var e,t,i;return o||(i=t=e="",i="photo"==this.getPrintSubject()?(e=_hgt("Print Photo"),t=_hgt("Help the environment by sharing this photo another way:"),_hgt("No thanks. Please print this photo")):(e=_hgt("Print Ideabook"),t=_hgt("Help the environment by sharing this ideabook another way:"),_hgt("No thanks. Please print this ideabook")),o=$("<div id='dontPrintDialog'>").addClass("dialogFrame").append("<div class='dialogTitle'><span id='dontPrintTitleIcon'></span>"+e+"</div><div class='dialogBody'><div class='dialogSection'><div class='dialog-section-header'>"+t+"</div><div id='emailSection' class='dialogSection-item'><div class='image-container'><a href='javascript:;' onclick=sendMail()> <div id='emailIcon'></div><p class='image-caption colorLink' href='javascript:;'>"+_hgt("Email{contextEmailVerb}",{"context.emailVerb":""})+"</p><p class='secondary-caption'>"+_hgt("Send it now")+"</p></a></div></div><div id='downloadAppSection' class='dialogSection-item'><div class='image-container'><a href='"+HZ.utils.Links.getPageUrl("mobileApps")+"'><div id='downloadAppIcon'></div><p class='image-caption colorLink' href='javascript:;'>"+_hgt("Houzz App")+"</p><p class='secondary-caption'>"+_hgt("Take it with you")+"</p></a></div></div></div><div class='dialogControls'><a id='continueToPrint' class='colorLink' href='javascript:;'>"+i+"</a></div></div></div>"),$("body").append(o)),o},this.viewLoaded=function(){},this.viewUnloaded=function(){},sendMail=function(){HZ.ui.Yamdi.hide(null),"function"==typeof showSendEmailDialog?showSendEmailDialog():HZ.lb.plugins.SpaceActions.handleEmail()}},HZ.spaceActions.PhotoOverlay=new function(){var e=null;this.getPromoView=function(){return e=e||$("<div class='wrapper-block'><div class='wrapper-table'><div class='wrapper-cell'><div id='signup_overlay' class='promote' data-type='hover'><span class='likeIt icon-wrap'>"+_hgt("Save Photo")+"<span class='more-icon'></span></span><br/></div></div></div></div>")},this.assembleOverlayElements=function(){var e=[];return null===HZ.data.CurrentSessionUser&&e.push(this.getPromoView()),e}},HZ.spaceActions.AprilFoolsClass=function(){var t={"":HZ.utils.Config.siteBaseUrl+"/ideabooks/46342399",uk:HZ.utils.Config.siteBaseUrl+"/ideabooks/46510556",au:HZ.utils.Config.siteBaseUrl+"/ideabooks/46495938",ru:HZ.utils.Config.siteBaseUrl+"/ideabooks/46510315",de:HZ.utils.Config.siteBaseUrl+"/ideabooks/46510299",fr:HZ.utils.Config.siteBaseUrl+"/ideabooks/46511131/list/pt=61d4bbfda7043bdc1366aa98c362bbd1/houzzlenz-une-nouvelle-facon-de-voir-votre-interieur"};function i(){this.getDelegate().hide(null)}HZ.spaceActions.AprilFoolsClass.superclass.constructor.call(this),this.prepare=function(){var e=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Done"),_hgt("cancel"),$.proxy(i,this)),e={body:$("<div>").append(HZ.utils.Html.template("<h1 class='header-1'>%MAIN_HEADER%\t\t\t\t\t\t<a href='javascript:void(0);' onclick='HZ.spaceActions.AprilFoolsDialog.closeDiag(); return false;'><span class='closeButton hzi-font hzi-CloseX'></span></a>\t\t\t\t\t</h1>\t\t\t\t\t<h2 class='header-5 houzzlenz-subheader'>%SUB_HEADER%</h2>\t\t\t\t\t<iframe width='640' height='385' src='%VIDEO_LINK%' allowTransparency='true' frameborder='0' webkitAllowFullScreen allowfullscreen></iframe>\t\t\t\t\t<div class='ideabook-link-container'>\t\t\t\t\t\t<a href='%HOUZZ_LENZ_IDEABOOK_LINK%' class='hzBtn primary ideabook-btn'>%IDEABOOK_LINK_LABEL%</a>\t\t\t\t\t</div>",{SUB_HEADER:_hgt("The New Way To Design And Experience Your Home"),HOUZZ_LENZ_IDEABOOK_LINK:t[HZ.utils.Config.currentSite],VIDEO_LINK:"//www.youtube.com/embed/HYIKDcMwreY?modestbranding=1&controls=1&showinfo=0&rel=0&fs=1&wmode=opaque",IDEABOOK_LINK_LABEL:_hgt("Pre-order Now"),MAIN_HEADER:_hgt("Announcing HouzzLenz")})),dialogClassName:"embedPhotoDialog aprilFoolsDialog",controls:[e],onViewLoaded:$.proxy(this.onViewLoaded,this)};this.init(e)},this.closeDiag=function(){$.proxy(i,this)()}},HZ.extend(HZ.spaceActions.AprilFoolsClass,HZ.ui.yamdi.Dialog),HZ.spaceActions.EmbedDialogClass=function(){var i,o,t=null,s="<div class='dialogCaption'>"+_hgt("Copy this code to embed this photo on your site:")+"</div><div class='dialogCaption' style='margin-top:10px;'>"+_hgt("Large Image (500 pixels):")+"</div><textarea onclick='this.select()' readonly='readonly' class='embedPhoto500 form-control'></textarea><div class='dialogCaption' style='margin-top:10px;'>"+_hgt("Small Image (320 pixels):")+"</div><textarea onclick='this.select()' readonly='readonly' class='embedPhoto320 form-control'></textarea><div class='dialogCaption' style='margin-top:10px;'>"+_hgt("WordPress <t1>Shortcode</t1>:",{t1:{tag:"a",attr:{href:HZ.utils.Links.getPageUrl("buttonsAndBadges")+"#shortcode"}}})+"</div><textarea onclick='this.select()' readonly='readonly' class='embedShortcode form-control'></textarea><div class='dialogCaption' style='margin-top:10px;font-size:12px;color:#a4a4a4;'>"+_hgt('This tool is provided to you "as is" and subject to <t1>Houzz terms of use</t1>',{t1:{tag:"a",attr:{href:HZ.utils.Links.getPageUrl("termsOfUse"),target:"_blank"}}})+"</div>";function a(){this.getDelegate().hide(null)}function e(e){e.success&&(i.val(e.largeImageEmbedCode),o.val(e.smallImageEmbedCode),shortcodeTextarea.val(e.wordpressShortcode))}HZ.spaceActions.EmbedDialogClass.superclass.constructor.call(this),this.prepare=function(){var e=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Done"),_hgt("cancel"),$.proxy(a,this)),t=$("<div>").append(s);i=$(".embedPhoto500",t),o=$(".embedPhoto320",t),shortcodeTextarea=$(".embedShortcode",t);e={title:_hgt("Embed a Photo"),body:t,dialogClassName:"embedPhotoDialog",controls:[e],onViewLoaded:$.proxy(this.onViewLoaded,this)};this.init(e)},this.setSpaceId=function(e){t=e},this.onViewLoaded=function(){i.val(""),o.val(""),shortcodeTextarea.val(""),HZ.ajaz.Services.getEmbedSpaceCode(t,$.proxy(e,this))}},HZ.extend(HZ.spaceActions.EmbedDialogClass,HZ.ui.yamdi.Dialog),HZ.spaceActions.EmbedDialog=new HZ.spaceActions.EmbedDialogClass,HZ.spaceActions.EmbedDialog.prepare(),HZ.spaceActions.handleButtonClick=function(e,t){var i=e.closest(".ic"),o=e.closest("[lb-sid]"),s=e.data("sid");if(!s)if(o.length)s=o.attr("lb-sid");else if(i.length)s=i.attr("objid");else{i=e.closest(".feed-snapshot-placeholder").find("img[lb-sid]");if(!i.length)return;s=i.attr("lb-sid")}e=e.data("type");t.isCobrand?window.location=t.cobrandRedirectUrl:HZ.spaceActions.invokeSignupAndThenActionDialog(s,e,t.emailShareAfterSignup)},HZ.spaceActions.invokeSignupAndThenActionDialog=function(t,i,o){var e,s;t&&i&&(HZ.data.CurrentSessionUser?"ideabook"===i||"hover"===i?HZ.spaceActions.showAddToIdeabookDialog(t):"email"===i&&HZ.spaceActions.showEmailDialog(t,!0):(s=null,(e=HZ.data.Spaces.get(t))&&e.iids&&e.iids[0]&&(s=e.iids[0]),s=JSON.stringify({houseId:t,redirectUrl:window.location.href,imageId:s,buttonType:i}),"email"!==i||o?HZ.ajaz.Services.setVisitorProperty("postSignupHouseId",s,function(e){"ideabook"===i||"hover"===i?HZ.auth.Manager.signup(HZ.spaceActions.addToIdeabookSignupSource,HZ.spaceActions.addToIdeabookMessageId,window.location.href):"email"===i&&HZ.auth.Manager.signup(HZ.spaceActions.spaceActionsEmailSignupSource,HZ.spaceActions.spaceActionsEmailMessageId,window.location.href)}):HZ.ajaz.Services.setVisitorProperty("postSignupHouseId",s,function(e){HZ.spaceActions.showEmailDialog(t,o)})))},HZ.spaceActions.showAddToIdeabookDialog=function(e){var t,i,o=HZ.data.Spaces.get(e);HZ.data.CurrentSessionUser?HZ.spaceActions.isUniversalGalleryEnabled||HZ.ctx&&HZ.ctx.config&&HZ.ctx.config.GALLERY_ITEMS_ENABLED?o.prod?HZ.modules.SaveToUniversalGallery.saveProduct(e):HZ.modules.SaveToUniversalGallery.saveSpace(e):(HZ.spaceActions.AddToIdeabookDialog.init(e),HZ.ui.Yamdi.show(HZ.spaceActions.AddToIdeabookDialog)):(i=null,t=window.location.href,o&&o.iids&&o.iids[0]&&(i=o.iids[0]),i=JSON.stringify({houseId:e,redirectUrl:t,imageId:i,buttonType:"ideabook"}),HZ.ajaz.Services.setVisitorProperty("postSignupHouseId",i,function(e){HZ.auth.Manager.signup(HZ.spaceActions.addToIdeabookSignupSource,HZ.spaceActions.addToIdeabookMessageId,t)}))},HZ.spaceActions.showEmailDialog=function(e,t){var i,o,s=null;HZ.data&&HZ.data.Spaces&&(s=HZ.data.Spaces.get(e)),!HZ.data.CurrentSessionUser&&t?(o=null,i=window.location.href,s&&s.iids&&s.iids[0]&&(o=s.iids[0]),o=JSON.stringify({houseId:e,redirectUrl:i,imageId:o,buttonType:"email"}),HZ.ajaz.Services.setVisitorProperty("postSignupHouseId",o,function(e){HZ.auth.Manager.signup(HZ.spaceActions.spaceActionsEmailSignupSource,HZ.spaceActions.spaceActionsEmailMessageId,i)})):s&&(HZ.dialogs.EmailDialog.prepare({type:HZ.sendEmail.types.SPACE,referenceId:s.id,subject:s.t,message:s.prod?HZ.sendEmail.texts.DEFAULT_MESSAGE_PRODUCT:HZ.sendEmail.texts.DEFAULT_MESSAGE_SPACE,staticMessageData:!(!s.prod||!HZ.lb.Config.tradeUser)&&HZ.lb.Config.tradeUser,signupOnSend:!t}),HZ.ui.Yamdi.show(HZ.dialogs.EmailDialog))},HZ.spaceActions.Share={GOOGLE_PLUS:HZ.utils.Config.socialSharePlatforms.googlePlus,FACEBOOK:HZ.utils.Config.socialSharePlatforms.facebook,TWITTER:HZ.utils.Config.socialSharePlatforms.twitter,LINKEDIN:HZ.utils.Config.socialSharePlatforms.linkedIn,VKONTAKTE:HZ.utils.Config.socialSharePlatforms.vkontakte,ODNOKLASSNIKI:HZ.utils.Config.socialSharePlatforms.odnoklassniki,LINE:HZ.utils.Config.socialSharePlatforms.line,openShareWindowForSpace:function(e,t){var i,o,s,a,n,l,r="",d="";HZ.data&&HZ.data.Spaces&&(l=HZ.data.Spaces.get(t))&&(a=HZ.utils.Links.getSpaceLink(l.id),n=l.t,d=l.c,e==this.FACEBOOK&&(i=HZ.utils.Styles.getStyleUrl(l.s),t=HZ.data.Categories.getCategoryById(l.cat),o=l.ma,s=HZ.data.Users.get(l.ow),i&&(n+=" - "+i),t&&(n+=" - "+t.name),o&&(n+=" - "+o),s&&(n+=_hgt(" - by {owner}",{owner:s.d})),r="",o=HZ.utils.Links.getFbFeedRedirectLink(),s="popup"),this.openShareWindow(e,a,n,r,o,s,d))},openShareWindow:function(e,t,i,o,s,a,n){var l;switch(n=n||"",e){case this.FACEBOOK:l="https://www.facebook.com/dialog/feed?app_id="+HZ.utils.Config.fbAppId+"&link="+encodeURIComponent(t)+"&caption="+encodeURIComponent(o)+"&name="+encodeURIComponent(i)+"&redirect_uri="+encodeURIComponent(s)+"&display="+encodeURIComponent(a)+"&description="+encodeURIComponent(n);break;case this.TWITTER:l="http://twitter.com/intent/tweet?url="+encodeURIComponent(t)+"&text="+encodeURIComponent(i);break;case this.GOOGLE_PLUS:l="https://plus.google.com/share?url="+encodeURIComponent(t);break;case this.LINKEDIN:l="http://www.linkedin.com/shareArticle?mini=true&url="+encodeURIComponent(t)+"&title="+encodeURIComponent(i)+"&summary="+encodeURIComponent(o);break;case this.VKONTAKTE:l="http://vkontakte.ru/share.php?url="+encodeURIComponent(t)+"&title="+encodeURIComponent(i)+"&description="+encodeURIComponent(n);break;case this.ODNOKLASSNIKI:l="http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl="+encodeURIComponent(t)+"&st.title="+encodeURIComponent(i)+"&st.comments="+encodeURIComponent(n);break;case this.LINE:l="http://line.me/R/msg/text/?"+encodeURIComponent(i)+"%0D%0A"+encodeURIComponent(t)}l&&window.open(l,"lbShare"+e,"height=600,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")},EventBinder:new function(){this.init=function(e){e.spaceId&&this.setSpaceId(e.spaceId),e.$element&&this.initShareButtons(e.$element)},this.setSpaceId=function(e){this.spaceId=e},this.initShareButtons=function(e){e&&e.on("click",".icon-socialshare",$.proxy(this.onShareButtnClick,this))},this.onShareButtnClick=function(e){var t=$(e.currentTarget),e=this.spaceId;void 0===e&&(e=t.data("id")),HZ.spaceActions.Share.openShareWindowForSpace(t.data("social"),e)}},populateToGallerySelect:function(e,t){var i,o,s,a,n,l,r,d=HZ.spaceActions.AddToIdeabookDialog.getGalleries(),c=$(e);0<(i=d?(o=d.recent).length:i)&&HZ.ui.Utils.addOptionGroupToSelect(c,_hgt("Recently Used:"),-1,"recentIdeabooks");for(var u=0;u<i;u++)r=(n=o[u]).featured?" ("+_hgt("Featured")+")":"",l=n.id==t,HZ.ui.Utils.addOptionToGroupSelect(c,n.title+r,n.id,l,"recentIdeabooks");HZ.ui.Utils.addOptionGroupToSelect(c,_hgt("Your Ideabooks:"),-1,"yourIdeabooks"),d&&(i=(s=d.own).length);for(u=0;u<i;u++)r=(n=s[u]).featured?" ("+_hgt("Featured")+")":"",l=n.id==t,HZ.ui.Utils.addOptionToGroupSelect(c,n.title+r,n.id,l,"yourIdeabooks");0<(i=d?(a=d.shared).length:i)&&HZ.ui.Utils.addOptionGroupToSelect(c,_hgt("Shared Ideabooks:"),-1,"sharedIdeabooks");for(u=0;u<i;u++)l=(n=a[u]).id==t,HZ.ui.Utils.addOptionToGroupSelect(c,n.title+_hgt("(Shared)"),n.id,l,"sharedIdeabooks")}};

window.hzmr.push("spaceActions:28992994");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End spaceActions.js  **************/
/************* Start socialSdk.js for locale en-GB **************/
try {HZ.ns("HZ.sns"),HZ.sns.JsSdk={fb:{},google:{},loader:{},apple:{}},HZ.sns.JsSdk.fb.init=function(){},HZ.sns.JsSdk.fb.setFbTokenExpiration=function(){},HZ.sns.JsSdk.fb.isFbTokenExpired=function(){},HZ.sns.JsSdk.fb.getFbAccessToken=function(){},HZ.sns.JsSdk.loader.loadThirdPartyJsSdk=function(){},HZ.sns.JsSdk.loader.loadThirdPartyJsSdkFIF=function(){},HZ.sns.JsSdk.loader.loadOnDocumentReady=function(){},HZ.sns.JsSdkConstants={},HZ.sns.JsSdkConstants.STATUS_NOT_LOADED=1,HZ.sns.JsSdkConstants.STATUS_LOADING=2,HZ.sns.JsSdkConstants.STATUS_LOADED=3,HZ.sns.JsSdkConstants.FB=1,HZ.sns.JsSdkConstants.GOOGLE=2,HZ.sns.JsSdkConstants.TW=3,HZ.sns.JsSdkConstants.VK=4,HZ.sns.JsSdkConstants.OD=5,HZ.sns.JsSdkConstants.LINE=6,HZ.sns.JsSdkConstants.APPLE=7,HZ.sns.JsSdkConstants.GOOGLE_IS=8,HZ.sns.JsSdkController={},HZ.sns.JsSdkController.sdkLoaded={},HZ.sns.JsSdkController.sdkConfig={},HZ.sns.JsSdkController.sdkConfig[HZ.sns.JsSdkConstants.FB]={url:HZ.utils.Config.fbJsLibUrl,id:"facebook-jssdk"},HZ.sns.JsSdkController.sdkConfig[HZ.sns.JsSdkConstants.GOOGLE]={url:"https://apis.google.com/js/platform.js",id:"gplatform-js"},HZ.sns.JsSdkController.sdkConfig[HZ.sns.JsSdkConstants.GOOGLE_IS]={url:"https://accounts.google.com/gsi/client",id:"google-identity-service-js"},HZ.sns.JsSdkController.sdkConfig[HZ.sns.JsSdkConstants.TW]={url:"//platform.twitter.com/widgets.js",id:"twitter-wjs"},HZ.sns.JsSdkController.sdkConfig[HZ.sns.JsSdkConstants.VK]={url:"http://vkontakte.ru/js/api/openapi.js",id:"vk-js"},HZ.sns.JsSdkController.sdkConfig[HZ.sns.JsSdkConstants.OD]={url:"https://connect.ok.ru/connect.js",id:"od-js"},HZ.sns.JsSdkController.sdkConfig[HZ.sns.JsSdkConstants.LINE]=null,HZ.sns.JsSdkController.sdkConfig[HZ.sns.JsSdkConstants.APPLE]={url:HZ.utils.Config.appleJSUrl,id:"apple-js"},HZ.sns.JsSdkController.sdkStatus={},HZ.sns.JsSdkController.sdkStatus[HZ.sns.JsSdkConstants.FB]=HZ.sns.JsSdkConstants.STATUS_NOT_LOADED,HZ.sns.JsSdkController.sdkStatus[HZ.sns.JsSdkConstants.GOOGLE]=HZ.sns.JsSdkConstants.STATUS_NOT_LOADED,HZ.sns.JsSdkController.sdkStatus[HZ.sns.JsSdkConstants.GOOGLE_IS]=HZ.sns.JsSdkConstants.STATUS_NOT_LOADED,HZ.sns.JsSdkController.sdkStatus[HZ.sns.JsSdkConstants.TW]=HZ.sns.JsSdkConstants.STATUS_NOT_LOADED,HZ.sns.JsSdkController.sdkStatus[HZ.sns.JsSdkConstants.APPLE]=HZ.sns.JsSdkConstants.STATUS_NOT_LOADED,HZ.sns.JsSdkConstants.EVENT_FACEBOOK_AUTH_REQUESTED="far",HZ.sns.JsSdkConstants.EVENT_FACEBOOK_AUTH_SUCCEEDED="fas",HZ.sns.JsSdkConstants.EVENT_FACEBOOK_AUTH_FAILED="faf",HZ.sns.JsSdk.loader.loadThirdPartyJsSdk=function(s,t){if(s)for(Object.prototype.toString.call(s)!==Object.prototype.toString.call([])&&(s=[s]);s.length;){var i,a=s.shift(),n=HZ.sns.JsSdkController.sdkConfig[a];n&&(i=n.url,n=n.id,a==HZ.sns.JsSdkConstants.FB&&(HZ.tmpFbLoader.addFbRootDiv(),window.fbAsyncInit||(window.fbAsyncInit=function(){HZ.tmpFbLoader.requireInitialization(null),$(document).trigger("fbJsLoaded")})),a===HZ.sns.JsSdkConstants.APPLE&&HZ.tmpAppleLoader.initAppleState(t.appleState),function(s,t,n){var o,e=s.getElementsByTagName(t)[0];s.getElementById(n)||((t=s.createElement(t)).id=n,t.src=i,t.onload=(o=a,function(){HZ.sns.JsSdk.loader.onLibLoad(o)}),e.parentNode.insertBefore(t,e))}(document,"script",n))}},HZ.sns.JsSdk.loader.onLibLoad=function(s){HZ.sns.JsSdkController.sdkStatus[s]=HZ.sns.JsSdkConstants.STATUS_LOADED,s==HZ.sns.JsSdkConstants.GOOGLE||s==HZ.sns.JsSdkConstants.GOOGLE_IS?HZ.sns.JsSdk.google.initiateAuth():s==HZ.sns.JsSdkConstants.APPLE?HZ.sns.JsSdk.apple.initiateAuth():s===HZ.sns.JsSdkConstants.FB&&HZ.sns.JsSdk.fb.subscribeFbEvent()},HZ.sns.JsSdk.loader.loadThirdPartyJsSdkFIF=function(e){if(e){Object.prototype.toString.call(e)!==Object.prototype.toString.call([])&&(e=[e]);var i,a,t,s,n=!1,d=window,o=document.createElement("iframe");o.src="javascript:false",o.title="",(o.frameElement||o).style.cssText="position: absolute; left: -10000px; top: -10000px; width: 0; height: 0; border: 0",(s=(s=document.getElementsByTagName("script"))[s.length-1]).parentNode.insertBefore(o,s);try{t=(i=o.contentWindow).document}catch(s){a=document.domain,o.src="javascript:var d=document.open();d.domain='"+a+"';void(0);",t=(i=o.contentWindow).document}if(Array.prototype.indexOf)n=-1!==e.indexOf(HZ.sns.JsSdkConstants.FB);else for(var r=e.length,l=0;l<=r;l++)if(e[l]===HZ.sns.JsSdkConstants.FB){n=!0;break}n&&HZ.tmpFbLoader.addFbRootDiv(),n&&!window.fbAsyncInit&&(window.fbAsyncInit=function(){HZ.sns.JsSdkController.sdkStatus[HZ.sns.JsSdkConstants.FB]=HZ.sns.JsSdkConstants.STATUS_LOADED,HZ.tmpFbLoader.requireInitialization(null),$(document).trigger("fbJsLoaded")}),t.open()._l=function(){for(;e.length;){var s,t,n,o=e.shift();HZ.sns.JsSdkController.sdkStatus[o]===HZ.sns.JsSdkConstants.STATUS_NOT_LOADED&&(HZ.sns.JsSdkController.sdkStatus[o]=HZ.sns.JsSdkConstants.STATUS_LOADING,t=(s=HZ.sns.JsSdkController.sdkConfig[o]).id,this.getElementById(t)||(i.inDapIF=!0,n=this.createElement("script"),a&&(this.domain=a),t&&(n.id=t),n.readyState?n.onreadystatechange=function(s){return function(){"loaded"!=n.readyState&&"complete"!=n.readyState||(n.onreadystatechange=null,HZ.sns.JsSdkController.sdkStatus[s]=HZ.sns.JsSdkConstants.STATUS_LOADED,s===HZ.sns.JsSdkConstants.TW?(d.twttr=d.twttr||i.twttr||{},d.twttr&&d.twttr.widgets.load(d.document.getElementById("shareList"))):s!==HZ.sns.JsSdkConstants.GOOGLE&&s!==HZ.sns.JsSdkConstants.GOOGLE_IS||(d.gapi=d.gapi||i.gapi||{},d.gapi&&(i.gapi=d.gapi,d.___gcfg=i.___gcfg={lang:"en-US",parsetags:"explicit"},d.gapi.plus.go(d.document.getElementById("shareList")))))}}(o):n.onload=function(s){return function(){HZ.sns.JsSdkController.sdkStatus[s]=HZ.sns.JsSdkConstants.STATUS_LOADED,s===HZ.sns.JsSdkConstants.TW?(d.twttr=d.twttr||i.twttr||{},d.twttr&&d.twttr.widgets.load(d.document.getElementById("shareList"))):s!==HZ.sns.JsSdkConstants.GOOGLE&&s!==HZ.sns.JsSdkConstants.GOOGLE_IS||(d.gapi=d.gapi||i.gapi||{},d.gapi&&(i.gapi=d.gapi,d.___gcfg=i.___gcfg={lang:"en-US",parsetags:"explicit"},d.gapi.plus.go(d.document.getElementById("shareList"))))}}(o),n.src=s.url,this.body.appendChild(n)))}},t.write('<body onload="document._l();">'),t.close()}},HZ.sns.JsSdk.loader.loadOnDocumentReady=function(s,t){$(document).ready(this.loadThirdPartyJsSdk(s,t))},HZ.tmpGoogleLoader=new function(){var o=null;this.initiateAuth=function(){gapi.load("auth2",function(){o=gapi.auth2.init({client_id:HZ.utils.Config.googleClientId,cookiepolicy:"single_host_origin",fetch_basic_profile:!1,scope:"profile email"})})},this.requestGoogleAuth=function(s,t,n){console.log("Requesting Google auth code through old Google library ..."),o.grantOfflineAccess(n).then(s,t)}},HZ.tmpGoogleIdentityServiceLoader=new function(){var s=null;this.initiateAuth=function(){HZ.sns.JsSdkController.sdkStatus[HZ.sns.JsSdkConstants.GOOGLE_IS]===HZ.sns.JsSdkConstants.STATUS_LOADED&&(s=google.accounts.oauth2.initCodeClient({client_id:HZ.utils.Config.googleClientId,scope:"profile email",ux_mode:"popup",callback:HZ.auth.Manager.handleGoogleAuthSuccess,error_callback:HZ.auth.Manager.handleGoogleAuthFailure,include_granted_scopes:!1}))},this.requestGoogleAuth=function(){console.log("Requesting Google auth code through new Google library ..."),s&&s.requestCode()}},HZ.tmpGoogleLoader&&(HZ.sns.JsSdk.google=HZ.tmpGoogleLoader),HZ.tmpFbLoader=new function(){var n,o=""+HZ.utils.Config.fbAppId,e=!1,i=null,a=null,d=null,r=null,l=null,u=0,S=null,c=!1,k=HZ.utils.Links.getPicUrl("channel.html");function p(s){var t;(S=s)&&("connected"==s.status?(c=!0,l=s.authResponse.accessToken,i=s.authResponse.userID,t=.001*(new Date).getTime(),u=t+parseInt(s.authResponse.expiresIn,10)):c="not_authorized"==s.status)}this.setFbAppId=function(s){o=s},this.getFbAppId=function(){return o},this.isFbLoggedIn=function(){return c},this.getFbUserId=function(){return i},this.getFbLastName=function(){return d},this.getFbFirstName=function(){return a},this.getFbEmail=function(){return r},this.getFbAccessToken=function(){return l},this.init=function(s){s&&"function"==typeof s&&(e?s():$(document).bind("fbJsLoaded",s))},this.addFbRootDiv=function(){var s,t;document.getElementById("fb-root")||(s=document.body.firstChild,(t=document.createElement("div")).id="fb-root",document.body.insertBefore(t,s))},this.setFbTokenExpiration=function(s){u=s},this.getFbTokenExpiration=function(){return u},this.isFbTokenExpired=function(){var s=.001*(new Date).getTime();return u<s},this.requireInitialization=function(s){return HZ.sns.JsSdkController.sdkStatus[HZ.sns.JsSdkConstants.FB]!=HZ.sns.JsSdkConstants.STATUS_LOADED&&s?(HZ.sns.JsSdk.fb.init(function(){s.callee.apply(HZ.sns.JsSdk.fb,s)}),HZ.sns.JsSdkController.sdkStatus[HZ.sns.JsSdkConstants.FB]==HZ.sns.JsSdkConstants.STATUS_NOT_LOADED&&HZ.sns.JsSdk.loader.loadOnDocumentReady(HZ.sns.JsSdkConstants.FB),!1):(e||(t={appId:o,status:!1,cookie:!0,xfbml:!0,channelUrl:k},""!=HZ.utils.Config.fbApiVersion&&(t.version="v"+HZ.utils.Config.fbApiVersion),FB.init(t),e=!0),!0);var t},this.getFbAuthResponse=function(){return S},this.requestFbAuth=function(s,n,o,e,t){var i;this.requireInitialization(arguments)&&(i={scope:s=s||HZ.utils.Config.fbDefaultScope},t&&(i=$.extend(i,t)),HZ.utils.Logger.sendEventLogOnce(HZ.sns.JsSdkConstants.EVENT_FACEBOOK_AUTH_REQUESTED),FB.login(function(s){var t;p(s),s&&"connected"==s.status?(HZ.utils.Logger.sendEventLogOnce(HZ.sns.JsSdkConstants.EVENT_FACEBOOK_AUTH_SUCCEEDED),e?(t=n,HZ.sns.JsSdk.fb.graphApi("/me",function(s){s.first_name&&(a=s.first_name),s.last_name&&(d=s.last_name),s.email&&(r=s.email),"function"==typeof t&&t()})):"function"==typeof n&&n()):(HZ.utils.Logger.sendEventLogOnce(HZ.sns.JsSdkConstants.EVENT_FACEBOOK_AUTH_FAILED),"function"==typeof o&&o())},i))},this.subscribeFbEvent=(n={},function(s,t){if(HZ.sns.JsSdkController.sdkStatus[HZ.sns.JsSdkConstants.FB]===HZ.sns.JsSdkConstants.STATUS_LOADED)return function(){for(var s in n){var t;n.hasOwnProperty(s)&&(t=n[s],FB.Event.subscribe(s,t))}}(),FB.Event.subscribe;n[s]=t}),this.graphApi=function(s,t){FB.api(s,t)},this.getFbLoginStatus=function(t){this.requireInitialization(arguments),S?"function"==typeof t&&t(S):FB.getLoginStatus(function(s){p(s),"function"==typeof t&&t(s)})},this.postToFeed=function(s,t,n,o,e){FB.ui({method:"feed",redirect_uri:e,link:s,picture:o,name:t,caption:"",description:n},function(s){})}},HZ.tmpFbLoader&&(HZ.sns.JsSdk.fb=HZ.tmpFbLoader),HZ.tmpAppleLoader=new function(){var s=HZ.utils.Config.appleWebClientId,t=HZ.utils.Config.appleScope,n=HZ.utils.Config.appleWebRedirectUri;this.initiateAuth=function(){AppleID.auth.init({clientId:s,scope:t,redirectURI:n,state:this.appleState})},this.initAppleState=function(s){this.appleState=s}},HZ.tmpAppleLoader&&(HZ.sns.JsSdk.apple=HZ.tmpAppleLoader);

window.hzmr.push("socialSdk:28992994");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End socialSdk.js  **************/
/************* Start extracting text for siteAuth.js for locale en-GB **************/
(function(){var _hzxt={"We're sorry, but an unexpected error has occurred.  Please try again.":"We're sorry, but an unexpected error has occurred. Please try again."};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for siteAuth.js  **************/
/************* Start siteAuth.js for locale en-GB **************/
try {HZ.ns("HZ.auth"),HZ.auth.LoginWrapperDialog=new function(){var e=null,i=null,o=null,t=null,a=null;this.show=function(e,n,i,o){this.init(e),t=i||824,a=o||473,HZ.ui.Yamdi.show(this,n)},this.init=function(e){o=e},this.setDelegate=function(e){i=e},this.getView=function(){return e||(e=$("<div id='loginWrapperDialog'></div>").addClass("dlgWrapperFrame").append("<div id='loginWrapperDialog_0'><iframe id='loginWrapperDialog_0_frame' scrolling='no' frameborder='0' allowtransparency='false' style='border: medium none; overflow: hidden;'></iframe></div>"),$("body").append(e)),$("#loginWrapperDialog").css("width",t+"px"),$("#loginWrapperDialog").css("height",a+"px"),$("#loginWrapperDialog_0_frame").css("width",t+"px"),$("#loginWrapperDialog_0_frame").css("height",a+"px"),e},this.viewLoaded=function(){var n;o&&encodeURIComponent(o);document.getElementById("loginWrapperDialog_0_frame").src=HZ.utils.Config.secureUrl+o,n="loginWrapperDialog_"+0,e.children().each(function(e){this.style.display=this.id==n?"block":"none"}),i.center()},this.viewUnloaded=function(){$("#loginWrapperDialog").remove(),param=e=null}},HZ.auth.Manager=new function(){var o=null,t=null,n=!1,s=null,a=!1,r=null,l=null,u=null,g=null,c=null,d="",h=!1,p=!1,m=null,f=null,S=null,i=null,_=null,H=!1,E=!0,Z=!1,y=!1,R=!1,I=!1,A=!1,L=null,C=null,b=null,O=!1,U="/signup",v="/signin",w=null,D="",z=!1,M=null,k=null,P=null,N=null,j=null,G=null;function F(){r=r||top.location.href.toString();var e,n="",n="signup"===u?U:v,i={u:r,d:t};return g&&(i.username=g),c&&(i.m=c),S&&(i.t=S),f&&(i.ft=f),_&&(i.s=_),y&&(i.fl=y),I&&(i.f=1),k&&(i.sourceUser=k),b&&(e=Math.floor(.001*(new Date).getTime()-C)+L,i.rt=HZ.utils.Links.base64Encode(e+","+b)),n+"/"+function(e){var n,i=new Array;for(n in e)"u"==n?i.push(encodeURIComponent(n.toString())+"="+HZ.utils.Links.base64Encode(e[n].toString())):i.push(encodeURIComponent(n.toString())+"="+encodeURIComponent(e[n].toString()));return i.join("/")}(i)}function J(){window.location=F()}function T(e,n){e=e.getBody();e.find("div.form-group").removeClass("has-error"),e.find("label.control-label").text(_hgt("Email{contextEmailNoun}",{contextEmailNoun:""})),e.find("input#missingEmailInput").val(g),n&&(e.find("div.form-group").addClass("has-error"),e.find("label.control-label").text(_hgt(n)))}function W(e){HZ.ui.yamdi.Common.hideAllDialogs();var n=(P||(P=new HZ.ui.yamdi.Dialog,n=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Continue"),"",function(){var e=$("#missingEmailInput").val();e?(HZ.auth.Manager.setDefaultEmail(e),B()):T(P,_hgt("Please enter an email address to complete your sign up:"))}),P.init({title:_hgt("Complete Your Signup"),dialogClassName:"missingEmail",controls:[n]}),P.setBody('<div class="container-fluid"><div class="mbl">'+_hgt("Please enter your email address to finish signing up.")+'</div><div class="form-group mbs"><label for="missingEmailInput" class="control-label"></label><input type="email" class="form-control" id="missingEmailInput" placeholder="'+_hgt("For example, yourname@email.com")+'"></div></div>')),P);T(n,e),HZ.ui.Yamdi.show(n)}function x(e){e=e||{},n?t="mobile":(t=t||"web",e.displayMode&&(t=e.displayMode)),e.callback&&(s=e.callback),e.redirectUrl&&(r=e.redirectUrl),e.screen&&(u=e.screen),e.email&&(g=e.email),e.messageId&&(c=e.messageId),(S=e.source?e.source:S)&&!i&&(i=S),e.hideFbLinking&&(Z=e.hideFbLinking),e.layout&&(y=e.layout),e.hideLoadingDialog&&(R=e.hideLoadingDialog),e.reauthenticate&&(I=e.reauthenticate),e.openInNewWindow&&(A=e.openInNewWindow),e.rtEvent&&(b=e.rtEvent),e.googleAccountLinking&&(z=e.googleAccountLinking),e.googleAccountLinkingCallback&&(M=e.googleAccountLinkingCallback),e.sourceUser&&(k=e.sourceUser)}function Y(){HZ.sns.JsSdk.fb.getFbAccessToken()&&B()}function B(){R||(HZ.ui.yamdi.Common.hideAllDialogs(),HZ.ui.yamdi.Common.loading(_hgt("Connecting with Facebook..."))),r=r||top.location.href,HZ.ajaz.Services.fbSignUp(HZ.auth.Manager.externalSignUpHandler,r,g,!1,I)}function K(){"function"==typeof s&&s(!1)}function q(e){R||(HZ.ui.yamdi.Common.hideAllDialogs(),HZ.ui.yamdi.Common.loading(_hgt("Connecting with Google..."))),r=r||top.location.href,$.isEmptyObject(e)||(z?HZ.ajaz.Services.enableGoogleLogin(M,e.code):HZ.ajaz.Services.googleSignUp(HZ.auth.Manager.externalSignUpHandler,e.code,r,!1))}function V(e){}function X(e){var n,i=!1;a=r=!1,e&&e[HZ.ajaz.Authorize.JSON_KEY_REDIRECT_URL]&&(r=e[HZ.ajaz.Authorize.JSON_KEY_REDIRECT_URL]),e&&e.success&&"true"==e.success?(HZ.OmniLogAPI.signupFormStepCompleted(N,j),e[HZ.ajaz.Authorize.JSON_KEY_CREATE_PRO_PROFILE_URL]&&(l=e[HZ.ajaz.Authorize.JSON_KEY_CREATE_PRO_PROFILE_URL]),e[HZ.ajaz.Authorize.JSON_KEY_SURL]&&(i=e[HZ.ajaz.Authorize.JSON_KEY_SURL]),e.newUser?(H=!0,HZ.OmniLogAPI.signupFlowCompleted(N,"Sign Up",j,G),a=!0):(HZ.OmniLogAPI.signupFlowCompleted(N,"Sign In",j,G),window.localStorage.setItem(HZ.utils.Config.justAuthenticated,JSON.stringify({type:"login"})))):(d=_hgt("We're sorry, but an unexpected error has occurred.  Please try again."),e&&(e.errorMessage&&(d=e.errorMessage),e.error&&(m=e.error,n=m,h=-1!=HZ.ajaz.Authorize.EMAIL_MINOR_ERROR.indexOf(n),n=m,p=-1!=HZ.ajaz.Authorize.PASSWORD_ERROR.indexOf(n))));function o(){"function"==typeof s&&s(a,e)}i?HZ.ajaz.Services.setSession(i,o):o()}ADD_USER_EMAIL_EXISTS=7,ERROR_DEACTIVATED_ACCOUNT=13,ERROR_FB_MISSING_EMAIL=31,ERROR_GOOGLE_MISSING_EMAIL=32,this.useGoogleIdentityServiceLibrary=!1,this.setIsMobile=function(e){n=e},this.setDisplayMode=function(e){t=e},this.setSignupBaseUrl=function(e){U=e},this.setSigninBaseUrl=function(e){v=e},this.setSupportUrl=function(e){w=e},this.getDisplayMode=function(){return t},this.setUserId=function(e){o=e},this.getUserId=function(){return o},this.isUserCreated=function(){return H},this.getScreen=function(){return u},this.setSignupLabel=function(e){0},this.setSignupSource=function(e){i=e},this.getSignupSource=function(){return i},this.setSourcePage=function(e){_=e},this.getSourcePage=function(e){return _},this.setServerStartTime=function(e){L=e},this.getMessageId=function(){return c},this.getErrorMsg=function(){return d},this.getErrorCode=function(){return m},this.getMinorEmailError=function(){return h},this.getPasswordError=function(){return p},this.setDefaultEmail=function(e){g=e},this.setShowFbWelcome=function(e){E=e},this.setDefaultFbLoginScope=function(e){O=e},this.getRedirectUrl=function(){return r},this.getCreateProProfileUrl=function(){return l},this.setGoogleScopes=function(e){D=e.join(" ")},this.setAuthType=function(e){N=e},this.getAuthType=function(){return N},this.setSignupFormType=function(e){j?G=e:j=e},this.loginComplete=function(e){"function"==typeof s?s(a,e):o&&(r?top.location=r:top.location.reload())},this.externalSignUpHandler=function(e){var n,i;a=!1,e&&"true"===e.success?(i="Google"===N?"Google Identity Service":N,HZ.OmniLogAPI.signup3rdPartyStepCompleted(i,j),a=!0,o=e.uid,n=!1,e[HZ.ajaz.Authorize.JSON_KEY_REDIRECT_URL]&&(r=e[HZ.ajaz.Authorize.JSON_KEY_REDIRECT_URL]),e[HZ.ajaz.Authorize.JSON_KEY_CREATE_PRO_PROFILE_URL]&&(l=e[HZ.ajaz.Authorize.JSON_KEY_CREATE_PRO_PROFILE_URL]),e[HZ.ajaz.Authorize.JSON_KEY_SURL]&&(n=e[HZ.ajaz.Authorize.JSON_KEY_SURL]),e.newUser?(H=!0,HZ.OmniLogAPI.signupFlowCompleted(i,"Sign Up",j,G)):(HZ.OmniLogAPI.signupFlowCompleted(i,"Sign In",j,G),window.localStorage.setItem(HZ.utils.Config.justAuthenticated,JSON.stringify({type:"login"}))),i=function(){e.newUser&&"mobile"!=t&&E?function(){var e=HZ.signup.newPostSignup.init(function(){HZ.ui.yamdi.Common.hideAllDialogs(),HZ.ui.yamdi.Common.loading(_hgt("Please wait...")),HZ.ajaz.Services.homeownerSignup(function(){HZ.auth.Manager.loginComplete()})},function(){HZ.ui.yamdi.Common.hideAllDialogs(),HZ.ui.yamdi.Common.loading(_hgt("Please wait...")),HZ.ajaz.Services.proSignup(function(){var e=HZ.auth.Manager.getCreateProProfileUrl();top.location=e})});HZ.ui.yamdi.Common.hideAllDialogs();var n=new HZ.ui.yamdi.Dialog;n.init({title:"",dialogClassName:"userTypesDialog",controls:[]}),n.setBody(e),HZ.ui.Yamdi.show(n)}():(R||HZ.ui.yamdi.Common.hideAllDialogs(),HZ.auth.Manager.loginComplete(e))},n?HZ.ajaz.Services.setSession(n,i):i()):e&&e.error==ADD_USER_EMAIL_EXISTS&&!Z?(g=e.email,e.redirectUrl?top.location=e.redirectUrl:(u="signin","g"===e.operation?c=10:(c=1,f="x"),J())):!e||e.error!=ERROR_FB_MISSING_EMAIL&&e.error!=ERROR_GOOGLE_MISSING_EMAIL?e&&e.error==ERROR_DEACTIVATED_ACCOUNT?(c=14,J()):R||(HZ.ui.yamdi.Common.hideAllDialogs(),HZ.ui.yamdi.Common.alert(_hgt("We're sorry, please refresh and try again!"),_hgt("We're sorry, but we encountered an unexpected issue - likely this page has timed out due to inactivity.  Please refresh this page and try again.<br/><br/>If you continue to have trouble logging in please contact us at {supportUrl} for assistance.",{supportUrl:w}))):W(g?_hgt("Please double-check the email address below:"):null)},this.fbLoginAuthorizedUser=function(e){x(e=e||{hideFbLinking:!0}),"undefined"!=typeof FB&&B()},this.fbLogin=function(e){x(e);var n=!1;e.reauthenticate&&(n={auth_type:"reauthenticate"},e.fbNonce&&(n.auth_nonce=e.fbNonce)),HZ.sns.JsSdk.fb.requestFbAuth(O,Y,K,!1,n)},this.handleGoogleAuthSuccess=function(e){q(e)},this.handleGoogleAuthFailure=function(e){},this.loadGoogleLoginOptions=function(e){var n={};return n.app_package_name=HZ.utils.Config.androidPackageName,n.scope=D,n.redirect_uri="postmessage",n.prompt="select_account",n},this.googleLogin=function(e){x(e),this.useGoogleIdentityServiceLibrary?HZ.sns.JsSdk.google.requestGoogleAuth():HZ.sns.JsSdk.google.requestGoogleAuth(q,V,this.loadGoogleLoginOptions(e))},this.emailSignup=function(e,n,i,o,t,a,r,l){s=l,HZ.ajaz.Services.signup(e,n,i,o,t,a,r,X)},this.inlineSignup=function(e,n,i,o,t,a){s=a,HZ.ajaz.Services.inlineSignup(e,n,i,o,t,X)},this.fbLoginLazyLoad=function(){HZ.sns.JsSdk.loader.loadOnDocumentReady(HZ.sns.JsSdkConstants.FB)},this.googleLoginLazyLoad=function(){this.useGoogleIdentityServiceLibrary?HZ.sns.JsSdk.loader.loadOnDocumentReady(HZ.sns.JsSdkConstants.GOOGLE_IS):HZ.sns.JsSdk.loader.loadOnDocumentReady(HZ.sns.JsSdkConstants.GOOGLE)},this.login=function(e){var n;if(A=I=R=y=Z=!1,b=c=g=u=r=s=t=null,x(e),o)loginComplete();else switch(t){case"dialog":HZ.auth.LoginWrapperDialog.show(F(),"function"==typeof s?s:null,480,480);break;case"mobile":case"web":n=F(),A?window.open(n):top.location=n}},this.signup=function(e,n,i,o,t){e={screen:"signup",redirectUrl:i=i||top.location.href.toString(),source:e};n&&(e.messageId=n),o&&(e.callback=o),t&&t.displayMode&&"dialog"==t.displayMode&&UIHelper.isIE7&&(t.displayMode="web"),t&&(e=$.extend(e,t)),HZ.auth.Manager.login(e)},this.signin=function(e,n,i){n={screen:"signin",redirectUrl:n=n||top.location.href.toString()};e&&(n.messageId=e),i&&(n.callback=i),HZ.auth.Manager.login(n)},C=.001*(new Date).getTime()};

window.hzmr.push("siteAuth:28992994");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End siteAuth.js  **************/
