dmjs.addLoadEvent(function(){var t,e=document,n="https:"==e.location.protocol?"https":"http",o="https"==n?"https://info.evidon.com/c/betrad/pub/":"http://cdn.betrad.com/pub/";e.getElementById("_bapw-icon").src=o+"icon1.png",$(".ad-choice").click(function(){function t(t,n){function o(){i.onload=i.onreadystatechange=null,a.removeChild(i),n()}var a=e.getElementsByTagName("head")[0]||e.documentElement,c=!1,i=e.createElement("script");i.src=t,i.onreadystatechange=function(){c||"loaded"!=this.readyState&&"complete"!=this.readyState||(c=!0,o())},i.onload=o,a.insertBefore(i,a.firstChild)}var a=this;return t(n+"://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js",function(){t(o+"pub1.js",function(){BAPW.i(a,{pid:46,ocid:374},!1)})}),!1}),t=new Image,t.src=n+"://l.betrad.com/pub/p.gif?pid=46&ocid=374&ii=1&r="+Math.random()},20);0!=dmjs.revenueTags.length&&$("").attr("scheme","DMINSTR2").attr("name","ltvtag").attr("content",encodeURIComponent(dmjs.revenueTags.join("|"))).appendTo($("head"));var _comscore=_comscore||[];_comscore.push(dmjs.global.comscore),function(){var c=document.createElement("script"),e=document.getElementsByTagName("script")[0];c.async=!0,c.src=("https:"==document.location.protocol?"https://sb":"http://b")+".scorecardresearch.com/beacon.js",e.parentNode.insertBefore(c,e)}();function loadFacebookAPI(){var e=document.createElement("script"),t=dmjs.global.facebook.app_id,n=dmjs.global.facebook.api_version;e.src="//connect.facebook.net/en_US/sdk.js#xfbml=1&version="+n+"&appId="+t,document.body.appendChild(e)}function showFacebookComment(){setTimeout(function(){$(".js-loading_icon").hide(),$(".js-fb-comments").show()},4e3)}function sticky_nav(){var e=$(window).scrollTop(),t=$(".js-top_header"),n=$('[data-section="body"]').eq(0),i=n.position().top>0?n.position().top:"100";e>=50&&!t.hasClass("top_header--fixed")?(n.css({position:"relative",top:i+"px",marginBottom:"125px"}),t.addClass("top_header--fixed")):50>e&&t.hasClass("top_header--fixed")&&(t.removeClass("top_header--fixed"),n.removeAttr("style"))}function anti_spam_bots_service(){$.ajax({url:"/service/registration/botFields/",type:"GET",async:!1}).done(function(e){$("input[name=timestamp]").val(e.timestamp),$("input[name=timestamp_hash]").val(e.timestamp_hash),$("#username").attr("name",e.unique_username_field_name);var t=parseInt($('input[name="timestamp"]').val())-54321;t=String(t).split("").reverse().join(""),$('input[name="spam_bot_javascript_check"]').val(t)})}var dartAds=function(win,doc){var perfTest=-1!=win.location.search.indexOf("perftest=true"),_page=!1,_params=[],_tile=1,_ord,_deferredAds={},_siteCodeOR="";win.dartAdComplete=function(e,t,n){var i=doc.getElementById(e).firstChild;i.width=t+"px",i.height=n+"px"};var generateUrl=function(e,t){var n,i=[],r=[],o=[],a=0,s=e.length;if(!_public.defaults.server||!_public.defaults.siteCode)return"";for(i.push(_public.defaults.server),i.push(t?"adi":"adj"),i.push("/"),i.push(""===_siteCodeOR?_public.defaults.siteCode:_siteCodeOR),i.push("/"+_page+";");s>a;a++){var c=e[a];for(n in c)if("object"==typeof c[n])for(var l=0;l0&&i.push(win.dexQS+";"),i.push("dc_ref="+_dc_ref+";"),i.push("tile="+_tile+";"),"undefined"!=typeof crtg_content&&crtg_content.length>0&&i.push(crtg_content+";"),i.push("ord="+_ord+"?"),_tile++,i.join("")},_public={getAdUrl:function(e,t){var n,i,r=[];for(n=0;n<_params.length;n++)r.push(_params[n]);for(i=0;i':'
'},setParams:function(e,t){_page=e,_params=t,_ord=Math.floor(1e13*Math.random()),_dc_ref=window.location.href.replace("#","-")},renderAd:function(e,t,n){if(_page&&_params){var i=this.getAd(e,t,n);doc.write(i)}},renderiFrameAd:function(e,t,n,i){var r=i||"";if(_siteCodeOR=r,dmjs.global.opDART160Test&&"160x600"===e[0].sz&&(e[0].test="onesixty"),dmjs.platform.isTablet())return void this.renderAd(e,t,n);var o="DartAd_"+Math.round(1e7*Math.random()),a=this.getAdUrl(e);if(a){var s=doc.createElement("iframe"),c="/media/ad.html?divId="+o+"&w="+t+"&ad="+escape(a);s.scrolling="no",s.frameBorder="no",s.marginHeight="0",s.marginWidth="0",s.height=n||"0px",s.width="0px",doc.write("
"),doc.getElementById(o).appendChild(s),s.contentWindow.location.href=c}},renderAdDynamic:function(e,t,n,i){var r="DartAd_"+Math.round(1e7*Math.random()),o=this.getAdUrl(t);if(o){var a=doc.createElement("iframe"),s="/media/ad.html?divId="+r+"&w="+n+"&ad="+escape(o);a.scrolling="no",a.frameBorder="no",a.marginHeight="0",a.marginWidth="0",a.height=i||"0px",a.width="0px";var c=$("
");c.find("#"+r).append(a),$(e).append(c),a.contentWindow.location.href=s}},renderAdElements:function(nodes){var i=0,ii=nodes.length;if(_page&&_params)for(;ii>i;i++){var node=nodes[i],size=eval(node.getAttribute("data-dartAdSize")),params=eval(node.getAttribute("data-dartAdParams"));if("1"==node.getAttribute("data-dartCompanion")){var adUrl=this.getAdUrl(params,!1);win.adaptvCompanionAdTag=adUrl}else{var ad=this.getAd(params,size[0],size[1]);ad&&(node.innerHTML=ad)}}},defaults:{server:null,siteCode:null,staging:!1}};return _public}(window,document),OmnitureLinkSet=function(e,t,n,i,r){var o=new LinkTracking(e,i);return r&&o.setRCPSpecifics(r),o.linksetId(t).location(n).run()},linkTracking=function(e){return new LinkTracking(e)},LinkTracking=function(e,t){this.el=e,this.props={encode:!0,debug:!1},this.rcp_specifics={algo_id:null,request_id:null,weight_config_name:null,widget_id:null,category:null},this.rcp_mappings={algo_id:"wa_user1",request_id:"wa_un",weight_config_name:"wa_user2",widget_id:"wa_wsid",category:"category"},this.uniqueLinks={},t&&(this.props.objectType="PLATFORM"),this.linkTags=$("a",this.el),this.baseUrl="//"+_omnitureLinkSetDomain+"/images/zig.gif?",this._getUrls()};LinkTracking.prototype.debug=function(e){return this.props.debug=e,this},LinkTracking.prototype.linksetId=function(e){return this.props.linksetId=e,this},LinkTracking.prototype.location=function(e){return this.props.location=e,this},LinkTracking.prototype.type=function(e){return this.props.objectType=e,this},LinkTracking.prototype.setRCPSpecifics=function(e){for(key in e)this.rcp_specifics[key]=e[key];return this},LinkTracking.prototype.extendRCPData=function(e){for(key in this.rcp_specifics)null!==this.rcp_specifics[key]&&""!==this.rcp_specifics[key]&&(e[this.rcp_mappings[key]]=this.rcp_specifics[key]);return e},LinkTracking.prototype._serialize=function(e){var t=[];for(var n in e)t.push(n+"="+e[n]);return t.join("&")},LinkTracking.prototype._getUrls=function(){this.urlMap={},this.urls=[];for(var e,t=1,n=0;n"),this)},LinkTracking.prototype.bindClickTracking=function(){var e=this;return this.linkTags.bind("click",function(t){t.preventDefault();var n=$(this),i=n.attr("href"),r=e.urlMap[encodeURIComponent(i)],o={Log:1,v:"JT01.02",ev:"lnkimpression_click",wa_page_click:encodeURIComponent(window.location.href),vid:e._getRandomNumber(),exp_name:e._getExpName()};e.props.linksetId&&(o.wa_lst_click=e.props.linksetId),e.props.location&&(o.wa_mp_click=e.props.location),e.props.objectType&&(o.wa_wot=e.props.objectType),e.extendRCPData(o);var a=e.props.encode?encodeURIComponent(i):i;o.wa_l_click=a+";"+r;var s=e._serialize(o),c=String.format("http://{0}/images/zig.gif?{1}",_omnitureLinkSetDomain,s);$("body").append(""),i&&window.setTimeout(function(){window.location=i},500)}),this},LinkTracking.prototype.run=function(){return 0!=this.el.length&&(this.trackImpression(),this.bindClickTracking()),this},$(function(){var e="div[data-type='adTracking']";$(e+" a, "+e+" div.GoogleFlashAd div.Ad").bind("mouseup",function(){var t=$(this).parents(e);_JT.DM_Click(t[0])})}),"undefined"==typeof LSAPP.Service&&(LSAPP.Service=function(e){var t=this,n="www.livestrong.com";-1!==location.host.indexOf("ehowdev")&&(n=location.host.replace(/ehowdev/,"livestrongdev")),t.path="http://"+n+"/service/"+e+"/"},LSAPP.Service.prototype.get=function(e,t){return this.call("get",e,t)},LSAPP.Service.prototype.post=function(e,t){return this.call("post",e,t)},LSAPP.Service.prototype.put=function(e,t){return e._method="PUT",this.call("post",e,t)},LSAPP.Service.prototype.deletes=function(e,t){return e._method="DELETE",this.call("post",e,t)},LSAPP.Service.prototype.call=function(e,t,n){var i=this;return"function"==typeof n&&(n={success:n}),n.type=e,n.url=i.path,n.data=t,$.ajax(n)},LSAPP.Service_Factory={build:function(e){return new LSAPP.Service(e)}}),function(e){var t={};e.fn.tpl=function(t,n){return this.html(e.tpl(t,n))},e.tpl=function n(e,i){try{var r=/\W/.test(e)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+e.replace(/[\r\t\n]/g,"").split("[!").join(" ").replace(/((^|!\])[^\t]*)'/g,"$1\r").replace(/\t=(.*?)!\]/g,"',$1,'").split(" ").join("');").split("!]").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):t[e]=t[e]||n(document.getElementById(e).innerHTML);return i?r(i):r}catch(o){}}}(jQuery),"undefined"==typeof lsapp.Notifications&&(lsapp.Notifications=function(){var e=this;return e.notifications=[],e.query=e.unread_counter=0,e.hide_seconds_after=5e3,e.lsapp_notification=$("#lsapp_widget_notifications"),e.host="www.livestrong.com",-1!==location.host.indexOf("ehowdev")&&(e.host=location.host.replace(/ehowdev/,"livestrongdev")),e.firebase_auth=function(){var e,t=this;$.getJSON("http://"+t.host+"/service/firebase/token/?_format=jsonp&callback=?",function(n){n.token&&(t.timestamp=n.timestamp,t.query=n.timestamp-10,t.firebase=new Firebase(n.path),t.firebase.auth(n.token,function(n){n||(e=t.firebase.endAt().limit(5),e.on("child_added",function(e){e.timestamp=t.timestamp,t.child_added_event(e)}),t.firebase.on("value",function(e){t.update_notification_counter(e)}))}),$.getJSON("http://"+t.host+"/service/user/preference/?_format=jsonp&key=show_notifications&callback=?",function(e){var t;1==e.show_notifications&&(t=$("#notification_settings_menu"),t.find(".toggle_notifications").addClass("updated"))}))})},e.handle=function(){var e=this;return{click_close_bubble:function(t){var n=$(t.target||t.srcElement);return e.bubble_timeout("stop",n),n.parent(".notification_bubble").fadeOut(500),!1},click_disable_notifications:function(t){return e.toggle_notifications(t,!1),!1},click_redirect_notification:function(e){var t=e.closest(".notification_bubble").data("destination");window.location=t},hover_reset_timeout:function(t){var n=$(t.target||t.srcElement);return n.hasClass("notification_bubble")&&("mouseenter"==t.type?e.bubble_timeout("stop",n):e.bubble_timeout("start",n)),!1}}},e.toggle_notifications=function(e,t){var n=function(t){LSAPP.Service_Factory.build("user/preference").post({preferences:{show_notifications:t}},function(){("undefined"!=e||null!=e)&&$(e).toggleClass("updated")})};"undefined"!=typeof t?n(t):LSAPP.Service_Factory.build("user/preference").get({key:"show_notifications"},function(e){n(Number(e.show_notifications)?0:1)})},e.bind_ui=function(){var e=this,t=window;$(t).click(function(e){var t=$(e.target||e.srcElement),n=$("#login_module");n.is(":visible")&&n.hide(),!t.parents("#event_notifier").length>0&&"event_notifier"!=t.attr("id")&&$("#event_history_wrapper").hasClass("open")&&$("#event_notifier").click()}),e.history_element=$("#event_notifier"),e.history_element&&($("#event_notifier").hover(function(){var t=e.history_element.find("#event_history_wrapper");t.hasClass("open")?(t.removeClass("open"),e.history_element.find("#notification_settings_menu").hide(),e.history_element.find("#notification_settings_menu"),e.history_element.find(".count").hide().text(e.unread_counter=0)):t.addClass("open")}),e.history_element.click(function(t){var n=t.target||t.srcElement,i=$(n).data("lsapp-cmd");switch(i){case"notification_settings":e.history_element.find("#notification_settings_menu").toggle(),t.stopPropagation();break;case"toggle_notifications":e.toggle_notifications(n);break;case"username":case"avatar":t.stopPropagation();break;default:var r=$(n).closest("li").data("lsapp-cmd");"undefined"!=typeof r&&(r=JSON.parse(decodeURIComponent(r)),e.delete_notification(r.path,function(){$(n).closest("li").fadeOut("fast",function(){$(this).remove(),e.history_element.find(".event_history").children("li").size()<=1&&e.history_element.find(".no_notifications").show(),window.location=r.url,$(n).remove()})}))}}))},e.bubble_timeout=function(e,t){var n=this,i=t.attr("data-bubble_timeout");try{switch("undefined"!=typeof i&&clearTimeout(i),e){case"start":t.attr("data-bubble_timeout",setTimeout(function(){t.fadeOut(350)},n.hide_seconds_after)).addClass("start");break;case"stop":default:t.removeClass("start").removeAttr("data-bubble_timeout")}}catch(r){}},e.child_added_event=function(e){var t=this,n=e.val();if(n.offset=t.translate_time(e.timestamp,n.timestamp),"undefined"!=typeof n||null!==n){if(n.path=e.name(),n.timestamp>t.query){var i=$($.tpl("notification_element",n));i&&($("#lsapp_widget_notifications").children(".notification_popup_container").append(i),t.notifications[n.path+""]=n,t.bubble_timeout("start",i))}t.unread_counter++,t.update_notification_history(n)}},e.translate_time=function(e,t){var n,i,r=1e3,o=new Date(e*r),a=new Date(t*r),s=(o.getTime()-a.getTime())/1e3;return 0>s?(i="s",n="1"+i):60>s&&s>0?(i="s",n=s+i):s>60&&3600>s?(i="m",s=Math.ceil(s/60),n=s+i):s>3600&&86400>s?(i="h",s=Math.ceil(s/3600),n=s+i):(i="d",n=" > 1"+i),n},e.delete_all_notifications=function(){var e=this;for(var t in e.notifications)e.delete_notification(t),delete e.notifications[t]},e.delete_notification=function(e,t){LSAPP.Service_Factory.build("notification/notification/socketpush/firebase").deletes({path:e},function(){"function"==typeof t&&"undefined"!=t&&t()})},e.update_notification_counter=function(t){e.unread_counter=t.numChildren(),e.history_element=$("#event_notifier"),e.unread_counter>0&&e.history_element.find(".count").show().text(e.unread_counter)},e.update_notification_history=function(e){var t,n=this,i={url:e.destination,path:e.path},r=n.history_element.find(".event_history"),o=5,a=100,s={truncate:{context:33}};if(e=n.notification_history_preprocess(e,s),e.notification_obj=encodeURIComponent(JSON.stringify(i)),n.history_element){var c=$.tpl("notification_history",e);c&&(r.prepend(c),t=r.children("li").not(".no_notifications").size(),t>=o?(r.css("overflow-y: scroll"),r.height(a*o)):(r.css("overflow-y: hidden"),r.css("height: auto"))),0!=n.unread_counter&&n.history_element.find(".no_notifications").hide()}},e.notification_history_preprocess=function(e,t){var e=e||{},t=t||{};for(var n in t)switch(n){case"truncate":for(var i in t.truncate)e.hasOwnProperty(i)&&(e[i]=e[i].length>=t.truncate[i]?e[i].substring(0,t.truncate[i])+"…":e[i])}return e},{init:function(){var t=$("#lsapp_widget_notifications");e.firebase_auth(),e.bind_ui(),function(){var n=e.handle();t.find(".close_notification").live("click",function(e){n.click_close_bubble(e)}),t.find(".notification_bubble .notifications_settings").live("click",function(e){var t=e.target||e.srcElement;n.click_disable_notifications($(t))}),t.find(".notification_bubble").live("click",function(e){var t=e.target||e.srcElement;n.click_redirect_notification($(t))}),t.find(".notification_bubble").live("hover",function(e){n.hover_reset_timeout(e)})}()}}}),function(){function e(){return"true"===dmjs.cookies.readCookie("loggedin")}function t(){return 3===parseInt(dmjs.cookies.readCookie("user_rank"))}function n(){return"object"==typeof dartAds}function i(){return"object"==typeof googleAds}function r(){return"object"==typeof googletag}var o,a=$("meta[name=wa_clvl]");t()&&(n()&&(dartAds.renderiFrameAd=function(){}),i()&&(googleAds.addAdUnit=function(){}),r()&&(googletag.cmd.push=function(){}),$("head").append($(''))),e()&&a.length>0&&(o=t()?2:1,a.attr("content",o))}(),function(){var e=!1,t=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){},Class.extend=function(n){function i(){!e&&this.init&&this.init.apply(this,arguments)}var r=this.prototype;e=!0;var o=new this;e=!1;for(var a in n)o[a]="function"==typeof n[a]&&"function"==typeof r[a]&&t.test(n[a])?function(e,t){return function(){var n=this._super;this._super=r[e];var i=t.apply(this,arguments);return this._super=n,i}}(a,n[a]):n[a];return i.prototype=o,i.constructor=i,i.extend=arguments.callee,i}}(),!function(e){var t={};t.guid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)}).toUpperCase()},t.extend=function(){throw new Error("Fidel.extend is deprecated, please use Fidel.ViewController.extend")};var n=e.Fidel;t.noConflict=function(){return e.Fidel=n,this},e.Fidel=t}(this),!function(e){var t=!1,n=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;e.Class=function(){},e.Class.extend=function(i){function r(n){if(!t){if(this.guid=e.guid(),this.defaults)for(var i in this.defaults)"object"==typeof n&&n[i]||(this[i]=this.defaults[i]);if("object"==typeof n)for(var r in n)this[r]=n[r];this._initialize&&this._initialize.apply(this,arguments),this.init&&this.init.apply(this,arguments)}}var o=this.prototype;t=!0;var a=new this;t=!1;for(var s in i)a[s]="function"==typeof i[s]&&"function"==typeof o[s]&&n.test(i[s])?function(e,t){return function(){var n=this._super;this._super=o[e];var i=t.apply(this,arguments);return this._super=n,i}}(s,i[s]):i[s];return r.prototype=a,r.prototype.proxy=function(e){var t=this;return function(){return e?e.apply(t,arguments):void 0}},r.constructor=r,r.extend=arguments.callee,r}}(Fidel||this),!function(e){var t={};e.publish=function(e,n){for(var i=t[e],r=i?i.length:0;r--;)i[r].apply(this,n||[])},e.subscribe=function(e,n){return t[e]||(t[e]=[]),t[e].push(n),[e,n]},e.unsubscribe=function(e){for(var n=t[e[0]],i=e[1],r=n?n.length:0;r--;)n[r]===i&&n.splice(r,1)},e.Class.prototype.on=e.Class.prototype.bind=function(t,n){return e.subscribe(this.guid+"."+t,this.proxy(n))},e.Class.prototype.emit=e.Class.prototype.trigger=function(t,n){e.publish(this.guid+"."+t,n),e.publish(t,n)},e.Class.prototype.removeListener=e.Class.prototype.unbind=function(t){e.unsubscribe(t)}}(Fidel||this),function(e){var t=/^(\w+)\s*(.*)$/,n=e.Class.extend({_initialize:function(){if(!this.el)throw"el is required";this._subscribeHandles={},this._processedActions={},this.events&&this.delegateEvents(),this.elements&&this.refreshElements(),this.templateSelector&&this.loadTemplate(),this.actionEvent||(this.actionEvent="click"),this.subscribe&&this.bindSubscriptions(),this.delegateActions(),this.getDataElements()},delegateEvents:function(){for(var e in this.events){var n=this.events[e],i=e.match(t),r=i[1],o=i[2],a=this.proxy(this[n]);""===o?this.el.bind(r,a):this.el.delegate(o,r,a)}},delegateActions:function(){for(var e=this.find("[data-action]"),t=0,n=e.length;n>t;t++){var i=$(e[t]),r=i.attr("data-action"),o=this.proxy(this[r]),a=this.actionEvent,s='[data-action="'+r+'"]';this._processedActions[r]||(this.el.delegate(s,a,o),this._processedActions[r]=!0)}},refreshElements:function(){for(var e in this.elements)this[e]=this.find(this.elements[e])},getDataElements:function(){for(var e=this,t=this.find("[data-element]"),n=0,i=t.length;i>n;n++){var r=t[n].getAttribute("data-element");if(!e[r]){var o=this.find('[data-element="'+r+'"]');e[r]=o}}},bindSubscriptions:function(){for(var e in this.subscribe)this._subscribeHandles[e]=Fidel.subscribe(e,this.proxy(this[this.subscribe[e]]))},loadTemplate:function(){this.template=$(this.templateSelector).html()},find:function(e){return $(e,this.el[0])},render:function(e,t){var n=window.str||$;if(n){var i=n.template(this.template,e);t=t?$(t):this.el,t.html(i)}},destroy:function(){for(var e in this._subscribeHandles)Fidel.unsubscribe(this._subscribeHandles[e]);for(var t in this._processedActions)this.el.unbind(t);this.el=null}});e.ViewController=n}(Fidel||this),function(e){e.fn.nomon=function(t){var n=this,t=t||{},i=this.text().split(" ");t.words=t.words||20,i.length<=t.words||(i.splice(t.words,0,''),i.push(""),i.push('Read More'),this.html(i.join(" ")),this.find('a[data-action="toggleHiddenText"]').one("click",function(t){t.preventDefault(),n.find('span[data-action-receiver="toggleHiddenText"]').show(),e(this).hide(),n.trigger("toggedText")}))}}(jQuery),function(e,t,n){function i(e){var t={},i=/^jQuery\d+$/;return n.each(e.attributes,function(e,n){n.specified&&!i.test(n.name)&&(t[n.name]=n.value)}),t}function r(e,t){var i=this,r=n(i);if(i.value==r.attr("placeholder")&&r.hasClass("placeholder"))if(r.data("placeholder-password")){if(r=r.hide().next().show().attr("id",r.removeAttr("id").data("placeholder-id")),e===!0)return r[0].value=t;r.focus()}else i.value="",r.removeClass("placeholder"),i==a()&&i.select()}function o(){var e,t=this,o=n(t),a=this.id;if(""==t.value){if("password"==t.type){if(!o.data("placeholder-textinput")){try{e=o.clone().attr({type:"text"})}catch(s){e=n("").attr(n.extend(i(this),{type:"text"}))}e.removeAttr("name").data({"placeholder-password":o,"placeholder-id":a}).bind("focus.placeholder",r),o.data({"placeholder-textinput":e,"placeholder-id":a}).before(e)}o=o.removeAttr("id").hide().prev().attr("id",a).show()}o.addClass("placeholder"),o[0].value=o.attr("placeholder")}else o.removeClass("placeholder")}function a(){try{return t.activeElement}catch(e){}}var s,c,l="placeholder"in t.createElement("input"),u="placeholder"in t.createElement("textarea"),d=n.fn,p=n.valHooks,f=n.propHooks;l&&u?(c=d.placeholder=function(){return this},c.input=c.textarea=!0):(c=d.placeholder=function(){var e=this;return e.filter((l?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":r,"blur.placeholder":o}).data("placeholder-enabled",!0).trigger("blur.placeholder"),e},c.input=l,c.textarea=u,s={get:function(e){var t=n(e),i=t.data("placeholder-password");return i?i[0].value:t.data("placeholder-enabled")&&t.hasClass("placeholder")?"":e.value},set:function(e,t){var i=n(e),s=i.data("placeholder-password");return s?s[0].value=t:i.data("placeholder-enabled")?(""==t?(e.value=t,e!=a()&&o.call(e)):i.hasClass("placeholder")?r.call(e,!0,t)||(e.value=t):e.value=t,i):e.value=t}},l||(p.input=s,f.value=s),u||(p.textarea=s,f.value=s),n(function(){n(t).delegate("form","submit.placeholder",function(){var e=n(".placeholder",this).each(r);setTimeout(function(){e.each(o)},10)})}),n(e).bind("beforeunload.placeholder",function(){n(".placeholder").each(function(){this.value=""})}))}(this,document,jQuery);var NoFollowPlugin=function(e){"undefined"==typeof e&&(e="body > section#Body"),$(e+" [data-copy]").each(function(){var e=$(this).attr("data-copy");$(this).html(e)})};$.fn.linky=function(){return this.each(function(){var e=$(this);e.attr("href",e.attr("data-url"))})},NoFollowPlugin(),$.fn.lazyImage=function(e){var t={errorImg:dmjs.errImg,callback:!1};return e&&$.extend(t,e),this.each(function(){var e=this;$("").bind("load",function(){$(e).attr("src",$(e).attr("data-img")),t.callback&&t.callback.call(e)}).bind("error",function(){t.errorImg&&$(e).attr("src",t.errorImg)}).attr("src",$(e).attr("data-img"))})};var dmjs=window.dmjs||{};dmjs.livestrong_newsletter=dmjs.livestrong_newsletter||function(){var e=this;$('button[type="button"]').click(function(){var t=$(".message",e),n=$(e).data("pagetype");t.hide().removeClass("error");var i=[];$("[name=email]",e).val()||i.push(dmjs.platform.isMobile()?"Please enter your email address":"Please fill-in your email address");var r=$("[name=gender]:checked",e).val();if("male"!=r&&"female"!=r&&i.push("Please select a gender"),$("#human").val()&&i.push("Value not allowed"),i.length)t.text(i.pop()).fadeIn();else{var o=$(e);$.ajax({url:"/service/newsletter/subscription/",type:"POST",data:o.serialize(),success:function(){t.text("You have successfully signed up for the newsletter!").fadeIn(),$("[name=email]",o).val(""),"newsletter_landing"==n?(o.hide(),$("#landing_newsletter_message",o.parent()).fadeIn(),setTimeout(function(){window.location="/"},5e3)):dmjs.platform.isMobile()&&($(".newsletter_body").hide(),$("#newsletter_signup .signup_success_hide").hide(),$("#newsletter_mobile_success").show(),$("#newsletter_signup .signup_success").show())},error:function(){t.text("An error occured. Please try again.").fadeIn()}})}return!1})},$.fn.livestrong_newsletter=dmjs.livestrong_newsletter,dmjs.addLoadEvent(function(){$(".newsletter").livestrong_newsletter()});var liveRamp={partnerId:"450766",iframeTagId:"450776",emailTagId:"450786",pixelBaseUrl:"http://idsync.rlcdn.com",iframeBaseUrl:"//ei.rlcdn.com",outputPixel:function(){var e=dmjs.cookies.readCookie("cookie_id");e||(e=this.generateUUID(),dmjs.cookies.createCookie("cookie_id",e));var t=this.pixelBaseUrl+"/"+this.partnerId+".gif?partner_uid="+e;$("body").append('')},outputIframe:function(e){if(e){var t=this.getHashedEmail(e),n=this.iframeBaseUrl+"/"+this.iframeTagId+".html?s="+t;$("body").append('')}},generateUUID:function(){var e=(new Date).getTime();window.performance&&"function"==typeof window.performance.now&&(e+=performance.now());var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)});return t},getHashedEmail:function(e){var t=e.trim().toLowerCase(),n=new jsSHA("SHA-1","TEXT");return n.update(t),n.getHash("HEX")}};if(function(e){function t(e,t,n){var i,r,o,p,f,h,v,b,y,w=0,k=[],$=0,x=!1,A=[],C=[],T=!1;if(n=n||{},i=n.encoding||"UTF8",y=n.numRounds||1,o=d(t,i),y!==parseInt(y,10)||1>y)throw Error("numRounds must a integer >= 1");if("SHA-1"!==e)throw Error("Chosen SHA variant is not supported");f=512,h=m,v=g,p=160,b=function(e){return e.slice()},r=_(e),this.setHMACKey=function(t,n,o){var a;if(!0===x)throw Error("HMAC key already set");if(!0===T)throw Error("Cannot set HMAC key after calling update");if(i=(o||{}).encoding||"UTF8",n=d(n,i)(t),t=n.binLen,n=n.value,a=f>>>3,o=a/4-1,t/8>a){for(n=v(n,t,0,_(e),p);n.length<=o;)n.push(0);n[o]&=4294967040}else if(a>t/8){for(;n.length<=o;)n.push(0);n[o]&=4294967040}for(t=0;o>=t;t+=1)A[t]=909522486^n[t],C[t]=1549556828^n[t];r=h(A,r),w=f,x=!0},this.update=function(e){var t,n,i,a=0,s=f>>>5;for(t=o(e,k,$),e=t.binLen,n=t.value,t=e>>>5,i=0;t>i;i+=s)e>=a+f&&(r=h(n.slice(i,i+s),r),a+=f);w+=a,k=n.slice(a>>>5),$=e%f,T=!0},this.getHash=function(t,n){var i,o,d,f;if(!0===x)throw Error("Cannot call getHash after setting HMAC key");switch(d=u(n),t){case"HEX":i=function(e){return a(e,p,d)};break;case"B64":i=function(e){return s(e,p,d)};break;case"BYTES":i=function(e){return c(e,p)};break;case"ARRAYBUFFER":try{o=new ArrayBuffer(0)}catch(h){throw Error("ARRAYBUFFER not supported by this environment")}i=function(e){return l(e,p)};break;default:throw Error("format must be HEX, B64, BYTES, or ARRAYBUFFER")}for(f=v(k.slice(),$,w,b(r),p),o=1;y>o;o+=1)f=v(f,p,0,_(e),p);return i(f)},this.getHMAC=function(t,n){var i,o,d,m;if(!1===x)throw Error("Cannot call getHMAC without first setting HMAC key");switch(d=u(n),t){case"HEX":i=function(e){return a(e,p,d)};break;case"B64":i=function(e){return s(e,p,d)};break;case"BYTES":i=function(e){return c(e,p)};break;case"ARRAYBUFFER":try{i=new ArrayBuffer(0)}catch(g){throw Error("ARRAYBUFFER not supported by this environment")}i=function(e){return l(e,p)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, or ARRAYBUFFER")}return o=v(k.slice(),$,w,b(r),p),m=h(C,_(e)),m=v(o,p,f,m,p),i(m)}}function n(e,t,n){var i,r,o,a,s,c=e.length;if(t=t||[0],n=n||0,s=n>>>3,0!==c%2)throw Error("String of HEX type must be in byte increments");for(i=0;c>i;i+=2){if(r=parseInt(e.substr(i,2),16),isNaN(r))throw Error("String of HEX type contains invalid characters");for(a=(i>>>1)+s,o=a>>>2;t.length<=o;)t.push(0);t[o]|=r<<8*(3-a%4)}return{value:t,binLen:4*c+n}}function i(e,t,n){var i,r,o,a,s=[],s=t||[0];for(n=n||0,r=n>>>3,i=0;i>>2,s.length<=o&&s.push(0),s[o]|=t<<8*(3-a%4);return{value:s,binLen:8*e.length+n}}function r(e,t,n){var i,r,o,a,s,c,l=[],u=0,l=t||[0];if(n=n||0,t=n>>>3,-1===e.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(r=e.indexOf("="),e=e.replace(/\=/g,""),-1!==r&&r0)loadFacebookAPI(),showFacebookComment();else{var fb_scroll_check=!0,activate_threshold=0;$(window).scroll(function(){var e=$(".js-facebook_comments_section").offset().top;current_top=$(document).scrollTop(),e>=1500&&(activate_threshold=50),current_top>activate_threshold&&fb_scroll_check&&(loadFacebookAPI(),fb_scroll_check=!1,showFacebookComment())})}}else loadFacebookAPI(),showFacebookComment();dmjs.addLoadEvent(function(){$(".ArticlePreview img").lazyImage()},0),dmjs.onFBInit.push(function(){$(".init_facebook_login").click(function(){FB.login(function(e){"undefined"!=typeof e.status&&"connected"==e.status&&(document.location="/api/facebook/login_with_redirect/")},{scope:"email"})})}),dmjs.addLoadEvent(function(){$("#search_icon, .search_box .close_icon").bind("click",function(){$("#search_icon").toggleClass("search_expanded_icon"),$(".search_box").toggle(),$("#siteSearchInput").focus()}),$("#siteSearch, #siteSearchfooter").bind("submit",function(){return""===$("input",this).val()?!1:void 0})}),dmjs.addLoadEvent(function(){$("#Featured").data("crawlable")||$("#Featured a").each(function(){var e=$(this).attr("href");e.indexOf("/slideshow/")>0?$(this).find(".horizontal-title").addClass("slideshow"):e.indexOf("/video/")>0?$(this).find(".horizontal-title").addClass("video"):e.indexOf("/article/")>0?$(this).find(".horizontal-title").addClass("article"):e.indexOf("/blog/")>0&&$(this).find(".horizontal-title").addClass("blog")})}),0==$('[data-section="body"] #728x90_990x90_970x250_atf').length&&$('[data-section="body"]').prepend($("#728x90_990x90_970x250_atf"));var newsletter_popup_manager=function(){var e={is_category_newsletter_seen_cookie_name:"ls_newsletter_seen",session_length_for_newsletter_render:4e4,session_counter:0,days_to_retain_newsletter_cookie:7},t=function(){return dmjs.cookies.readCookie(e.is_category_newsletter_seen_cookie_name)},n=function(t,n){dmjs.cookies.createCookie(e.is_category_newsletter_seen_cookie_name,n,e.days_to_retain_newsletter_cookie)},i=function(){$("body").append(s()),n(e.is_category_newsletter_seen_cookie_name,"true"),r()},r=function(){$(".newsletter_body__header_icon--close").on("click",function(){$(".newsletter_signup_overlay").hide()}),$(".newsletter_body__close").on("click",function(){$(".newsletter_signup_overlay").hide()}),$(".newsletter_form__continue").on("click",function(){$(".newsletter_signup_overlay").hide()}),$("body").on("click",function(e){$(e.target).closest(".newsletter_signup_overlay__body, .newsletter_signup_overlay--success").length||($(".newsletter_signup_overlay").hide(),$(".newsletter_signup_overlay--success").hide(),$("body").off("click",this))}),$(".newsletter_body_signup__form").on("submit",function(e){e.preventDefault();var t=$(this).data("pagetype");o(t)})},o=function(){if(!a())return!1;var e=$(".newsletter_form__email"),t=$("select[name='man_woman']").val(),n=e.val(),i=$("#email_pop_source").val(),r=$("#large_newsletter_listid").val(),o={};o.id=r,o.email=n,o.gender=t,o.source=i,$.ajax({url:"/service/newsletter/subscription/",type:"POST",data:o}).done(function(){e.val(""),dataLayer.push({event:"Newsletter_Subscription",gender:t}),$(".newsletter_signup_overlay__body").hide(),$(".newsletter_signup_overlay--success").show()}).fail(function(){$(".newsletter_signup_overlay__body").hide(),console.log("unsuccessful newsletter submission")})},a=function(){var e=$(".newsletter_error_message--gender"),t=$(".newsletter_error_message--email"),n=$(".newsletter_form__email").val(),i=$("select[name='man_woman']").val(),r=!1;return""==i?(r=!0,e.show()):e.hide(),/(.+)@(.+){2,}\.(.+){2,}/.test(n)&&n?t.hide():(r=!0,t.show()),!r},s=function(){return $("#newsletter_template").html()},c=function(){return dmjs.cookies.readCookie("loggedin")};return{newsletter_display_manager:function(){t()||(e.session_counter=setTimeout(function(){c()||i()},e.session_length_for_newsletter_render))},get_session_counter:function(){return e.session_counter}}};$(document).ready(function(){var e=new newsletter_popup_manager;window.clearTimeout(e.get_session_counter()),e.newsletter_display_manager()}),$(function(){$(window).on("scroll touchmove",sticky_nav),$(".js-top_header--signin").on("click touchstart",function(e){e.stopPropagation(),$(".top_header__popup--signin").show()}),$(document).on("click touchstart",function(){1==$(".top_header__popup--signin").is(":visible")&&$(".top_header__popup--signin").hide()}),$("#js-login_form").submit(function(e){e.preventDefault();var t=$("#js-login_form");$.ajax({url:t.attr("action"),type:"POST",dataType:"json",data:t.serialize(),xhrFields:{withCredentials:!0},crossDomain:!0,success:function(e){if(1==e.error){if(e.message instanceof Array){var n="";$.each(e.message,function(e,t){n+=t+"
"})}else n=e.message;t.find(".js-top_header__error_field").empty().append(n).show()}else location.reload()},error:function(){t.find(".js-top_header__error_field").empty().append("There was an error in submitting your request. Please try again").show()}})})}),LSAPP.register=function(){var e=!1,t=!1,n=[];n[".username"]=n[".email"]=n[".password"]=!1;var i=function(i){var r=i.url,o=i.data,a=i.cssSelector,s=i.async;$.ajax({url:r,type:"GET",data:o,async:s,success:function(i){return $(a).removeClass("errorField successField"),0==i.valid?($(".errorSuccess",a).html(i.message),$(a).addClass("errorField"),n[a]=!1,-1!=a.indexOf("username")?e=!0:-1!=a.indexOf("email")&&(t=!0),!1):($(".errorSuccess",a).html(""),$(a).addClass("successField"),n[a]=!0,!0)}})},r=function(e){$(e).removeClass("errorField successField"),$(".errorSuccess",e).html("")},o=function(e,t){i({url:"/service/Validation/Username/",data:{username:e},cssSelector:".username",async:t})},a=function(e,t){var n=$("#username").val();return 0!=n.length||e?void o(n,t):void r(".username")},s=function(e,t){i({url:"/service/Validation/EmailAddress/",data:{email:e},cssSelector:".email",async:t})},c=function(e,t){var n=$("#email").val();return 0!=n.length||e?void s(n,t):void r(".email")},l=function(e){var t=$("#password").val(),i=".password";return 0!=t.length||e?($(i).removeClass("errorField successField"),t.length<8?($(".errorSuccess",i).html("Password must be at least 8 characters"),$(i).addClass("errorField"),n[i]=!1,!1):($(".errorSuccess",i).html(""),n[i]=!0,!0)):void r(i)},u=function(){var e=$("input[name=gender]:checked").val();$(".gender").removeClass("errorField successField"),void 0==e?(n[".gender"]=!1,$(".gender .errorSuccess").html("You have to pick one!"),$(".gender").addClass("errorField")):(n[".gender"]=!0,$(".gender .errorSuccess").html(""))};return{init:function(){$(function(){var e,t,n;$("#username").keyup(function(){e||(e=setTimeout(function(){a(!1,!0),e=null},300))}),$("#email").keyup(function(){t||(t=setTimeout(function(){c(!1,!0),t=null},300))}),$("#password").keyup(function(){n||(n=setTimeout(function(){l(!1),n=null},300))}),$("#gender_male").click(function(){u()}),$("#gender_female").click(function(){u()})}),$("#validateForm").submit(function(){var e=$("#livestrongRegistration .password").is(":visible");return a(!0,!1),c(!0,!1),e&&l(!0),n[".username"]&&n[".email"]&&(!e||e&&n[".password"])?(_gaq.push(["_trackEvent","MobileArticle-Registrations","SignUp"]),!0):!1})}}}();