require(["jquery","cookie-helper","jquery-autonumeric"],function(a,b){function c(){var b,c,d=(document.location.href+"").match(/(?:\?|&)comment=([\d]+)/);null!=d&&2==d.length&&(b=a("#comment-"+parseInt(d[1])),b.length>0&&(b.addClass("comment-emphasized"),c=b.position(),a("html,body").stop().animate({scrollTop:c.top-55},500)))}function d(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function e(b){clearTimeout(r),a("#tooltip").add("#tooltip-tail").add("#tooltip-close").show(),a(b).add("#tooltip").add("#tooltip-tail").unbind("mouseout").mouseout(function(){r=window.setTimeout(function(){h()},1500)}).unbind("mouseover").mouseover(function(){clearTimeout(r)}),g(b)}function f(a){var b=new Object;if(b.left=0,b.top=0,null!==a){b.left=a.offsetLeft,b.top=a.offsetTop;for(var c=a.offsetParent,d=a.parentNode;null!==c;){if(b.left+=c.offsetLeft,b.top+=c.offsetTop,c!=document.body&&c!=document.documentElement&&(b.left-=c.scrollLeft,b.top-=c.scrollTop),navigator.userAgent.match(/gecko/i))for(;c!=d&&null!==d;)b.left-=d.scrollLeft,b.top-=d.scrollTop,d=d.parentNode;d=c.parentNode,c=c.offsetParent}}return b}function g(b){var c=f(b),d=c.top+a(b).height()/2-18,e=c.left+a(b).width()/2+12;e-=a(b).width()/2,a("#tooltip-tail").css({top:d,left:e}),a("#tooltip").css({top:d,left:e+a("#tooltip-tail").width()-1}),a("#tooltip-close").css({top:d+5,left:e+a("#tooltip-tail").width()+a("#tooltip").outerWidth()-a("#tooltip-close").width()-6})}function h(){a("#tooltip").html("").hide(),a("#tooltip-tail").add("#tooltip-close").hide()}var i=a("article .voting"),j=a(".experts-viewport");i.length>0&&require(["blog-voting"],function(a){a.init(i)}),j.length>0&&require(["blog-experts"],function(a){a.init(j)}),a(".cardhub-edu-table").each(function(b,c){a(c).wrap('<div class="cardhub-edu-table-div" />')}),a(".item .text .toggletext").on("click",function(){return a(this).closest(".text").toggleClass("more"),!1}),a("div.submenu nav a.ad").on("click",function(b){b.preventDefault();var c=a("#ad-disc").position().top-65;a(window).width()<416&&(c=a("#ad-disc").position().top-50),a("html,body").animate({scrollTop:c}),a("aside.disclaimer p:last").addClass("yellow"),setTimeout(function(){a("aside.disclaimer p:last").removeClass("yellow")},2e3)}),a(".embedholder a").on("click",function(b){var c=a(this);return c.parent().find(".embedcode").toggle(),c.blur(),b.stopPropagation(),!1});var k={};if(a(".embedholder textarea").on("mouseup mousedown click focus",function(){var b=a(this);b.select(),b.mouseup(function(){return b.unbind("mouseup"),!1})}).on("mouseleave",function(){var b=a(this),c=b.closest(".embedholder").attr("id");k[c]=window.setTimeout(function(){a("#"+c+" .embedcode").hide()},1500)}).on("mouseenter",function(){var b=a(this),c=b.closest(".embedholder").attr("id");c in k&&window.clearTimeout(k[c])}).on("click",function(a){return a.stopPropagation(),!1}),a(".embedholder").on("click",function(a){a.stopPropagation()}),a(window).click(function(){a(".embedholder .embedcode").hide()}),"undefined"!=typeof gChartPackages&&"undefined"!=typeof gChartData&&require(["goog!visualization,1,packages:["+gChartPackages.join(",")+"]"],function(){var b,c,d,e,f,g,h,i,j={geo:"GeoChart",pie:"PieChart",column:"ColumnChart",line:"LineChart",bubble:"BubbleChart"};for(d in j)if(d in gChartData)for(b=0;b<gChartData[d].length;b++)if(e=gChartData[d][b],"id"in e&&"data"in e&&"config"in e){if("ToolTip"==e.data[0][e.data[0].length-1]&&(e.data[0][e.data[0].length-1]={role:"tooltip",p:{html:!0}}),f=google.visualization.arrayToDataTable(e.data),i=a("#"+e.id),g=new google.visualization[j[d]](i.get(0)),a.inArray(d,["column","line","geo"])>-1&&"fmt"in e)for("geo"==d&&(e.config.firstColStr=!0),c=e.config.firstColStr?2:1;c<=e.data[0].length;c++)h=new google.visualization.NumberFormat(e.fmt),h.format(f,c-1);("column"==d||"line"==d||"bubble"==d)&&google.visualization.events.addListener(g,"ready",function(){i.append('<div class="left-border">&nbsp;</div>')}),g.draw(f,e.config)}}),/^\/(blog|edu)\/[^\/]+\/[0-9]+\/$/.test(document.location.pathname)!==!1&&/^\/(blog|edu)\/page\/[0-9]+\/$/.test(document.location.pathname)===!1){require(["blog-comments","fb-init","twitter-sdk","google-sdk"]),a(".social_sidebar a").on("click",function(){var b=575,c=400,d=(a(window).width()-b)/2,e=(a(window).height()-c)/2,f="status=1,width="+b+",height="+c+",top="+e+",left="+d,g=a(this).closest("li"),h=null;return g.hasClass("social-email")?(a(".wallethub a").trigger("publisher_email"),h="wh"):(g.hasClass("facebook")?h="fb":g.hasClass("twitter")?h="tw":g.hasClass("linkedin")&&(h="li"),window.open(this.href,"whpopup",f)),null!=h&&a.get("/ajax.php",{action:"blogpost-clear-count",count:h,uri:document.location.pathname},function(a,b){},"json"),!1}),a(".social-buttons a").on("click",function(){var b=575,c=400,d=(a(window).width()-b)/2,e=(a(window).height()-c)/2,f="status=1,width="+b+",height="+c+",top="+e+",left="+d,g=a(this).closest("div"),h=null;return g.hasClass("social-email")?(a(".wallethub a").trigger("publisher_email"),h="wh"):(g.hasClass("facebook")?h="fb":g.hasClass("twitter")?h="tw":g.hasClass("linkedin")&&(h="li"),window.open(this.href,"whpopup",f)),null!=h&&a.get("/ajax.php",{action:"blogpost-clear-count",count:h,uri:document.location.pathname},function(a,b){},"json"),!1}),a(".social_buttons_footer .el.icon:not(.email)").on("click",function(){var b="."+a(this).attr("data-link");a(".social_sidebar "+b+" a").click()}),a(".social_buttons_footer .el.icon.email").on("click",function(){var c=a(this);a.ajax({url:"/ajax.php",type:"POST",data:{nonce:c.siblings("[name=email_nonce]").val(),"email-by-app":!0,uri:document.location.pathname,action:"share-publish-email",headers:{"X-XSRF-TOKEN":b.read("XSRF-TOKEN")}},success:function(a){c.siblings("[name=email_nonce]").val(a.nonce)}})}),a(window).resize(function(){a(window).scrollTop()>150?(a(".social_buttons_footer").addClass("show"),a("#viewport > header").addClass("hide")):(a(".social_buttons_footer").removeClass("show"),a("#viewport > header").removeClass("hide"))}),a(window).scroll(function(){a(window).scrollTop()>150?(a(".social_buttons_footer").addClass("show"),a("#viewport > header").addClass("hide")):(a(".social_buttons_footer").removeClass("show"),a("#viewport > header").removeClass("hide"))});var l=a(".mentioned-authors"),m=a(".social_sidebar ul"),n=a(".social-buttons"),o="https://wallethub.com"+document.location.pathname,p={fb:0,tw:0,li:0,wh:0};m.on("update",function(){m.find("li.facebook .counter").html(d(p.fb)),m.find("li.linkedin .counter").html(d(p.li)),m.find("li.social-email .counter").html(d(p.wh));var b=p.fb+p.tw+p.li+p.wh;b>1e3?(b=Math.round(b/1e3*10)/10+"K",m.find("li.totalshares .totalSharesCount").html(b).addClass("reducedSize"),n.find(".totalshares .totalSharesCount").html(b),a(".social_buttons_footer .el").html(b)):(m.find("li.totalshares .totalSharesCount").html(d(b)),n.find(".totalshares .totalSharesCount").html(d(b)),a(".social_buttons_footer .el").html(d(b)))}),a.when(a.ajax({url:"https://graph.facebook.com/?ids="+escape(o),dataType:"jsonp"}),a.ajax({url:"https://www.linkedin.com/countserv/count/share?format=jsonp&url="+escape(o),dataType:"jsonp"}),a.ajax({url:document.location.pathname+"?onload",dataType:"json",method:"OPTIONS"})).done(function(b,d,e){if("success"==b[1]&&o in b[0]&&"share"in b[0][o]&&"share_count"in b[0][o].share&&(p.fb=parseInt(b[0][o].share.share_count),isNaN(p.fb)&&(p.fb=0)),"success"==d[1]&&"count"in d[0]&&(p.li=parseInt(d[0].count),isNaN(p.li)&&(p.li=0)),"success"==e[1]&&!e[0].error){if(e=e[0],c(),a(".comments .comment-form textarea[name=comment]").removeAttr("disabled"),"follows"in e)for(var f in e.follows)e.follows[f]>0&&l.find(".author.a"+f+" .actions").html("<div class='following'><img src='//d2e70e9yced57e.cloudfront.net/wallethub/images/profile/check-green_Va6b533e_.png' width='21' height='17'> Following</div>");p.wh=parseInt(e.mailpub),isNaN(p.wh)&&(p.wh=0)}m.trigger("update")}),a("#smt_floater .social-email a,a[data-publisher]").on("click",function(){return require(["wh.overlay"],function(a){a.show_email_share_overlay()}),!1}),a(".social-buttons .social-email a,a[data-publisher]").on("click",function(){return require(["wh.overlay"],function(a){a.show_email_share_overlay()}),!1}),a(document).scroll(function(){a(this).scrollTop()>100&&a(window).width()>1200?a("#smt_floater").fadeIn():a("#smt_floater").fadeOut()}),require(["wh.overlay","cookie-helper"],function(b,c){var d=a(".mentioned-authors");d.on("click","a[id^=follow-]",function(){var e,f=a(this),g=f.closest(".actions"),h=this.id.replace(/^follow-/,""),i=function(){a.ajax({url:"/ajax.php",data:{action:"check-post-author-follows",uri:document.location.pathname},success:function(a,b){if(!a.error){if("follows"in a)for(var c in a.follows)a.follows[c]>0&&d.find(".author.a"+c+" .actions").html('<div class="following"><img src="//d2e70e9yced57e.cloudfront.net/wallethub/images/profile/check-green_Va6b533e_.png" width="21" height="17" /> Following</div>');f=d.find("#follow-"+h+".btn"),f.length>0&&("nonce"in a&&f.data("nonce",a.nonce),f.trigger("click"))}}})};return e=f.data("nonce"),"undefined"==typeof e?(i(),!1):c.is_logged_in()?(g.addClass("loading"),a.ajax({url:"/ajax.php",type:"POST",data:{action:"bp_follow",uid:h,_wpnonce:e},success:function(a,b){g.removeClass("loading"),a.indexOf("You are now following")<0&&a.indexOf("Already following")<0||g.html('<div class="following"><img src="//d2e70e9yced57e.cloudfront.net/wallethub/images/profile/check-green_Va6b533e_.png" width="21" height="17" /> Following</div>')}}),!1):(b.show_login_overlay({after_login:i}),!1)})}),require(["jquery-tablesorter"],function(){var b=a(".cardhub-edu-table.sortable");0!=b.length&&(a.tablesorter.addParser({id:"rank-percentage",is:function(a){return!1},format:function(a){var b=a.match(/^([\d]+)\([\d\.]+%\)$/);return null==b?a:b.length>1?parseInt(100*b[1]):a},type:"numeric"}),a.tablesorter.addParser({id:"rank-value",is:function(a){return!1},format:function(a){var b=a.match(/([\d]+)\s*\(/);return null==b?a:b.length>1?b[1]:a},type:"numeric"}),a.tablesorter.addParser({id:"value-rank",is:function(a){return!1},format:function(a){var b=a.match(/^\$(?:[\d,]+)\(([\d]+)\)$/);return null==b?a:b.length>1?b[1]:a},type:"numeric"}),a.tablesorter.addParser({id:"rank-numeric",is:function(a){return!1},format:function(a){var b=a.match(/^\$?([0-9\.,-]+)%?(?:\(\$?([0-9\.,-]+)%?\))?/);return null==b?a:b.length>1?100*b[1].replace(/,/,""):a},type:"numeric"}),b.each(function(){var b,c,d=a(this),e={headers:{}};if(b=d.find("th.rank-percentage"),b.length>0)for(c=0;c<b.length;c++)e.headers[a(b[c]).index()]={sorter:"rank-percentage"};if(b=d.find("th.rank-value"),b.length>0)for(c=0;c<b.length;c++)e.headers[a(b[c]).index()]={sorter:"rank-value"};if(b=d.find("th.value-rank"),b.length>0)for(c=0;c<b.length;c++)e.headers[a(b[c]).index()]={sorter:"value-rank"};if(b=d.find("th.rank-numeric"),b.length>0)for(c=0;c<b.length;c++)e.headers[a(b[c]).index()]={sorter:"rank-numeric"};d.tablesorter(e)}))});var q=0;a(".ch-edu-calc-input input").on("mousedown mouseup focus click",function(){var b=this;window.setTimeout(function(){a(b).select()},50)}).on("keyup",function(){var b=a(this),c=b.closest(".ch-edu-calc");clearTimeout(q),q=setTimeout(function(){c.addClass("loading");var d="hotelrewards";c.hasClass("airline")&&(d="airlines"),a.ajax({url:"/ajax.php",type:"GET",dataType:"json",data:{action:d+"_calc",input:parseInt(b.val().replace(/[^\d]+/g,""))},success:function(a){c.removeClass("loading"),"Best"in a&&("#REF!"==a.Best.name&&(a.Best.name="N/A"),"#REF!"==a.Best.value&&(a.Best.value="N/A"),c.find(".ch-edu-calc-title:first").html(a.Best.name),c.find(".ch-edu-calc-content:first").html("WalletHub Score: "+a.Best.value)),"RunnerUp"in a&&("#REF!"==a.RunnerUp.name&&(a.RunnerUp.name="N/A"),"#REF!"==a.RunnerUp.value&&(a.RunnerUp.value="N/A"),c.find(".ch-edu-calc-title:last").html(a.RunnerUp.name),c.find(".ch-edu-calc-content:last").html("WalletHub Score: "+a.RunnerUp.value))}})},300)}).autoNumeric({aSign:"$",mDec:0}),a(document).ready(function(){var b=null,c=/cca\-tooltip([0-9]+)/i;a(".cca-qmark").each(function(){b=this.className.match(c),null!=b&&a("#tooltip"+b[1]).length>0&&a(this).click(function(){var b="tooltip"+this.className.match(c)[1];a("#tooltip").html(a("#"+b).html()),e(this)})}),a(".cca-aoslink").click(function(){var b=a(".cca-qmark-aos").get(0);return a("#tooltip").html(a("#tooltip"+b.className.match(c)[1]).html()),e(b),!1}),a("#tooltip-close").click(function(){return h(),!1})});var r=0}});