$(function(){var n=$("#wrapper"),r=$("#profile"),K=$("#promo-slot-top"),J=$(window),ad,I,o,P=!!$(".profile-self-view-edit").length,ac,p,ae,N="profile",T=$("#top-card-guided-edit-btn"),b=T.data("li-form-url"),k=T.data("li-section-url"),u="guided-edit-profile",L="guided-edit-promo-profile",v="nprofile_v2_view_fs",V="nprofile_v2_edit_fs",Q="nprofile_v2_guided_edit_fs",s="full_page",G=["profile_v2_connections","profile_v2_groups","profile_v2_follow"],C=["profile_v2_connections","profile_v2_groups","profile_v2_follow"],ah="profile_v2_background",h={SWITCH_EDIT:"switch-edit",SWITCH_VIEW:"switch-view",SWITCH_EDIT_ON_LOAD:"switch-edit-on-load",BEFORE_SWITCH_VIEW:"before-switch-view",FORM_OPENED:"form-opened",FORM_CLOSED:"form-closed",FORM_MODIFIED:"form-modified",RENDER_DEFERRED_SECTIONS:"render-deferred-sections",DEFERRED_SECTIONS_RENDERED:"deferred-sections-rendered",PROFILE_UPDATE_SUCCESS:"profile-update-success",TIMESTAMP_CHANGED:"timestamp-changed"},S={SKIL:"background-skills",SUM:"background-summary",EXP:"background-experience",PROJ:"background-projects",EDU:"background-education",ADD:"background-additional-info",CERT:"background-certifications",LANG:"background-languages",PTNT:"background-patents",PUBL:"background-publications",HNRS:"background-honors",TSTS:"background-test-scores",ORGS:"background-organizations",COUR:"background-courses",VLNT:"background-volunteering"},E=LI.getQueryStringParam("targetSection");
function d(al){var ak=$(al.target);
W(al);
if(ak.closest(".edit-profile").length){al.preventDefault();
z()
}else{if(ak.closest(".done-edit-profile").length){al.preventDefault();
g()
}}}function W(aq){var al=$(aq.target),ao,au,an,ak,ap,ar,am;
ao=al.closest("[data-page-key]");
if(ao.length){an=ao.data("page-type");
ak=ao.data("page-key");
ap=ao.data("page-tracking-info");
au=ao.data("trk")
}else{au=al.closest("[data-trk]").data("trk")
}if(au&&!ak){if(!$.isPlainObject(au)){au={componentKey:au}
}if(al.hasClass("btn-primary")){if(!$.isPlainObject(au.infoParams)){au.infoParams={}
}ar=al.parents("form").find("[data-infoparams]");
if(ar.length){am=ar.data("infoparams");
for(var at in am){if(am.hasOwnProperty(at)){au.infoParams[at]=am[at]
}}}}y(au.componentKey,au["source"],au.infoParams)
}if(ak&&window.ProfilePageTracking){window.ProfilePageTracking(an,ak,au,ap)
}}function af(){return n.hasClass("edit-my-profile")
}function z(am,an){ad=ad||$("#hopscotch-bubble");
if(ad&&ad.length){ad.hide()
}if(K&&K.length){K.hide()
}var ao=$(".profile-actions.view-actions",n),ak=$(".profile-actions.edit-actions",n),al="fast";
$(".button-menu",ao).fadeOut(al);
f(h.RENDER_DEFERRED_SECTIONS);
ao.fadeOut(al,function(){$.fn.ProfileEdit.showEditSections({success:function(){n.addClass("edit-my-profile");
if(P){n.removeClass("profile-self-view-edit")
}H();
if(!am){f(h.SWITCH_EDIT)
}else{f(h.SWITCH_EDIT_ON_LOAD)
}if(an){ao.removeAttr("style")
}else{ak.fadeIn(al,function(){ao.removeAttr("style");
ak.removeAttr("style")
})
}if(!E){n.find(".edit-photo a").first().focus()
}},error:function(){$.fn.ProfileEdit.showGlobalAlert(LI.i18n.get("unableToProcessRequest"),"error")
}})
});
if(!am){document.title=LI.i18n.get("edit-mode-title")
}}function g(){var am=$(".profile-actions.view-actions",n),ak=$(".profile-actions.edit-actions",n),al="fast";
ad=ad||$("#hopscotch-bubble");
f(h.BEFORE_SWITCH_VIEW);
ak.fadeOut(al,function(){$.fn.ProfileEdit.hideAllForms();
n.removeClass("edit-my-profile");
if(P){n.addClass("profile-self-view-edit")
}H();
f(h.SWITCH_VIEW);
am.fadeIn(al,function(){ak.removeAttr("style");
am.removeAttr("style")
});
$(".button-menu",am).fadeIn(al);
if(ad&&ad.length){window.hopscotch.showStep(window.hopscotch.getCurrStepNum());
ad.show()
}});
n.find(".profile-actions .edit-profile").first().focus();
document.title=LI.i18n.get("view-mode-title")
}function U(ak){if(ak&&!$.isArray(ak)){ak=[ak]
}return ak
}function ab(al,am){var ak=U(al);
if(ak&&am){r.bind(ak.join(" "),am)
}}function aj(al,am){var ak=U(al);
if(ak&&am){r.unbind(ak.join(" "),am)
}}function f(al,am){var ak=U(al);
if(ak){r.trigger(ak.join(" "),am)
}}function B(al){var ak=window.ProfilePageTracking,am;
if(ak){am="optimize-started-prof_promo-"+(af()?V:v);
ak(s,Q,am)
}j(al)
}function j(al){var ak=A();
ak.addStartListener(x);
ak.addStopListener(e);
ak.run(al)
}function Y(al){var ak=A();
ak.addStartListener(a);
ak.addStopListener(l);
ak.addPromoTransitionListener(w);
ak.runAsPromo(al)
}function H(){var al=$(".background-section"),ak;
al.each(function(an){var ao=$(this),am=$(":first",ao);
am.removeClass("last");
if(am.is(":visible")){ak=am
}});
if(ak&&ak.length){ak.addClass("last")
}}function M(){n.find(".done-edit-profile").hide();
n.find(".save-exit-profile").show()
}function m(){n.find(".done-edit-profile").show();
n.find(".save-exit-profile").hide()
}function y(ak,am,al){var an={};
if(window.WebTracking&&WebTracking.trackUserAction){if(am){an["source"]=am
}if(al){if($.isPlainObject(al)){$.each(al,function(ao,ap){an[ao]=ap
})
}else{an["info"]=al
}}WebTracking.trackUserAction(ak,an)
}}function x(){var ak=$("#wrapper");
if(!ak.hasClass(u)){ak.addClass(u)
}o=af()&&!!$.fn.ProfileEdit;
if(o){$.fn.ProfileEdit.handleDoneEdit();
g()
}I.removeStartListener(x)
}function e(){var al=window.ProfilePageTracking,an,ak,am=$("#wrapper");
am.removeClass(u);
ak={"vid":$.fn.Profile.memberId,"nd":"-1","lnl":"f"};
if(o){z()
}else{g()
}if(al){an=o?V:v;
al(s,an,null,ak)
}I.removeStopListener(e)
}function a(){var ak=$("#wrapper");
if(!ak.hasClass(L)){ak.addClass(L)
}I.removeStartListener(a)
}function l(){$("#wrapper").removeClass(L);
I.removeStopListener(l)
}function w(){var ak=window.ProfilePageTracking,al;
x();
l();
I.addStopListener(e);
if(ak){al="optimize-started-prof_promo-"+(af()?V:v);
ak(s,Q,al)
}I.removePromoTransitionListener(w)
}function A(){var an="guided-edit-promo",ak,ap,am,al,ao;
if(!I){ak=$("#"+an);
if(ak.length===0){ap=$("#"+N);
if(ap.length===0){return
}ak=$('<div id="'+an+'"></div>').prependTo(ap)
}al=$(".guided-editing");
am=$(".background-content");
if(am.length===0){am=$(document.body)
}I=new LI.GuidedEdit.Manager({guidedEditStartUrl:b,sectionUrl:k,sectionManager:LI.Profile2.Section,$sectionParent:am,$formInsertPoint:ak,$stepsInsertPoint:al});
LI.GuidedEdit.Instance=I
}return I
}function X(){var al=$("#background"),an,ak,am,ao;
if(al&&al.length){am=$(document).scrollTop();
ao=J.height();
an=al.offset().top;
ak=al.height();
if((am+ao)>=(an+ak)){return true
}}return false
}function D(ao){var an=ao.embedIds,aw=ao.fizzyFunc,al=ao.embedCallback,av=ao.deferCompleteCallback,ak=ao.completeOnFirst||false,au,am,at=0,ar=[],aq=0;
$.each(an,function(ax,ay){if($("script#"+ay).length){ar.push(ay)
}});
aq=ar.length;
if(window.fs){am=function(ay,ax){au.add(function(){al(ax);
if(ak===true||++at===aq){au.disable();
if(av){av()
}}})
};
au=$.Callbacks("once memory");
for(var ap=0;
ap<aq;
ap++){aw(ar[ap],am)
}}return au
}function O(an){var ak,al,am;
al=function(ao){if(ao){ao.embed()
}};
am=function(){$.fn.ProfileConnections.init();
if(an){an()
}};
ak=D({embedIds:G,fizzyFunc:window.fs.custom,embedCallback:al,deferCompleteCallback:am});
return ak
}function c(an){var al,ak,am;
ak=function(ao){if(ao){ao.xhr()
}};
am=function(){if(an){an()
}};
al=D({embedIds:C,fizzyFunc:window.fs.customXHR,embedCallback:ak,deferCompleteCallback:am,completeOnFirst:true});
return al
}function ag(al){var ak="scroll.deferRender",am;
if(al===true){ac=c(function(){var an=O(function(){f(h.DEFERRED_SECTIONS_RENDERED)
});
if(an){an.fire()
}J.off(ak)
})
}else{p=O(function(){J.off(ak);
f(h.DEFERRED_SECTIONS_RENDERED)
})
}am=function(){if(ac){ac.fire()
}if(p){p.fire()
}};
J.on(ak,am);
J.on("load",function(){setTimeout(function(){if(X()){am();
J.off(ak)
}},10)
})
}function t(an){var ak,al,am;
al=function(ao){if(ao){ao.embed()
}};
am=function(){var ao=$("#background");
if(ao.length){LI.Controls.parseFragment(ao[0]);
H()
}$.fn.ProfileBackground.init();
if($.fn.ProfileEditPosition){$.fn.ProfileEditPosition.init()
}if($.fn.ProfileEditProject){$.fn.ProfileEditProject.init()
}if(an){an()
}};
ak=D({embedIds:[ah],fizzyFunc:window.fs.custom,embedCallback:al,deferCompleteCallback:am});
return ak
}function i(ak){ae=t();
if(typeof ak!=="number"||!ak){J.on("load",q)
}else{setTimeout(q,ak)
}}function Z(){if(ac){ac.fire()
}if(p){p.fire()
}}function q(){if(ae){ae.fire()
}}function ai(){Z();
q()
}function F(){var ak=$(".scroll-target").filter(":visible"),al;
if(ak.length){al=ak.first().offset().top-85;
$("html,body").animate({scrollTop:al},"slow")
}}function R(ak){v=ak
}(function aa(){H();
F();
n.on("click",d);
$("#callout-overlay").on("click",W);
ab(h.FORM_MODIFIED,M);
ab([h.FORM_CLOSED,h.SWITCH_VIEW],m);
ab(h.RENDER_DEFERRED_SECTIONS,ai);
$.fn.Profile={EVENTS:h,SECTION_IDS:S,switchToEdit:z,switchToView:g,startGuidedEdit:j,startGuidedEditAsPromo:Y,startGuidedEditFromEndorsements:B,fixSectionDividers:H,deferRenderOnScroll:ag,deferRenderOnLoad:i,bind:ab,unbind:aj,fire:f,track:y,scrollToFirstTarget:F,setViewPagekey:R}
}())
});$(function(){var d=$("#groups-container");
function b(h){var g=$(h.target);
if(g.closest(".see-more").length){h.preventDefault();
a(g)
}if(g.closest(".see-less").length){h.preventDefault();
f(g)
}if(g.closest(".edit-tools-module").length){h.preventDefault();
$(".groups-container").slideToggle("slow");
d.toggleClass("expanded-view")
}}function c(g){$(".groups-container").slideDown("slow")
}function f(g){g.closest("ul").find(".see-less").addClass("hidden");
g.closest("ul").find(".hidden-groups").addClass("hidden");
g.closest("ul").find(".see-more").removeClass("hidden")
}function a(g){g.closest("ul").find(".see-more").addClass("hidden");
g.closest("ul").find(".hidden-groups").removeClass("hidden");
g.closest("ul").find(".see-less").removeClass("hidden")
}(function e(){var g=$.fn.Profile;
if(d.length){d.on("click",b);
g.bind(g.EVENTS.SWITCH_VIEW,c)
}}())
});LI.define("WebTrackClickTracking");
LI.WebTrackClickTracking=function(c,b){this.config=b;
function a(e){var g=YEvent.getTarget(e).id,f=this.config.trackingInfo,d=YAHOO.lang;
if(!d.isNull(f[g])&&!d.isUndefined(f[g])){WebTracking.trackUserAction(f[g].trackingCode,"",true)
}}if(WebTracking){YEvent.on(c,"click",a,null,this)
}};LI.define("WaffleTracking");
LI.WaffleTracking=function(){var a=this;
YEvent.on(document,"click",function(d){var c=YEvent.getTarget(d),b;
try{do{b=LI.getDataAttribute(c,"trk-code");
if(b&&WebTracking){WebTracking.trackUserAction(b,a.getParamsList(c),true)
}}while(c=LI.getAncestorByDataAttribute(c,"li-trk-code"))
}catch(d){}})
};
LI.WaffleTracking.prototype.getParamsList=function(a){return{}
};
LI.define("waffleTracking");
LI.waffleTracking=new LI.WaffleTracking();(function(a){var d=LIModules.requires("jquery"),c=LIModules.requires("BaseControl"),g=LIModules.requires("underscore"),h=LIModules.imports("Events"),i="dropdown:open",b="dropdown:close",e="dropdown:newitems",f=c.extend(function(j){var q="click",k="mouseover",v="mouseout",o="mousedown",u="mouseup",m="hover",p="keydown",n=13,l=27,s=32,w=38,t=40,r={activeClass:"active",eventType:q,mercyTime:400,triggerSelector:null,dropdownMenuClass:"dropdown"};
return{beforeDecoration:function(){this._$body=d("body");
this._mouseDown=false;
this._mouseoutTimer=0;
this._config=d.extend({},r,this._config);
this._isOpen=false;
this._$listItems=[];
this._$trigger={};
this._$dropMenu={};
this._currentItemIndex=-1;
this.isMouseEvent=false;
if(this._config.triggerSelector){this._$trigger=this._$el.find(this._config.triggerSelector)
}else{this._$trigger=this._$el.children("a");
if(this._$trigger.length===0){this._$trigger=this._$el.children("button")
}}this._$dropMenu=this._$trigger.next();
this._populateListItems();
this._bootstrapAria()
},attachEventListeners:function(){if(this._config.eventType===m){this._$el.on(k,this._handleMouseOverEvent).on(v,this._handleMouseOutEvent)
}this._$trigger.on(o,this._handleMousedownEvent).on(q,this._handleClickEvent).on(u,g.bind(this._setMouseUser,this,true));
this._$body.on(q,this._handleBodyClick);
this._$el.on(p,this._handleKeyEvent);
h.on(e,this.bootstrapNewItems)
},_bootstrapAria:function(){this._$trigger.attr({"tabindex":0,"aria-haspopup":true,"role":"button"});
this._bootstrapListItems();
this._$dropMenu.attr("tabindex",-1);
if(this._$listItems.length){this._$dropMenu.attr("role","menu")
}},_bootstrapListItems:function(){this._$listItems.each(function(){d(this).attr({"tabindex":0,"role":"menuitem"})
})
},bootstrapNewItems:function(x){this._populateListItems();
this._bootstrapListItems()
},_setMouseUser:function(x){this.isMouseEvent=x
},_populateListItems:function(){this._$listItems=this._$dropMenu.find("li, dd, dt")
},_handleBodyClick:function(x){if(this._isOpen&&this._$el.has(x.target).length===0){this._setMouseUser(true);
this.close()
}},_focusNext:function(){var x=this._$listItems.length;
if(x){if(this._currentItemIndex<(x-1)){this._currentItemIndex++
}else{this._currentItemIndex=0
}this._$listItems[this._currentItemIndex].focus()
}},_focusPrevious:function(){var x=this._$listItems.length;
if(x){if(this._currentItemIndex>0){this._currentItemIndex--
}else{this._currentItemIndex=(x-1)
}this._$listItems[this._currentItemIndex].focus()
}},_handleKeyEvent:function(x){var y=x.which,z=x.target;
switch(y){case n:if(d(z).is(this._$trigger)){this._$trigger.click()
}break;
case s:if(d(z).is(this._$trigger)){x.preventDefault();
this._$trigger.click()
}break;
case l:if(this._isOpen){this.close()
}break;
case t:x.preventDefault();
this._focusNext();
break;
case w:x.preventDefault();
this._focusPrevious();
break;
default:break
}},open:function(){var x=this._config.activeClass;
if(!this._isOpen){this._$el.addClass(x);
if(!this.isMouseEvent){this._$dropMenu.focus()
}this._$el.trigger(i,this);
this._isOpen=true
}},close:function(){this._$el.removeClass(this._config.activeClass);
if(this._mouseoutTimer){window.clearTimeout(this._mouseoutTimer)
}if(!this.isMouseEvent){this._$trigger.focus()
}this._$el.trigger(b,this);
this._isOpen=false;
this._currentItemIndex=-1;
this._setMouseUser(false)
},_handleMousedownEvent:function(x){this._mouseDown=true
},_handleClickEvent:function(x){var y;
this._mouseDown=false;
if(this._config.eventType===m){y=x.target.href;
if(y&&y.indexOf("#")!==0){return
}}x.preventDefault();
x.stopPropagation();
if(this._isOpen){this.close()
}else{this.open()
}},_handleMouseOverEvent:function(x){this._setMouseUser(true);
window.clearTimeout(this._mouseoutTimer);
this.open()
},_handleMouseOutEvent:function(x){var z=this._config.mercyTime,y=this;
if(z>0){this._mouseoutTimer=window.setTimeout(function(){y.close()
},z)
}else{y.close()
}}}
});
f.EVENTS={OPEN:i,CLOSE:b,NEW:e};
LIModules.exports("Dropdown",f)
}(window.require));(function(d){var e=window.jQuery||d("jquery"),c=window._||d("underscore"),a=LIModules.imports("BaseControl"),b;
b=a.extend(function(h){var f=("placeholder" in document.createElement("input")),g={placeholderClass:"placeholder",preserveAttributes:["class","id","name","tabindex","title","placeholder"],clearOnFormSubmit:false};
return{init:function(n,l){var p=e(n),o=p.find(':input:not(:submit):not([type="hidden"])'),j=o.length,k;
this.$input=p;
if(j){for(var m=0;
m<j;
m++){k=new b(o[m],l)
}return false
}else{if(!p.is(":input:not(:submit)")||p.attr("placeholder")===undefined){return false
}}if(!f||(l&&l.forcePlaceholderSupported)){h.init.apply(this,arguments)
}},beforeDecoration:function(){this.$input=this._$el;
this.$form=this.$input.closest("form");
c.union(g.preserveAttributes,this._config.preserveAttributes);
this._config=c.defaults(this._config,g);
this.inputType=this.$input.attr("type");
this.placeholderText=this.$input.attr("placeholder");
if(this.$input.val()===""){this._addPlaceholderClass()
}if(this.inputType==="password"){this._generateField("text",false,false)
}if(this.$form&&this._config.clearOnFormSubmit){this.attachFormListener()
}},afterDecoration:function(){if(this.inputType!=="password"&&this.$input.val()===""){this.$input.val(this.placeholderText)
}},attachEventListeners:function(){if(this.inputType==="password"){this.$input.on("focus blur",this._onPassword)
}else{this.$input.on("focus blur paste",this._onText)
}},attachFormListener:function(){var i;
this.$form.off("submit.placeholder-toggle").on("submit.placeholder-toggle",c.bind(function(){i=this.$form.find("."+this._config.placeholderClass);
if(i.length){i.val("")
}},this))
},_onText:function(i){if(i.type==="focus"&&this.$input.val()===this.placeholderText){this._removePlaceholderClass();
this.$input.val("")
}if(i.type==="blur"&&this.$input.val()===""){this._addPlaceholderClass();
this.$input.val(this.placeholderText)
}},_onPassword:function(i){if(i.type==="focus"&&this.$input.val()===this.placeholderText&&this.$input.attr("type")==="text"){this._generateField("password",true,true);
this._removePlaceholderClass()
}if(i.type==="blur"&&this.$input.val()===""){this._generateField("text",false,true);
this._addPlaceholderClass()
}},_generateField:function(o,k,n){var q=e('<input type="'+o+'" />'),l=this._config.preserveAttributes,j=l.length,p,m;
for(m=0;
m<j;
m++){p=l[m];
q.attr(p,this.$input.attr(p))
}this.$input.replaceWith(q);
this.$input=q;
if(o==="text"){q.val(this.placeholderText)
}if(n){this.attachEventListeners()
}if(k){setTimeout(function(){q.focus()
},0)
}},_addPlaceholderClass:function(){this.$input.addClass(this._config.placeholderClass)
},_removePlaceholderClass:function(){this.$input.removeClass(this._config.placeholderClass)
}}
});
LIModules.exports("Placeholder",b)
}(window.require));LI.define("Genie");
LI.Genie=LI.BaseControl.extend(function(f){var a={url:null,popupWidth:790,popupHeight:580,scope:window,handleClickManual:false,useNewGenie:false},b,d="click",e="genie_popup",c="width",g="height";
return{afterDecoration:function(){var k,j,h,i=new Date().getTime();
this._config=_.defaults(this._config,a);
this._thisModule=this;
if(!this._config.url){if(this._$el.is("a")){this._config.url=this._$el.attr("href")
}else{throw new Error("No URL was supplied and no URL was found in the control.")
}}j=function(m){var l=m;
if(_.isString(m)){l=LI.Controls.resolveName(m)
}return l
};
this._config.onAllow=j(this._config.onAllow);
if(!this._config.onAllow){throw new Error("onAllow could not be found or resolved")
}this._config.onDeny=j(this._config.onDeny);
if(!this._config.onDeny){throw new Error("onDeny could not be found or resolved")
}this._config.onError=j(this._config.onError);
if(!this._config.onError){throw new Error("onError could not be found or resolved")
}this._config.onClose=j(this._config.onClose);
if(!this._config.onClose){throw new Error("onClose could not be found or resolved")
}if(this._config.scope!=="window"&&this._config.scope!==window){this._config.scope=j(this._config.scope);
if(!this._config.scope){throw new Error("scope could not be found or resolved")
}}this._WINDOW_CALLBACK="oid_cb_"+i;
this._WINDOW_CALLBACK_ALLOW=this._WINDOW_CALLBACK+"_allow";
this._WINDOW_CALLBACK_DENY=this._WINDOW_CALLBACK+"_deny";
this._WINDOW_CALLBACK_ERROR=this._WINDOW_CALLBACK+"_error";
this._WINDOW_CALLBACK_CLOSE=this._WINDOW_CALLBACK+"_close";
this._SCOPE_VAR=this._WINDOW_CALLBACK+"_scope";
h=JSON.stringify({onAllow:this._WINDOW_CALLBACK_ALLOW,onDeny:this._WINDOW_CALLBACK_DENY,onError:this._WINDOW_CALLBACK_ERROR,onClose:this._WINDOW_CALLBACK_CLOSE,scope:this._SCOPE_VAR});
if(!this._config.useNewGenie){this._config.url=this._addQueryParam(this._config.url,"cb",h)
}else{k=this._getQueryParams(this._config.url.split("?")[1]).url;
if(!k){throw new Error("New Genie requires a returnUrl param in the genie url")
}k=this._addQueryParam(k,"cb",h);
this._config.url=this._addQueryParam(this._config.url,"url",k)
}},attachEventListeners:function(){if(!this._config.handleClickManual){this._$el.on(d,this.handleClick)
}},cleanupWindowCallbacks:function(){window[this._WINDOW_CALLBACK_ALLOW]=null;
window[this._WINDOW_CALLBACK_DENY]=null;
window[this._WINDOW_CALLBACK_ERROR]=null;
window[this._WINDOW_CALLBACK_CLOSE]=null;
window[this._SCOPE_VAR]=null;
this._windowLaunched=false;
clearInterval(this._windowInterval);
this._windowInterval=null
},createWindowCallbacks:function(){window[this._WINDOW_CALLBACK_ALLOW]=function(h){this.cleanupWindowCallbacks();
this._config.onAllow.call(this._config.scope,h,this._config.obj)
};
window[this._WINDOW_CALLBACK_DENY]=function(h){this.cleanupWindowCallbacks();
this._config.onDeny.call(this._config.scope,h,this._config.obj)
};
window[this._WINDOW_CALLBACK_ERROR]=function(h){this.cleanupWindowCallbacks();
this._config.onError.call(this._config.scope,h,this._config.obj)
};
window[this._WINDOW_CALLBACK_CLOSE]=function(h){this.cleanupWindowCallbacks();
this._config.onClose.call(this._config.scope,h,this._config.obj)
};
window[this._SCOPE_VAR]=this._thisModule
},handleClick:function(h){this.createWindowCallbacks();
if(!this._popupWindow){this._popupWindow=this._createPopupWindow()
}else{this._popupWindow.focus()
}this._windowLaunched=true;
this._windowInterval=setInterval(_.bind(this._closeWindow,this),300)
},_createPopupWindow:function(){var h=c+"="+this._config.popupWidth+","+g+"="+this._config.popupHeight;
return window.open(this._config.url,e,h)
},_closeWindow:function(){if(this._windowLaunched&&this._popupWindow.closed){this.cleanupWindowCallbacks();
this._config.onClose.call(this._config.scope,{},this._config.obj);
this._popupWindow=null
}},_getQueryParams:function(i){var h={};
if(i){i=i.split("&");
$.each(i,function(j,k){k=k.split("=");
k[0]=decodeURIComponent(k[0]);
if(k[1]){h[k[0]]=decodeURIComponent(k[1])
}else{h[k[0]]=null
}})
}return h
},_addQueryParam:function(i,j,l){var m,k;
i=i||"";
m=i.split("?");
m={base:m[0],query:m[1]||""};
k=this._getQueryParams(m.query);
k[j]=l;
m.query="";
for(var h in k){if(m.query){m.query+="&"
}m.query+=encodeURIComponent(h)+"="+encodeURIComponent(k[h])
}return m.base+"?"+m.query
}}
});LI.define("ColdRegModal");
LI.ColdRegModal={inputsWithErrors:[],ERROR_CLASS:"error",FIELD_ERROR_CLASS:"field-error",handleSubmitError:function(a){var b=LI.ColdRegModal.ERROR_CLASS,d=LI.ColdRegModal.FIELD_ERROR_CLASS,c=$("#dialog");
if(a&&a.fieldErrors){if(LI.ColdRegModal.inputsWithErrors.length){$.each(LI.ColdRegModal.inputsWithErrors,function(e,g){var f=c.find("#"+g).parent();
f.removeClass(b);
f.find("."+d).remove()
});
LI.ColdRegModal.inputsWithErrors=[]
}$.each(a.fieldErrors,function(g,e){var f=c.find("#"+g).parent(),h=$("<div></div>").addClass(d).html(e);
LI.ColdRegModal.inputsWithErrors.push(g);
f.addClass(b).prepend(h)
})
}}};
LI.ColdRegModal.Genie={onAllow:function(e){var b=$("#dialog"),h=e.results.identificationData.FIRST_NAME,i=e.results.identificationData.LAST_NAME,g=e.results.identificationData.EMAIL,d=b.find('input[name="firstName"]'),c=b.find('input[name="lastName"]'),f=b.find('input[name="email"]'),a=b.find('input[name="genie-reg"]');
if(h&&d){d.val(h)
}if(i&&c){c.val(i)
}if(g&&f){f.val(g)
}if(a){a.val("FACEBOOK")
}e.win.close()
},onDeny:function(a){a.win.close()
},onError:function(a){a.win.close()
}};LI.define("FrontierAJAXForm");
LI.FrontierAJAXForm=function(c,e){e=e||{};
e.backgroundColor=e.backgoundColor||"#fff";
e.injectAfter=e.injectAfter||".actions .btn-primary";
e.enableAJAX=(e.enableAJAX!==false)?true:false;
e.enableDemo=e.enableDemo||false;
e.errorId=e.errorId||YDom.generateId();
e.useGlobalError=e.useGlobalError||false;
e.injectGlobalError=(e.injectGlobalError!=="undefined"&&e.injectGlobalError===false)?false:true;
e.injectGlobalErrorOnly=e.injectGlobalErrorOnly||false;
e.successCallback=e.successCallback||null;
e.successCallbackScope=e.successCallbackScope||window;
e.exceptionCallback=e.exceptionCallback||null;
e.errorCallback=e.errorCallback||null;
e.failureCallback=e.failureCallback||null;
e.failureCallbackScope=e.failureCallbackScope||window;
e.scrollIntoViewOnError=(e.scrollIntoViewOnError!==undefined)?e.scrollIntoViewOnError:true;
e.showCloseInError=(e.showCloseInError!==undefined)?e.showCloseInError:false;
e.successParameters=(e.successParameters!==undefined)?e.successParameters:{};
e.addProgressIndicator=(e.addProgressIndicator!==undefined)?e.addProgressIndicator:true;
e.enableResizeScreen=(e.enableResizeScreen!==undefined)?e.enableResizeScreen:true;
e.useDecodeURIComponent=!!e.useDecodeURIComponent;
if(e.useGlobalError){e.errorId="global-error"
}var b=this;
var j=YDom.getRegion(c);
var l=16;
b.successHandlers=[];
b.failureHandlers=[];
var f=Y$(e.injectAfter,c,true);
var k=f;
if(k){while(k.nextSibling){if(k.nextSibling.nodeType===1){YDom.addClass(k.nextSibling,"hidden")
}k=k.nextSibling
}}var o=document.createElement("div");
YDom.addClass(o,"screen");
c.appendChild(o);
if(e.addProgressIndicator){var g=document.createElement("div");
var n=YDom.getRegion(f).height;
n=(n>l)?n:l;
if(f){if(f.nextSibling){f.parentNode.insertBefore(g,f.nextSibling)
}else{f.parentNode.appendChild(g)
}}YDom.addClass(g,"progress-indicator");
YDom.setStyle(g,"lineHeight",n+"px")
}var a=function(r){var q=YDom.get(e.errorId);
if(!q){q=document.createElement("div");
q.id=e.errorId;
c.parentNode.insertBefore(q,c)
}LI.injectAlert(r,"error",q,false,e.showCloseInError);
if(e.scrollIntoViewOnError){q.scrollIntoView()
}};
var m=function(){YDom.removeClass(c,"form-submit-processing");
YDom.removeClass(f,"disabled");
YDom.setStyle(o,"display","none")
};
var d=function(){var q=YDom.getRegion(c);
if(!j||!j.width){j=YDom.getRegion(c)
}YDom.setStyle(o,"width",j.width+"px");
YDom.setStyle(o,"height",q.height+"px");
YDom.setStyle(o,"margin-top",(q.height*-1)+"px")
};
var i=function(q){location.href=q
};
var p=function(t){if(YDom.hasClass(c,"form-submit-processing")){YEvent.preventDefault(t);
return
}YDom.addClass(c,"form-submit-processing");
YDom.addClass(f,"disabled");
var s=YDom.getRegion(c);
YDom.setStyle(o,"backgroundColor",e.backgroundColor);
YDom.setStyle(o,"display","block");
if(e.enableResizeScreen){d()
}var q=document.createElement("input");
YDom.setStyle(q,"opacity",0);
YDom.setStyle(q,"height","1px");
YDom.setStyle(q,"width","1px");
YDom.setStyle(q,"display","inline");
c.appendChild(q);
q.focus();
c.removeChild(q);
delete (q);
if(e.enableDemo){if(t){YEvent.stopEvent(t)
}var r=(e.enableDemo=="success")?LI.FrontierAJAXForm.DEMO_SUCCESS:LI.FrontierAJAXForm.DEMO_FAILURE;
b.handleFormSuccess=i;
b.injectGlobalFormError=a;
b.markFormErrors=markFormErrors;
b.resetFormSubmission=m;
window.setTimeout(function(){r.call(b)
},5000);
return false
}if(e.enableAJAX){if(t){YEvent.preventDefault(t)
}window.setTimeout(function(){h()
},1);
return false
}};
var h=function(){YAHOO.util.Connect.setForm(c);
LI.asyncRequest("POST",YDom.getAttribute(c,"action"),{custom:{error:function(q){LI.removeAlert();
if(e.injectGlobalError||e.injectGlobalErrorOnly){if(q.globalError){a(q.globalError)
}else{if(!e.injectGlobalErrorOnly){a(LI.i18n.get("oneOrMoreErrors"))
}}}if(e.errorCallback){e.errorCallback(q)
}m();
if(e.enableResizeScreen){d()
}},exception:function(){if(e.exceptionCallback){e.exceptionCallback()
}}},success:function(t){t.successParameters=e.successParameters;
for(var r=0,q=b.successHandlers.length;
r<q;
r++){var s=b.successHandlers[r];
s.fn.call(s.scope,t)
}},failure:function(t){for(var r=0,q=b.failureHandlers.length;
r<q;
r++){var s=b.failureHandlers[r];
s.fn.call(s.scope,t)
}},timeout:25000},null,e.useDecodeURIComponent)
};
this.addSuccessHandler=function(r,q){b.successHandlers.push({fn:r||function(){},scope:q||window})
};
this.addFailureHandler=function(r,q){b.failureHandlers.push({fn:r||function(){},scope:q||window})
};
if(e.successCallback){e.successCallback=(typeof(e.successCallback)=="string")?LI.Controls.resolveName(e.successCallback):e.successCallback;
if(!e.successCallback){throw new Error(e.successCallback+" is not defined")
}this.addSuccessHandler(e.successCallback,e.successCallbackScope)
}if(e.failureCallback){this.addFailureHandler(e.failureCallback,e.failureCallbackScope)
}this.resetFormSubmit=m;
this.submitForm=p;
YEvent.on(c,"submit",p)
};(function(){var c=LIModules.requires("jquery"),h=LIModules.requires("underscore"),f=LIModules.imports("Controls")||{},b=LIModules.requires("BaseControl"),i=LIModules.requires("i18n"),g=LIModules.imports("Controls.parseFragment")||function(){},d=null;
var e=function(j){if(d&&typeof d==="function"){d()
}d=j
};
var a=b.extend(function(n){var l={width:500,top:150,xOffset:0,yOffset:0,errorMessage:"We're sorry. Something unexpected happened and your request could not be completed. Please try again.",closeText:"Close",startText:"Dialog start",endText:"Dialog end",customClassName:undefined,dialogTemplate:"tl/shared/dialog",dialogCss:["css!scss/modules/dialog_v3"],cssDependencies:null,templateDataUrl:null,centerVertically:false,fitDialogBoxToWindow:true},m="click",q="keyup",j="resize",k="dialog-body",p=50;
function o(){var t=[{key:"errorMessage",value:"dialogbox_error_generic"},{key:"closeText",value:"dialogbox_close"},{key:"startText",value:"dialogbox_start"},{key:"endText",value:"dialogbox_end"}],r=t.length,u=0,s={},v="";
for(;
u<r;
u++){v=i.get(t[u].value);
if(v){s[t[u].key]=v
}}return s
}return{beforeDecoration:function(){this._$dialog=undefined;
this._config=h.defaults(this._config,o(),l);
this._requiredTemplates=[this._config.dialogTemplate];
this._requiredCSS=h.flatten(h.compact([this._config.dialogCss,this._config.cssDependencies]));
this._href=this._config.templateDataUrl||this._$el.data("href")||this._$el.attr("href")
},attachEventListeners:function(){this._$el.on(m,h.bind(this._eventOpen,this))
},detachEventListeners:function(){this._$el.off(m)
},onResolve:function(r){this.open()
},_eventOpen:function(r){r.preventDefault();
this.open()
},_eventClose:function(r){r.preventDefault();
this.close()
},_keyupHandler:function(r){if(r.which===27){this._eventClose(r)
}},_resizeHandler:h.throttle(function(r){if(this._$dialog&&this._$dialog.length){this._$dialog.css(this._getPosition());
this._fitToWindow()
}},500),_attachEventListeners:function(){this._$dialog.on(m,".dialog-close",this._eventClose);
c(document).on(q,this._keyupHandler);
c(window).on(j,this._resizeHandler)
},open:function(){return c.when(this.loadDependencies(this._requiredTemplates),this.loadCss(this._requiredCSS)).then(e(h.bind(this.close,this))).then(h.bind(this._render,this)).then(h.bind(this.setFocusToDialog,this))
},close:function(){if(this._$dialog){this._$dialog.remove()
}c(document).off(q,this._keyupHandler);
c(window).off(j,this._resizeHandler);
this._$el.focus()
},destroy:function(){this.close();
this.detachEventListeners();
n.destroy.apply(this,arguments)
},setFocusToDialog:function(){this._$dialog.attr("tabindex",-1);
this._$dialog.focus()
},_loadContent:function(){var s=c(this._href),r=s.html(),t=new c.Deferred();
if(s[0]||!this._href){t.resolve(r)
}else{t.reject()
}return t.promise()
},_buildMarkup:function(){return this._renderDialogMarkup().then(this._renderMarkUpSuccess,this._renderMarkUpFailure)
},_renderMarkUpSuccess:function(r){this._$dialog=c(r).prop("id","modeless-dialog").addClass(this._config.customClassName);
this._$dialog.css(this._getPosition());
c("body").append(this._$dialog)
},_renderMarkUpFailure:function(){throw new Error("Unable to render dialog markup")
},_loadContentSuccess:function(r){this.setDialogBodyContent(r)
},_loadContentFail:function(){this.setDialogBodyContent(this._config.errorMessage)
},setDialogBodyContent:function(r){this._$dialog.find("."+k).html(r);
g(this._$dialog);
this._$dialog.css(this._getPosition());
this._fitToWindow()
},_render:function(){return this._buildMarkup().then(this._loadContent).then(this._loadContentSuccess,this._loadContentFail).then(this._attachEventListeners)
},_renderDialogMarkup:function(){var s=new c.Deferred();
dust.render(this._config.dialogTemplate,this._config,function r(u,t){if(u){s.reject(u)
}else{s.resolve(t)
}});
return s.promise()
},_getPosition:function(){var t=c(window),r=this._config.top,s=((t.innerWidth()/2)-(this._config.width/2))+this._config.xOffset;
if(this._config.centerVertically){r=((t.innerHeight()/2)-(this._$dialog.outerHeight()/2))+this._config.yOffset;
r=Math.max(r,this._config.top)
}return{left:s,top:r}
},_fitToWindow:function(){var r=c(window).innerHeight()-this._config.top-p,t=this._$dialog.find(".dialog-title").outerHeight(),s;
s=this._$dialog.clone().css("visibility","hidden");
s.find(".dialog-body").height("auto");
c("body").append(s);
if(s.height()>r&&this._config.fitDialogBoxToWindow){this._$dialog.find(".dialog-body").height(r-t)
}else{this._$dialog.find(".dialog-body").height("auto")
}s.remove()
}}
});
LIModules.exports("DialogBox",a)
}(window.require));
(function(c){var e=LIModules.requires("jquery"),b=LIModules.requires("underscore"),a=LIModules.requires("DialogBox");
var d=a.extend(function(j){var h={maskTemplate:"tl/shared/dialog_mask",fitToWindow:true,closeOnMaskClick:true},i="click",k="keyup",f="resize",g="focusin";
return{beforeDecoration:function(){j.beforeDecoration.call(this);
this._config=b.defaults(this._config,h);
this._requiredTemplates=[this._config.maskTemplate,this._config.dialogTemplate];
this._requiredCSS=b.flatten(b.compact([this._config.dialogCss,this._config.cssDependencies]));
this._$mask=undefined;
this._initialHtmlOverflowValue=undefined;
if(!this._config.fitToWindow){this._fitToWindow=function(){}
}},_maskClickHandler:function(l){if(e(l.target).is("#dialog-mask")){this._eventClose(l)
}},_attachEventListeners:function(){j._attachEventListeners.call(this);
if(this._config.closeOnMaskClick){this._$mask.on(i,this._maskClickHandler)
}e(document).on(g,this._trapFocus)
},close:function(){if(this._$mask){this._$mask.remove()
}e(document).off(k,this._keyupHandler);
e(window).off(f,this._resizeHandler);
e("html").css({overflow:this._initialHtmlOverflowValue});
this._$el.focus()
},_buildMarkup:function(){return e.when(this._renderMaskMarkup(),this._renderDialogMarkup()).then(this._renderMarkUpSuccess,this._renderMarkUpFailure)
},_renderMarkUpSuccess:function(m,l){this._$mask=e(m);
this._$dialog=e(l);
this._$dialog.css(this._getPosition());
this._$mask.append(this._$dialog);
if(!this._config.fitToWindow){this._$mask.css({"overflow-y":"auto"})
}e("body").append(this._$mask)
},_render:function(){this._initialHtmlOverflowValue=e("html").css("overflow");
e("html").css({overflow:"hidden"});
return this._buildMarkup().then(this._loadContent).then(this._loadContentSuccess,this._loadContentFail).then(this._attachEventListeners)
},_renderMaskMarkup:function(){var m=new e.Deferred();
dust.render(this._config.maskTemplate,this._config,function l(o,n){if(o){m.reject(o)
}else{m.resolve(n)
}});
return m.promise()
},_trapFocus:function(l){l.stopPropagation();
if(this._$dialog.is(e(l.target))||this._$dialog.has(e(l.target)).length>0){return false
}else{this._$dialog.focus()
}}}
});
LIModules.exports("ModalDialogBox",d)
}());