window.hzmr = window.hzmr || [];
/************* Start spaceActions.js for locale en-US **************/
try {function showAddToMyGalleryForm(a){}function showPostToForumForm(a,b){}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(a){HZ.spaceActions.EmbedDialog.setSpaceId(a),HZ.ui.Yamdi.show(HZ.spaceActions.EmbedDialog)}HZ.ns("HZ.spaceActions"),HZ.spaceActions.QuestionDialog=new function(){function a(){return p==HZ.spaceActions.QuestionDialog.PRODUCT_TOPIC}function b(a){var b="questionDialog_"+a;w.children().each(function(a){this.style.display=this.id==b?"block":"none"}),x.center()}function c(){x.hide(null)}function d(){b(r),HZ.ui.AjaxThrobber.setInCall(!0),HZ.spaceActions.getExistingQuestions(v,$.proxy(e,this))}function e(a){HZ.ui.AjaxThrobber.setInCall(!1),a.success&&(a[HZ.spaceActions.QuestionDialog.JSON_KEY_DAILY_QUESTIONS_QUOTA_EXCEEDED]||a[HZ.spaceActions.QuestionDialog.JSON_KEY_QUESTIONS].length>0?f(a):h())}function f(a){for(var c=a[HZ.spaceActions.QuestionDialog.JSON_KEY_QUESTIONS],d=(a[HZ.spaceActions.QuestionDialog.JSON_KEY_SPACE_ID],a[HZ.spaceActions.QuestionDialog.JSON_KEY_DAILY_QUESTIONS_QUOTA_EXCEEDED]),e="<ul>",f=0;f<c.length;f++){var g=c[f],h=parseInt(g.numberOfAnswers,10);switch(e+="<li><a href='javascript:HZ.spaceActions.QuestionDialog.openQuestionPage("+g.questionId+")'>"+g.title+"</a>",h>0&&(e+=" <span class='reply'>("),parseInt(g.numberOfAnswers,10)){case 0:break;case 1:e+=_hgt("1 reply");break;default:e+=_hgt("{replyCount} replies",{replyCount:g.numberOfAnswers})}h>0&&(e+=")</span>")}e+="</ul>",$("#questionsList").empty().append(e),$("#questionsListCaption")[0].style.display=c.length>0?"block":"none",$("#questionQuotaExceeded")[0].style.display=d?"block":"none",n[0].style.display=d?"none":"inline",b(s)}function g(a){$("#questionFormError").empty().append(a),a?$("#questionFormError").show():$("#questionFormError").hide(),$("[placeholder]","#askQuestionDialog").initPlaceHolders("refresh")}function h(){b(t)}function i(){if(!HZ.ui.AjaxThrobber.isInCall()){$("#askQuestionDialog").trigger("submit.question");var a=UIHelper.trim(k.value),b=UIHelper.trim(l.value);return""==a?g(_hgt("Please write your question.")):(HZ.ui.AjaxThrobber.setInCall(!0),$("#space-action__submit-question-button").attr("disabled","disabled"),HZ.ajaz.Services.postToForum(v,a,b,p,$.proxy(j,this))),!1}}function j(a){if($("#space-action__submit-question-button").removeAttr("disabled"),HZ.ui.AjaxThrobber.setInCall(!1),"true"==a.success){var c=_hgt("More questions about your project or decor?");a[B]&&(c="<div class='overQuota'>"+_hgt("Please note: You have reached the maximum number of questions permitted per day.")+"</div>"+c),$("#askQuestionConfirmationMessage").empty().append(c),null!=A&&HZ.utils.Logger.sendEventLogOnce(A),b(u)}else HZ.ui.Yamdi.hide(this),HZ.ui.yamdi.Common.alert(a.error)}var k,l,m,n,o,p,q,r=0,s=1,t=2,u=3,v=null,w=null,x=null,y=!1,z=!1,A=null,B="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,p=this.SPACE_TOPIC;var C=_hgt("Ask a question about this photo.")+" ",D=_hgt("Ask a question about this product.")+" ",E=_hgt("Your question was posted."),F=(_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_"+r+"'><div class='dialogTitle'>"+C+"</div><div class='dialogBody'><div class='dialogCenterCaption'>"+_hgt("Please wait...")+HZ.ui.AjaxThrobber.getThrobber()+"</div><div class='dialogControls'></div></div></div>"),G="<div id='questionDialog_"+s+"'><div class='dialogTitle'>"+C+"</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>",H="<div id='questionDialog_"+t+"'><div class='dialogTitle'>"+C+"</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>",I="<div id='questionDialog_"+u+"'><div class='dialogTitle'>"+E+"</div><div class='dialogBody'><div id='askQuestionConfirmationMessage' class='pll prl'></div><div class='dialogControls'></div></div></div>";this.init=function(a,b){v=a},this.setDelegate=function(a){x=a},this.setTrackingEventSource=function(a){A=a},this.setShowLinkOnNewWindow=function(a){y=a},this.setQuestionTopic=function(a){p=a},this.setQuestionUpsellLink=function(a){q=a},this.openQuestionPage=function(a){var b=HZ.utils.Links.getQuestionLink(a);y?window.open(b):window.location=b},this.getView=function(){if(!w){w=$("<div id='askQuestionDialog'></div>").addClass("dialogFrame").append(F).append(G).append(H).append(I),m=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Submit"),"space-action__submit-question-button",$.proxy(i,this)),n=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("I have another question"),"",$.proxy(h,this)),o=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Go to Advice"),null,function(){window.location.href=q},null,null,"seeWorkButton"),$("body").append(w),$("#questionDialog_"+r+" .dialogControls",w).append(HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),null,null,null,null,"cancelButton")),$("#questionDialog_"+s+" .dialogControls",w).append(HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),null,null,null,null,"cancelButton")).append(n),$("#questionDialog_"+t+" .dialogControls",w).append(HZ.ui.AjaxThrobber.getThrobber()).append(HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),null,null,null,null,"cancelButton")).append(m),$("#questionDialog_"+u+" .dialogControls",w).append(HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("No Thanks"),null,null,null,null,"cancelButton")).append(o),$(".cancelButton",w).click($.proxy(c,this)),k=$("#askQuestionInputTitle")[0],$("#askQuestionInputTitle").charCount({css:"counter text-xs",counterElement:"div",allowed:70,prewarning:20,warning:10,counterText:_hgt("Characters Left")+" "}),l=$("#askQuestionInputComment")[0]}return w},this.viewLoaded=function(){g(""),k.value="",$(k).trigger("change"),l.value="",HZ.ui.AjaxThrobber.setInCall(!1),z?$("[placeholder]","#askQuestionDialog").initPlaceHolders("refresh"):(z=!0,$("[placeholder]","#askQuestionDialog").initPlaceHolders({saveContainer:"#askQuestionDialog",saveEvent:"submit.question"}));var b=a()?D:C;a();HZ.utils.Config.isResponsive&&$("#askQuestionInputTitle").attr("placeholder",_hgt("Title")),$("#questionDialog_"+r+" .dialogTitle",w).html(b),$("#questionDialog_"+s+" .dialogTitle",w).html(b),$("#questionDialog_"+t+" .dialogTitle",w).html(b),a()?$("#questionsGuidelines").hide():$("#questionsGuidelines").show(),d()},this.viewUnloaded=function(){}},HZ.spaceActions.DontPrintDialog=new function(){var a=null,b=null,c=null,d="photo";this.setDelegate=function(a){c=a},this.lastInvokedDate=function(){return b},this.setLastInvokedDate=function(a){b=a},this.setPrintSubject=function(a){d=a},this.getPrintSubject=function(){return d},this.daysElapsedFromToday=function(){var a=this.currentDateAsTimestamp(),b=new Date(this.lastInvokedDate()),c=Math.abs(a-b);return Math.floor(c/864e5)},this.currentDateAsTimestamp=function(){return(new Date).getTime()},this.checkUserPref=function(a,b,c){if(!this.lastInvokedDate()||this.daysElapsedFromToday()>1){this.setPrintSubject(c),this.setLastInvokedDate(this.currentDateAsTimestamp()),HZ.ajaz.Services.updateUserPreferences(15,null,function(a){}),HZ.utils.Logger.sendEventLog("dpd_shown"),HZ.ui.Yamdi.show(HZ.spaceActions.DontPrintDialog,null);var d=$("#continueToPrint");d&&d.click(function(c){HZ.utils.Logger.sendEventLog("dpd_print"),HZ.ui.Yamdi.hide(null),HZ.utils.Print.printUrl(a,b)})}else HZ.utils.Print.printUrl(a,b)},this.getView=function(){if(!a){var b="",c="",d="";"photo"==this.getPrintSubject()?(b=_hgt("Print Photo"),c=_hgt("Help the environment by sharing this photo another way:"),d=_hgt("No thanks. Please print this photo")):(b=_hgt("Print Ideabook"),c=_hgt("Help the environment by sharing this ideabook another way:"),d=_hgt("No thanks. Please print this ideabook")),a=$("<div id='dontPrintDialog'>").addClass("dialogFrame").append("<div class='dialogTitle'><span id='dontPrintTitleIcon'></span>"+b+"</div><div class='dialogBody'><div class='dialogSection'><div class='dialog-section-header'>"+c+"</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:;'>"+d+"</a></div></div></div>"),$("body").append(a)}return a},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 a=null;this.getPromoView=function(){return a||(a=$("<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>")),a},this.assembleOverlayElements=function(){var a=[];return null===HZ.data.CurrentSessionUser&&a.push(this.getPromoView()),a}},HZ.spaceActions.AprilFoolsClass=function(){function a(){this.getDelegate().hide(null)}var b={"":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"};HZ.spaceActions.AprilFoolsClass.superclass.constructor.call(this),this.prepare=function(){var c=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Done"),_hgt("cancel"),$.proxy(a,this)),d=$("<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:b[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")})),e={body:d,dialogClassName:"embedPhotoDialog aprilFoolsDialog",controls:[c],onViewLoaded:$.proxy(this.onViewLoaded,this)};this.init(e)},this.closeDiag=function(){$.proxy(a,this)()}},HZ.extend(HZ.spaceActions.AprilFoolsClass,HZ.ui.yamdi.Dialog),HZ.spaceActions.EmbedDialogClass=function(){function a(){this.getDelegate().hide(null)}function b(a){a.success&&(c.val(a.largeImageEmbedCode),d.val(a.smallImageEmbedCode),shortcodeTextarea.val(a.wordpressShortcode))}var c,d,e=null,f="<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>";HZ.spaceActions.EmbedDialogClass.superclass.constructor.call(this),this.prepare=function(){var b=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Done"),_hgt("cancel"),$.proxy(a,this)),e=$("<div>").append(f);c=$(".embedPhoto500",e),d=$(".embedPhoto320",e),shortcodeTextarea=$(".embedShortcode",e);var g={title:_hgt("Embed a Photo"),body:e,dialogClassName:"embedPhotoDialog",controls:[b],onViewLoaded:$.proxy(this.onViewLoaded,this)};this.init(g)},this.setSpaceId=function(a){e=a},this.onViewLoaded=function(){c.val(""),d.val(""),shortcodeTextarea.val(""),HZ.ajaz.Services.getEmbedSpaceCode(e,$.proxy(b,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(a,b){var c=a.closest(".ic"),d=a.closest("[lb-sid]"),e=a.data("sid");if(!e)if(d.length)e=d.attr("lb-sid");else if(c.length)e=c.attr("objid");else{var f=a.closest(".feed-snapshot-placeholder").find("img[lb-sid]");if(!f.length)return;e=f.attr("lb-sid")}var g=a.data("type");b.isCobrand?window.location=b.cobrandRedirectUrl:HZ.spaceActions.invokeSignupAndThenActionDialog(e,g,b.emailShareAfterSignup)},HZ.spaceActions.invokeSignupAndThenActionDialog=function(a,b,c){if(a&&b)if(HZ.data.CurrentSessionUser)"ideabook"===b||"hover"===b?HZ.spaceActions.showAddToIdeabookDialog(a):"email"===b&&HZ.spaceActions.showEmailDialog(a,!0);else{var d=HZ.data.Spaces.get(a),e=null;d&&d.iids&&d.iids[0]&&(e=d.iids[0]);var f=JSON.stringify({houseId:a,redirectUrl:window.location.href,imageId:e,buttonType:b});"email"!==b||c?HZ.ajaz.Services.setVisitorProperty("postSignupHouseId",f,function(a){"ideabook"===b||"hover"===b?HZ.auth.Manager.signup(HZ.spaceActions.addToIdeabookSignupSource,HZ.spaceActions.addToIdeabookMessageId,window.location.href):"email"===b&&HZ.auth.Manager.signup(HZ.spaceActions.spaceActionsEmailSignupSource,HZ.spaceActions.spaceActionsEmailMessageId,window.location.href)}):HZ.ajaz.Services.setVisitorProperty("postSignupHouseId",f,function(b){HZ.spaceActions.showEmailDialog(a,c)})}},HZ.spaceActions.showAddToIdeabookDialog=function(a){var b=HZ.data.Spaces.get(a);if(HZ.data.CurrentSessionUser)HZ.spaceActions.isUniversalGalleryEnabled||HZ.ctx&&HZ.ctx.config&&HZ.ctx.config.GALLERY_ITEMS_ENABLED?b.prod?HZ.modules.SaveToUniversalGallery.saveProduct(a):HZ.modules.SaveToUniversalGallery.saveSpace(a):(HZ.spaceActions.AddToIdeabookDialog.init(a),HZ.ui.Yamdi.show(HZ.spaceActions.AddToIdeabookDialog));else{var c=null,d=window.location.href;b&&b.iids&&b.iids[0]&&(c=b.iids[0]);var e=JSON.stringify({houseId:a,redirectUrl:d,imageId:c,buttonType:"ideabook"});HZ.ajaz.Services.setVisitorProperty("postSignupHouseId",e,function(a){HZ.auth.Manager.signup(HZ.spaceActions.addToIdeabookSignupSource,HZ.spaceActions.addToIdeabookMessageId,d)})}},HZ.spaceActions.showEmailDialog=function(a,b){var c=null;if(HZ.data&&HZ.data.Spaces&&(c=HZ.data.Spaces.get(a)),!HZ.data.CurrentSessionUser&&b){var d=null,e=window.location.href;c&&c.iids&&c.iids[0]&&(d=c.iids[0]);var f=JSON.stringify({houseId:a,redirectUrl:e,imageId:d,buttonType:"email"});HZ.ajaz.Services.setVisitorProperty("postSignupHouseId",f,function(a){HZ.auth.Manager.signup(HZ.spaceActions.spaceActionsEmailSignupSource,HZ.spaceActions.spaceActionsEmailMessageId,e)})}else c&&(HZ.dialogs.EmailDialog.prepare({type:HZ.sendEmail.types.SPACE,referenceId:c.id,subject:c.t,message:c.prod?HZ.sendEmail.texts.DEFAULT_MESSAGE_PRODUCT:HZ.sendEmail.texts.DEFAULT_MESSAGE_SPACE,staticMessageData:!(!c.prod||!HZ.lb.Config.tradeUser)&&HZ.lb.Config.tradeUser,signupOnSend:!b}),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(a,b){var c,d,e,f,g,h="",i="";if(HZ.data&&HZ.data.Spaces&&(c=HZ.data.Spaces.get(b))){if(d=HZ.utils.Links.getSpaceLink(c.id),e=c.t,i=c.c,a==this.FACEBOOK){var j=HZ.utils.Styles.getStyleUrl(c.s),k=HZ.data.Categories.getCategoryById(c.cat),l=c.ma,m=HZ.data.Users.get(c.ow);j&&(e+=" - "+j),k&&(e+=" - "+k.name),l&&(e+=" - "+l),m&&(e+=_hgt(" - by {owner}",{owner:m.d})),h="",f=HZ.utils.Links.getFbFeedRedirectLink(),g="popup"}this.openShareWindow(a,d,e,h,f,g,i)}},openShareWindow:function(a,b,c,d,e,f,g){var h;switch(g||(g=""),a){case this.FACEBOOK:h="https://www.facebook.com/dialog/feed?app_id="+HZ.utils.Config.fbAppId+"&link="+encodeURIComponent(b)+"&caption="+encodeURIComponent(d)+"&name="+encodeURIComponent(c)+"&redirect_uri="+encodeURIComponent(e)+"&display="+encodeURIComponent(f)+"&description="+encodeURIComponent(g);break;case this.TWITTER:h="http://twitter.com/intent/tweet?url="+encodeURIComponent(b)+"&text="+encodeURIComponent(c);break;case this.GOOGLE_PLUS:h="https://plus.google.com/share?url="+encodeURIComponent(b);break;case this.LINKEDIN:h="http://www.linkedin.com/shareArticle?mini=true&url="+encodeURIComponent(b)+"&title="+encodeURIComponent(c)+"&summary="+encodeURIComponent(d);break;case this.VKONTAKTE:h="http://vkontakte.ru/share.php?url="+encodeURIComponent(b)+"&title="+encodeURIComponent(c)+"&description="+encodeURIComponent(g);break;case this.ODNOKLASSNIKI:h="http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl="+encodeURIComponent(b)+"&st.title="+encodeURIComponent(c)+"&st.comments="+encodeURIComponent(g);break;case this.LINE:h="http://line.me/R/msg/text/?"+encodeURIComponent(c)+"%0D%0A"+encodeURIComponent(b)}h&&window.open(h,"lbShare"+a,"height=600,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")},EventBinder:new function(){this.init=function(a){a.spaceId&&this.setSpaceId(a.spaceId),a.$element&&this.initShareButtons(a.$element)},this.setSpaceId=function(a){this.spaceId=a},this.initShareButtons=function(a){a&&a.on("click",".icon-socialshare",$.proxy(this.onShareButtnClick,this))},this.onShareButtnClick=function(a){var b=$(a.currentTarget),c=this.spaceId;void 0===c&&(c=b.data("id")),HZ.spaceActions.Share.openShareWindowForSpace(b.data("social"),c)}},populateToGallerySelect:function(a,b){var c,d,e,f,g,h,i,j,k=HZ.spaceActions.AddToIdeabookDialog.getGalleries();j=$(a),k&&(d=k.recent,c=d.length),c>0&&HZ.ui.Utils.addOptionGroupToSelect(j,_hgt("Recently Used:"),-1,"recentIdeabooks");for(var l=0;l<c;l++)g=d[l],i=g.featured?" ("+_hgt("Featured")+")":"",h=g.id==b,HZ.ui.Utils.addOptionToGroupSelect(j,g.title+i,g.id,h,"recentIdeabooks");HZ.ui.Utils.addOptionGroupToSelect(j,_hgt("Your Ideabooks:"),-1,"yourIdeabooks"),k&&(e=k.own,c=e.length);for(var l=0;l<c;l++)g=e[l],i=g.featured?" ("+_hgt("Featured")+")":"",h=g.id==b,HZ.ui.Utils.addOptionToGroupSelect(j,g.title+i,g.id,h,"yourIdeabooks");k&&(f=k.shared,c=f.length),c>0&&HZ.ui.Utils.addOptionGroupToSelect(j,_hgt("Shared Ideabooks:"),-1,"sharedIdeabooks");for(var l=0;l<c;l++)g=f[l],h=g.id==b,HZ.ui.Utils.addOptionToGroupSelect(j,g.title+_hgt("(Shared)"),g.id,h,"sharedIdeabooks")}};

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

/*************  End spaceActions.js  **************/
/************* Start socialSdk.js for locale en-US **************/
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.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.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.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(a,b){if(a)for(Object.prototype.toString.call(a)!==Object.prototype.toString.call([])&&(a=[a]);a.length;){var c=a.shift(),d=HZ.sns.JsSdkController.sdkConfig[c];if(d){var e=d.url,f=d.id;c==HZ.sns.JsSdkConstants.FB&&(HZ.tmpFbLoader.addFbRootDiv(),window.fbAsyncInit||(window.fbAsyncInit=function(){HZ.tmpFbLoader.requireInitialization(null),$(document).trigger("fbJsLoaded")})),c===HZ.sns.JsSdkConstants.APPLE&&HZ.tmpAppleLoader.initAppleState(b.appleState),function(a,b,d){var f,g=a.getElementsByTagName(b)[0];a.getElementById(d)||(f=a.createElement(b),f.id=d,f.src=e,f.onload=function(a){return function(){HZ.sns.JsSdk.loader.onLibLoad(a)}}(c),g.parentNode.insertBefore(f,g))}(document,"script",f)}}},HZ.sns.JsSdk.loader.onLibLoad=function(a){HZ.sns.JsSdkController.sdkStatus[a]=HZ.sns.JsSdkConstants.STATUS_LOADED,a==HZ.sns.JsSdkConstants.GOOGLE?HZ.sns.JsSdk.google.initiateAuth():a==HZ.sns.JsSdkConstants.APPLE?HZ.sns.JsSdk.apple.initiateAuth():a===HZ.sns.JsSdkConstants.FB&&HZ.sns.JsSdk.fb.subscribeFbEvent()},HZ.sns.JsSdk.loader.loadThirdPartyJsSdkFIF=function(a){if(a){Object.prototype.toString.call(a)!==Object.prototype.toString.call([])&&(a=[a]);var b,c,d,e,f=!1,g=window,h=document.createElement("iframe");h.src="javascript:false",h.title="",(h.frameElement||h).style.cssText="position: absolute; left: -10000px; top: -10000px; width: 0; height: 0; border: 0",e=document.getElementsByTagName("script"),e=e[e.length-1],e.parentNode.insertBefore(h,e);try{b=h.contentWindow,d=b.document}catch(a){c=document.domain,h.src="javascript:var d=document.open();d.domain='"+c+"';void(0);",b=h.contentWindow,d=b.document}if(Array.prototype.indexOf)f=-1!==a.indexOf(HZ.sns.JsSdkConstants.FB);else for(var i=a.length,j=0;j<=i;j++)if(a[j]===HZ.sns.JsSdkConstants.FB){f=!0;break}f&&HZ.tmpFbLoader.addFbRootDiv(),f&&!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")}),d.open()._l=function(){for(;a.length;){var d=a.shift();if(HZ.sns.JsSdkController.sdkStatus[d]===HZ.sns.JsSdkConstants.STATUS_NOT_LOADED){HZ.sns.JsSdkController.sdkStatus[d]=HZ.sns.JsSdkConstants.STATUS_LOADING;var e=HZ.sns.JsSdkController.sdkConfig[d],f=e.id;if(!this.getElementById(f)){b.inDapIF=!0;var h=this.createElement("script");c&&(this.domain=c),f&&(h.id=f),h.readyState?h.onreadystatechange=function(a){return function(){"loaded"!=h.readyState&&"complete"!=h.readyState||(h.onreadystatechange=null,HZ.sns.JsSdkController.sdkStatus[a]=HZ.sns.JsSdkConstants.STATUS_LOADED,a===HZ.sns.JsSdkConstants.TW?(g.twttr=g.twttr||b.twttr||{},g.twttr&&g.twttr.widgets.load(g.document.getElementById("shareList"))):a===HZ.sns.JsSdkConstants.GOOGLE&&(g.gapi=g.gapi||b.gapi||{},g.gapi&&(b.gapi=g.gapi,g.___gcfg=b.___gcfg={lang:"en-US",parsetags:"explicit"},g.gapi.plus.go(g.document.getElementById("shareList")))))}}(d):h.onload=function(a){return function(){HZ.sns.JsSdkController.sdkStatus[a]=HZ.sns.JsSdkConstants.STATUS_LOADED,a===HZ.sns.JsSdkConstants.TW?(g.twttr=g.twttr||b.twttr||{},g.twttr&&g.twttr.widgets.load(g.document.getElementById("shareList"))):a===HZ.sns.JsSdkConstants.GOOGLE&&(g.gapi=g.gapi||b.gapi||{},g.gapi&&(b.gapi=g.gapi,g.___gcfg=b.___gcfg={lang:"en-US",parsetags:"explicit"},g.gapi.plus.go(g.document.getElementById("shareList"))))}}(d),h.src=e.url,this.body.appendChild(h)}}}},d.write('<body onload="document._l();">'),d.close()}},HZ.sns.JsSdk.loader.loadOnDocumentReady=function(a,b){$(document).ready(this.loadThirdPartyJsSdk(a,b))},HZ.tmpGoogleLoader=new function(){var a=null;this.initiateAuth=function(){gapi.load("auth2",function(){a=gapi.auth2.init({client_id:HZ.utils.Config.googleClientId,cookiepolicy:"single_host_origin",fetch_basic_profile:!1,scope:"profile email"})})},this.requestGoogleAuth=function(b,c,d){a.grantOfflineAccess(d).then(b,c)}},HZ.tmpGoogleLoader&&(HZ.sns.JsSdk.google=HZ.tmpGoogleLoader),HZ.tmpFbLoader=new function(){function a(a){if(k=a,a)if("connected"==a.status){l=!0,i=a.authResponse.accessToken,e=a.authResponse.userID;var b=.001*(new Date).getTime();j=b+parseInt(a.authResponse.expiresIn,10)}else l="not_authorized"==a.status}function b(a){HZ.sns.JsSdk.fb.graphApi("/me",function(b){b.first_name&&(f=b.first_name),b.last_name&&(g=b.last_name),b.email&&(h=b.email),"function"==typeof a&&a()})}var c=""+HZ.utils.Config.fbAppId,d=!1,e=null,f=null,g=null,h=null,i=null,j=0,k=null,l=!1,m=HZ.utils.Links.getPicUrl("channel.html");this.setFbAppId=function(a){c=a},this.getFbAppId=function(){return c},this.isFbLoggedIn=function(){return l},this.getFbUserId=function(){return e},this.getFbLastName=function(){return g},this.getFbFirstName=function(){return f},this.getFbEmail=function(){return h},this.getFbAccessToken=function(){return i},this.init=function(a){a&&"function"==typeof a&&(d?a():$(document).bind("fbJsLoaded",a))},this.addFbRootDiv=function(){if(!document.getElementById("fb-root")){var a=document.body.firstChild,b=document.createElement("div");b.id="fb-root",document.body.insertBefore(b,a)}},this.setFbTokenExpiration=function(a){j=a},this.getFbTokenExpiration=function(){return j},this.isFbTokenExpired=function(){return.001*(new Date).getTime()>j},this.requireInitialization=function(a){if(HZ.sns.JsSdkController.sdkStatus[HZ.sns.JsSdkConstants.FB]!=HZ.sns.JsSdkConstants.STATUS_LOADED&&a)return HZ.sns.JsSdk.fb.init(function(){a.callee.apply(HZ.sns.JsSdk.fb,a)}),HZ.sns.JsSdkController.sdkStatus[HZ.sns.JsSdkConstants.FB]==HZ.sns.JsSdkConstants.STATUS_NOT_LOADED&&HZ.sns.JsSdk.loader.loadOnDocumentReady(HZ.sns.JsSdkConstants.FB),!1;if(!d){var b={appId:c,status:!1,cookie:!0,xfbml:!0,channelUrl:m};""!=HZ.utils.Config.fbApiVersion&&(b.version="v"+HZ.utils.Config.fbApiVersion),FB.init(b),d=!0}return!0},this.getFbAuthResponse=function(){return k},this.requestFbAuth=function(c,d,e,f,g){if(this.requireInitialization(arguments)){c||(c=HZ.utils.Config.fbDefaultScope);var h={scope:c};g&&(h=$.extend(h,g)),HZ.utils.Logger.sendEventLogOnce(HZ.sns.JsSdkConstants.EVENT_FACEBOOK_AUTH_REQUESTED),FB.login(function(c){a(c),c&&"connected"==c.status?(HZ.utils.Logger.sendEventLogOnce(HZ.sns.JsSdkConstants.EVENT_FACEBOOK_AUTH_SUCCEEDED),f?b(d):"function"==typeof d&&d()):(HZ.utils.Logger.sendEventLogOnce(HZ.sns.JsSdkConstants.EVENT_FACEBOOK_AUTH_FAILED),"function"==typeof e&&e())},h)}},this.subscribeFbEvent=function(){var a={},b=function(){for(var b in a)if(a.hasOwnProperty(b)){var c=a[b];FB.Event.subscribe(b,c)}};return function(c,d){if(HZ.sns.JsSdkController.sdkStatus[HZ.sns.JsSdkConstants.FB]===HZ.sns.JsSdkConstants.STATUS_LOADED)return b(),FB.Event.subscribe;a[c]=d}}(),this.graphApi=function(a,b){FB.api(a,b)},this.getFbLoginStatus=function(b){this.requireInitialization(arguments),k?"function"==typeof b&&b(k):FB.getLoginStatus(function(c){a(c),"function"==typeof b&&b(c)})},this.postToFeed=function(a,b,c,d,e){var f={method:"feed",redirect_uri:e,link:a,picture:d,name:b,caption:"",description:c},g=function(a){};FB.ui(f,g)}},HZ.tmpFbLoader&&(HZ.sns.JsSdk.fb=HZ.tmpFbLoader),HZ.tmpAppleLoader=new function(){var a=HZ.utils.Config.appleWebClientId,b=HZ.utils.Config.appleScope,c=HZ.utils.Config.appleWebRedirectUri;this.initiateAuth=function(){AppleID.auth.init({clientId:a,scope:b,redirectURI:c,state:this.appleState})},this.initAppleState=function(a){this.appleState=a}},HZ.tmpAppleLoader&&(HZ.sns.JsSdk.apple=HZ.tmpAppleLoader);

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

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

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

/*************  End siteAuth.js  **************/
/************* Start flashdetect.js for locale en-US **************/
try {if(void 0===deconcept)var deconcept=new Object;if(void 0===deconcept.util&&(deconcept.util=new Object),void 0===deconcept.SWFObjectUtil&&(deconcept.SWFObjectUtil=new Object),deconcept.SWFObject=function(a,b,c,d,e,f,g,h,i,j,k){if(document.createElement&&document.getElementById){this.DETECT_KEY=k||"detectflash",this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY),this.params=new Object,this.variables=new Object,this.attributes=new Array,a&&this.setAttribute("swf",a),b&&this.setAttribute("id",b),c&&this.setAttribute("width",c),d&&this.setAttribute("height",d),e&&this.setAttribute("version",new deconcept.PlayerVersion(e.toString().split("."))),this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),g),f&&this.addParam("bgcolor",f);var l=h||"high";this.addParam("quality",l),this.setAttribute("useExpressInstall",g),this.setAttribute("doExpressInstall",!1);var m=i||window.location;this.setAttribute("xiRedirectUrl",m),this.setAttribute("redirectUrl",""),j&&this.setAttribute("redirectUrl",j)}},deconcept.SWFObject.prototype={setAttribute:function(a,b){this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addParam:function(a,b){this.params[a]=b},getParams:function(){return this.params},addVariable:function(a,b){this.variables[a]=b},getVariable:function(a){return this.variables[a]},getVariables:function(){return this.variables},getVariablePairs:function(){var a,b=new Array,c=this.getVariables();for(a in c)b.push(a+"="+c[a]);return b},getSWFHTML:function(){var a="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){this.getAttribute("doExpressInstall")&&this.addVariable("MMplayerType","PlugIn"),a='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'"',a+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var b=this.getParams();for(var c in b)a+=[c]+'="'+b[c]+'" ';var d=this.getVariablePairs().join("&");d.length>0&&(a+='flashvars="'+d+'"'),a+="/>"}else{this.getAttribute("doExpressInstall")&&this.addVariable("MMplayerType","ActiveX"),a='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'">',a+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var b=this.getParams();for(var c in b)a+='<param name="'+c+'" value="'+b[c]+'" />';var d=this.getVariablePairs().join("&");d.length>0&&(a+='<param name="flashvars" value="'+d+'" />'),a+="</object>"}return a},write:function(a){if(this.getAttribute("useExpressInstall")){var b=new deconcept.PlayerVersion([6,0,65]);this.installedVer.versionIsValid(b)&&!this.installedVer.versionIsValid(this.getAttribute("version"))&&(this.setAttribute("doExpressInstall",!0),this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl"))),document.title=document.title.slice(0,47)+" - Flash Player Installation",this.addVariable("MMdoctitle",document.title))}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){return("string"==typeof a?document.getElementById(a):a).innerHTML=this.getSWFHTML(),!0}return""!=this.getAttribute("redirectUrl")&&document.location.replace(this.getAttribute("redirectUrl")),!1}},deconcept.SWFObjectUtil.getPlayerVersion=function(a,b){var c=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var d=navigator.plugins["Shockwave Flash"];d&&d.description&&(c=new deconcept.PlayerVersion(d.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split(".")))}else{try{for(var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),f=3;null!=e;f++)e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+f),c=new deconcept.PlayerVersion([f,0,0])}catch(a){}if(a&&c.major>a.major)return c;if(!a||(0!=a.minor||0!=a.rev)&&c.major==a.major||6!=c.major||b)try{c=new deconcept.PlayerVersion(e.GetVariable("$version").split(" ")[1].split(","))}catch(a){}}return c},deconcept.PlayerVersion=function(a){this.major=null!=parseInt(a[0])?parseInt(a[0]):0,this.minor=parseInt(a[1])||0,this.rev=parseInt(a[2])||0},deconcept.PlayerVersion.prototype.versionIsValid=function(a){return!(this.major<a.major)&&(this.major>a.major||!(this.minor<a.minor)&&(this.minor>a.minor||!(this.rev<a.rev)))},deconcept.util={getRequestParameter:function(a){var b=document.location.search||document.location.hash;if(b){var c=b.indexOf(a+"="),d=b.indexOf("&",c)>-1?b.indexOf("&",c):b.length;if(b.length>1&&c>-1)return b.substring(b.indexOf("=",c)+1,d)}return""}},deconcept.SWFObjectUtil.cleanupSWFs=function(){for(var a=document.getElementsByTagName("OBJECT"),b=0;b<a.length;b++)for(var c in a[b])"function"==typeof a[b][c]&&(a[b][c]=null)},"function"==typeof window.onunload){var oldunload=window.onunload;window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs(),oldunload()}}else window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;null==Array.prototype.push&&(Array.prototype.push=function(a){return this[this.length]=a,this.length});var getQueryParamValue=deconcept.util.getRequestParameter,FlashObject=deconcept.SWFObject,SWFObject=deconcept.SWFObject;

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

/*************  End flashdetect.js  **************/
