require(["jquery","cookie-helper","jquery-autonumeric"],function($,cookie){function hideElement(e){var t=0;$(e).each(function(){if(".content-wrapper img"==e&&0==t)return void t++;t++})}function showElement(e){var t=$(window).height(),o=0;$(e).each(function(){if(".content-wrapper img"==e&&0==o)return void o++;if($(this).closest(".experts-viewport").length>0&&".content-wrapper img"==e)return void o++;var a=$(this).offset().top;$(window).scrollTop()+t>a&&$(this).addClass("fadeInLeft").addClass("animated"),o++})}function focus_isolated_comment(){var e,t,o=(document.location.href+"").match(/(?:\?|&)comment=([\d]+)/);null!=o&&2==o.length&&(e=$("#comment-"+parseInt(o[1])),e.length>0&&(e.addClass("comment-emphasized"),t=e.position(),$("html,body").stop().animate({scrollTop:t.top-55},500)))}function number_format(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function fnShowTooltip(e){clearTimeout(gTt),$("#tooltip").add("#tooltip-tail").add("#tooltip-close").show(),$(e).add("#tooltip").add("#tooltip-tail").unbind("mouseout").mouseout(function(){gTt=window.setTimeout(function(){fnCloseTooltip()},1500)}).unbind("mouseover").mouseover(function(){clearTimeout(gTt)}),fnFixTooltip(e)}function fnGetAbsolutePosition(e){var t=new Object;if(t.left=0,t.top=0,null!==e){t.left=e.offsetLeft,t.top=e.offsetTop;for(var o=e.offsetParent,a=e.parentNode;null!==o;){if(t.left+=o.offsetLeft,t.top+=o.offsetTop,o!=document.body&&o!=document.documentElement&&(t.left-=o.scrollLeft,t.top-=o.scrollTop),navigator.userAgent.match(/gecko/i))for(;o!=a&&null!==a;)t.left-=a.scrollLeft,t.top-=a.scrollTop,a=a.parentNode;a=o.parentNode,o=o.offsetParent}}return t}function fnFixTooltip(e){var t=fnGetAbsolutePosition(e),o=t.top+$(e).height()/2-18,a=t.left+$(e).width()/2+12;a-=$(e).width()/2,$("#tooltip-tail").css({top:o,left:a}),$("#tooltip").css({top:o,left:a+$("#tooltip-tail").width()-1}),$("#tooltip-close").css({top:o+5,left:a+$("#tooltip-tail").width()+$("#tooltip").outerWidth()-$("#tooltip-close").width()-6})}function fnCloseTooltip(){$("#tooltip").html("").hide(),$("#tooltip-tail").add("#tooltip-close").hide()}$(".sect-community-discussion .header").html('<span class="hide-mob">Community </span>Discussion');var helpful_url=document.location.host+document.location.pathname;"1"==cookie.read("h"+helpful_url)?($(".helpful-ask").hide(),$(".msg-no").fadeIn("slow")):"0"==cookie.read("h"+helpful_url)&&($(".helpful-ask").hide(),$(".msg-no").fadeIn("slow")),$(".helpful-ask").on("click",".btn-yes",function(){cookie.create("h"+helpful_url,"1",7,24);var e=$(this).parent().data("post-id");$(".helpful-ask").hide(),$(".msg-yes").fadeIn("slow"),$.ajax({url:"/ajax.php",type:"POST",data:{action:"send_edu_feedback",postId:e,uri:document.location.host+document.location.pathname,helpful:!0},success:function(e,t){if(e.error)return void alert(e.message)}})}),$(".helpful-ask").on("click",".btn-no",function(){$(".helpful-ask").hide(),$(".msg-ask").fadeIn("slow")}),$(".msg-ask").on("click",".btn-submit",function(){}),$(".form-feedback").on("submit",function(){if($.trim($(".form-feedback textarea").val()).length<10)return $(".form-feedback .failed").html("Your feedback must have at least 10 characters"),$(".form-feedback .failed").fadeIn("slow"),!1;$(".form-feedback .btn-submit").hide(),$(".form-feedback .btn-loading").show(),$(".form-feedback .failed").fadeOut("slow");var e=$(this).parent().parent().find(".btn-group-container").data("post-id");return $.ajax({url:"/ajax.php",type:"POST",data:{action:"send_edu_feedback",postId:e,uri:document.location.host+document.location.pathname,helpful:!1,feedback:$(".form-feedback textarea").val()},success:function(e,t){if($(".form-feedback .btn-loading").hide(),$(".form-feedback .btn-submit").show(),e.error)return $(".form-feedback .failed").html("Failed to send the feedback. Please try again later."),void $(".form-feedback .failed").fadeIn("slow");$(".msg-ask").hide(),$(".msg-no").fadeIn("slow"),cookie.create("h"+helpful_url,"0",7,24)}}),!1});var voting=$("article .voting"),experts=$(".experts-viewport");voting.length>0&&require(["blog-voting"],function(e){e.init(voting)}),experts.length>0&&require(["blog-experts"],function(e){e.init(experts)});var sortable_id=1;$(".cardhub-edu-table").each(function(e,t){if($(this).hasClass("sortable")){var o=sortable_id;$(t).wrap('<div class="cardhub-edu-table-div sortable-main-'+o+'" />'),$('<div class="sortable-'+o+'" style="margin-bottom:-20px;overflow:auto;"><div style="height:20px;width:'+$(this).outerWidth()+'px;"></div></div>').insertBefore($(this).parent()),$(".sortable-"+o).scroll(function(){$(".sortable-main-"+o).scrollLeft($(".sortable-"+o).scrollLeft())}),$(".sortable-main-"+o).scroll(function(){$(".sortable-"+o).scrollLeft($(".sortable-main-"+o).scrollLeft())}),$(window).resize(function(){$(".sortable-"+o).find("div").css("width",$(".sortable-main-"+o).find("table").outerWidth()+"px")}),sortable_id++}else $(t).wrap('<div class="cardhub-edu-table-div" />')}),$(".item .text .toggletext").on("click",function(){return $(this).closest(".text").toggleClass("more"),!1}),$("div.submenu nav a.ad").on("click",function(e){e.preventDefault();var t=$("#ad-disc").offset().top;$(window).width()<416&&(t=$("#ad-disc").offset().top),$("html,body").animate({scrollTop:t}),$("aside.disclaimer p:last").addClass("yellow"),setTimeout(function(){$("aside.disclaimer p:last").removeClass("yellow")},2e3)}),$(".cardhub-edu-table a.ad").on("click",function(e){e.preventDefault();var t=$("#ad-disc").offset().top;$(window).width()<416&&(t=$("#ad-disc").offset().top),$("html,body").animate({scrollTop:t}),$("aside.disclaimer p:last").addClass("yellow"),setTimeout(function(){$("aside.disclaimer p:last").removeClass("yellow")},2e3)}),$(".cc-section .top-content a.ad").on("click",function(e){e.preventDefault();var t=$("#ad-disc").offset().top;$(window).width()<416&&(t=$("#ad-disc").offset().top),$("html,body").animate({scrollTop:t}),$("aside.disclaimer p:last").addClass("yellow"),setTimeout(function(){$("aside.disclaimer p:last").removeClass("yellow")},2e3)}),$(".embedholder a").on("click",function(e){var t=$(this);return t.parent().find(".embedcode").toggle(),t.blur(),e.stopPropagation(),!1});var embedtimeouts={};$(".embedholder textarea").on("mouseup mousedown click focus",function(){var e=$(this);e.select(),e.mouseup(function(){return e.unbind("mouseup"),!1})}).on("mouseleave",function(){var e=$(this),t=e.closest(".embedholder").attr("id");embedtimeouts[t]=window.setTimeout(function(){$("#"+t+" .embedcode").hide()},1500)}).on("mouseenter",function(){var e=$(this),t=e.closest(".embedholder").attr("id");t in embedtimeouts&&window.clearTimeout(embedtimeouts[t])}).on("click",function(e){return e.stopPropagation(),!1}),$(".embedholder").on("click",function(e){e.stopPropagation()}),$(window).click(function(){$(".embedholder .embedcode").hide()}),"undefined"!=typeof gChartPackages&&"undefined"!=typeof gChartData&&require(["goog!visualization,1,packages:["+gChartPackages.join(",")+"]"],function(){var e,t,o,a,i,n,r,s,l={geo:"GeoChart",pie:"PieChart",column:"ColumnChart",line:"LineChart",bubble:"BubbleChart"};for(o in l)if(o in gChartData)for(e=0;e<gChartData[o].length;e++)if("id"in(a=gChartData[o][e])&&"data"in a&&"config"in a){if("ToolTip"==a.data[0][a.data[0].length-1]&&(a.data[0][a.data[0].length-1]={role:"tooltip",p:{html:!0}}),"line"==o&&2==a.data[0].length){a.data[0].push({type:"string",role:"style"});for(var c=1;c<a.data.length;c++)a.data[c].push("point {stroke-width: 2;  stroke-color: #fff; }")}if(i=google.visualization.arrayToDataTable(a.data),s=$("#"+a.id),n=new google.visualization[l[o]](s.get(0)),$.inArray(o,["column","line","geo"])>-1&&"fmt"in a)if("pattern"in a.fmt&&$.isArray(a.fmt.pattern)&&a.fmt.pattern.length==a.data[0].length)for(t=0;t<a.data[0].length;t++)r=new google.visualization.NumberFormat({pattern:a.fmt.pattern[t]}),r.format(i,t);else for("geo"==o&&(a.config.firstColStr=!0),t=a.config.firstColStr?2:1;t<=a.data[0].length;t++)r=new google.visualization.NumberFormat(a.fmt),r.format(i,t-1);"column"!=o&&"line"!=o&&"bubble"!=o||a.config.width>700&&(a.config.width=700),"geo"==o&&(a.config.width=700,a.config.height=450),"geo"==o&&a.data[0].length<3&&(a.config.hasOwnProperty("displayMode")?a.config.hasOwnProperty("displayMode")&&a.config.displayMode:(a.config.colors=["#2CDBDB","#fff"],$("head").append("<style>#"+a.id+" path{ stroke:#555; }</style>"))),a.config.hasOwnProperty("chartArea")&&(a.config.hasOwnProperty("legend")&&a.config.legend.hasOwnProperty("position")&&"none"==a.config.legend.position?a.config.chartArea.width="80%":a.config.chartArea.width="70%"),n.draw(i,a.config),"column"!=o&&"line"!=o&&"bubble"!=o||(s.append('<div class="left-border">&nbsp;</div>'),s.append('<div class="right-border">&nbsp;</div>'))}}),require(["blog-comments","fb-init","twitter-sdk","google-sdk"]),$(".social_sidebar a").on("click",function(){var e=($(window).width()-575)/2,t=($(window).height()-400)/2,o="status=1,width=575,height=400,top="+t+",left="+e,a=$(this).closest("li"),i=null;return a.hasClass("social-email")?($(".wallethub a").trigger("publisher_email"),i="wh"):(a.hasClass("facebook")?i="fb":a.hasClass("twitter")?i="tw":a.hasClass("linkedin")&&(i="li"),window.open(this.href,"whpopup",o)),null!=i&&$.post("/ajax.php",{action:"Posts.BlogClearCount",count:i,uri:document.location.pathname},function(e,t){},"json"),!1}),$(".social-buttons a").on("click",function(){var e=($(window).width()-575)/2,t=($(window).height()-400)/2,o="status=1,width=575,height=400,top="+t+",left="+e,a=$(this).closest("div"),i=null;return a.hasClass("social-email")?($(".wallethub a").trigger("publisher_email"),i="wh"):(a.hasClass("facebook")?i="fb":a.hasClass("twitter")?i="tw":a.hasClass("linkedin")&&(i="li"),window.open(this.href,"whpopup",o)),null!=i&&$.post("/ajax.php",{action:"Posts.BlogClearCount",count:i,uri:document.location.pathname},function(e,t){},"json"),!1}),$(".social_buttons_footer .el.icon:not(.email)").on("click",function(){var e="."+$(this).attr("data-link");$(".social_sidebar "+e+" a").click()}),$(".social_buttons_footer .el.icon.email").on("click",function(){var e=$(this);$.ajax({url:"/ajax.php",type:"POST",data:{nonce:e.siblings("[name=email_nonce]").val(),"email-by-app":!0,uri:document.location.pathname,action:"Share.PublishEmail"},headers:{"X-XSRF-TOKEN":cookie.read("XSRF-TOKEN")},success:function(t){e.siblings("[name=email_nonce]").val(t.nonce)}})}),$(window).resize(function(){var e=$(".content-social-btn").offset().top,t=$(".sidebar.page-menu-container").offset().top-55;$(window).scrollTop()>e?($(".social_buttons_footer").addClass("show"),$("#viewport > header").addClass("hide")):($(".social_buttons_footer").removeClass("show"),$("#viewport > header").removeClass("hide")),$(this).scrollTop()>t?$(".sidebar.page-menu-container").addClass("docked"):$(".sidebar.page-menu-container").removeClass("docked")}),$(document).ready(function(){showElement(".experts-viewport"),showElement(".content-wrapper img"),showElement(".content-wrapper .cardhub-edu-table img"),showElement(".content-wrapper .chart-container"),showElement(".content-wrapper blockquote")}),$(window).scroll(function(){var e=$(".content-social-btn").offset().top,t=$(".sidebar.page-menu-container").offset().top-55;$(window).scrollTop()>e?($(".social_buttons_footer").addClass("show"),$("#viewport > header").addClass("hide")):($(".social_buttons_footer").removeClass("show"),$("#viewport > header").removeClass("hide")),showElement(".content-wrapper img"),showElement(".content-wrapper .cardhub-edu-table img"),showElement(".content-wrapper .chart-container"),showElement(".content-wrapper blockquote"),showElement(".experts-viewport"),$(window).scrollTop()>55?$("body").addClass("scrolled"):$("body").removeClass("scrolled"),$(this).scrollTop()>t?$(".sidebar.page-menu-container").addClass("docked"):$(".sidebar.page-menu-container").removeClass("docked")});var authors=$(".mentioned-authors"),sb=$(".sidebar-social-btn .social-buttons"),sm=$(".social-buttons"),url="https://wallethub.com"+document.location.pathname,counts={fb:0,tw:0,li:0,wh:0};sb.on("update",function(){sb.find("li.facebook .counter").html(number_format(counts.fb)),sb.find("li.linkedin .counter").html(number_format(counts.li)),sb.find("li.linkedin .counter").html(number_format(counts.li)),sb.find("li.social-email .counter").html(number_format(counts.wh));var total=counts.fb+counts.tw+counts.li+counts.wh;if($(".totalshares .totalSharesCount").length>0){var initial_share_count=sb.find(".totalshares .totalSharesCount").text();total=eval(total)+eval(initial_share_count)}total<10?(sb.find("li.totalshares .totalSharesCount").html(number_format(total)),sm.find(".totalshares .totalSharesCount").html(number_format(total)),$(".social_buttons_footer .el").html(number_format(total)),sb.find("li.totalshares").hide(),sm.find(".totalshares").hide()):total>1e4?(total=Math.round(total/1e3*10)/10+"K",sb.find("li.totalshares .totalSharesCount").html(total).addClass("reducedSize"),sm.find(".totalshares .totalSharesCount").html(total),$(".social_buttons_footer .el").html(total),sb.find("li.totalshares").css("display","inline-block"),sm.find(".totalshares").css("display","inline-block")):(sb.find("li.totalshares .totalSharesCount").html(number_format(total)),sm.find(".totalshares .totalSharesCount").html(number_format(total)),$(".social_buttons_footer .el").html(number_format(total)),sb.find("li.totalshares").css("display","inline-block"),sm.find(".totalshares").css("display","inline-block"))}),$.when($.ajax({url:"https://graph.facebook.com/?ids="+escape(url),dataType:"jsonp"}),$.ajax({url:"https://www.linkedin.com/countserv/count/share?format=jsonp&url="+escape(url),dataType:"jsonp"}),$.ajax({url:"https://opensharecount.com/count.json?url="+url,dataType:"json"})).done(function(e,t,o){"success"==e[1]&&url in e[0]&&"share"in e[0][url]&&"share_count"in e[0][url].share&&(counts.fb=parseInt(e[0][url].share.share_count),isNaN(counts.fb)&&(counts.fb=0)),counts.tw=o.count,isNaN(counts.tw)&&(counts.tw=0),"success"==t[1]&&"count"in t[0]&&(counts.li=parseInt(t[0].count),isNaN(counts.li)&&(counts.li=0)),sm.trigger("update")});var regex=/(?:blog|edu)\/([^\/]+)\/([\d]+)/gi;match=regex.exec(document.location.pathname),null!=match&&$.when($.ajax({url:"/ajax.php?action=Edu.OnLoad&postid="+match[2],dataType:"json",method:"GET"})).done(function(e){if("success"==e[1]&&!e[0].error){if(e=e[0],focus_isolated_comment(),$(".comments .comment-form textarea[name=comment]").removeAttr("disabled"),"follows"in e)for(var t in e.follows)e.follows[t]>0&&authors.find(".author.a"+t+" .actions").html("<div class='following'><img src='//d2e70e9yced57e.cloudfront.net/wallethub/images/profile/check-green_Va6b533e_.png' width='21' height='17'> Following</div>");counts.wh=parseInt(e.mailpub),isNaN(counts.wh)&&(counts.wh=0)}sm.trigger("update")}),sm.trigger("update"),$("#smt_floater .social-email a,a[data-publisher]").on("click",function(){return require(["wh.overlay"],function(e){e.show_email_share_overlay()}),!1}),$(".social-buttons .social-email a,a[data-publisher]").on("click",function(){return require(["wh.overlay"],function(e){e.show_social_share_overlay_v2({email:!0})}),!1}),require(["wh.overlay","cookie-helper"],function(e,t){var o=$(".mentioned-authors");o.on("click","a[id^=follow-]",function(){var a,i=$(this),n=i.closest(".actions"),r=this.id.replace(/^follow-/,""),s=function(){$.ajax({url:"/ajax.php",data:{action:"Posts.CheckAuthorFollows",uri:document.location.pathname},success:function(e,t){if(!e.error){if("follows"in e)for(var a in e.follows)e.follows[a]>0&&o.find(".author.a"+a+" .actions").html('<div class="following"><img src="//d2e70e9yced57e.cloudfront.net/wallethub/images/profile/check-green_Va6b533e_.png" width="21" height="17" /> Following</div>');i=o.find("#follow-"+r+".btn"),i.length>0&&("nonce"in e&&i.data("nonce",e.nonce),i.trigger("click"))}},error:function(e){if(401==e.status)return void window.alert("Please login first.");window.alert("There was an error with your session. The page will now refresh."),top.location.reload()}})};return void 0===(a=i.data("nonce"))?(s(),!1):t.is_logged_in()?(n.addClass("loading"),$.ajax({url:"/ajax.php",type:"POST",data:{action:"bp_follow",uid:r,_wpnonce:a},success:function(e,t){n.removeClass("loading"),e.indexOf("You are now following")<0&&e.indexOf("Already following")<0||n.html('<div class="following"><img src="//d2e70e9yced57e.cloudfront.net/wallethub/images/profile/check-green_Va6b533e_.png" width="21" height="17" /> Following</div>')}}),!1):(e.show_login_overlay({after_login:s}),!1)})}),require(["jquery-tablesorter"],function(){var e=$(".cardhub-edu-table.sortable");0!=e.length&&($.tablesorter.addParser({id:"rank-percentage",is:function(e){return!1},format:function(e){var t=e.match(/^([\d]+)\([\d\.]+%\)$/);return null==t?e:t.length>1?parseInt(100*t[1]):e},type:"numeric"}),$.tablesorter.addParser({id:"rank-value",is:function(e){return!1},format:function(e){var t=e.match(/([\d]+)\s*\(/);return null==t?e:t.length>1?t[1]:e},type:"numeric"}),$.tablesorter.addParser({id:"value-rank",is:function(e){return!1},format:function(e){var t=e.match(/^\$(?:[\d,]+)\(([\d]+)\)$/);return null==t?e:t.length>1?t[1]:e},type:"numeric"}),$.tablesorter.addParser({id:"rank-numeric",is:function(e){return!1},format:function(e){var t=e.match(/^\$?([0-9\.,-]+)%?(?:\(\$?([0-9\.,-]+)%?\))?/);return null==t?e:t.length>1?100*t[1].replace(/,/,""):e},type:"numeric"}),e.each(function(){var e,t,o=$(this),a={headers:{}};if(e=o.find("th.rank-percentage"),e.length>0)for(t=0;t<e.length;t++)a.headers[$(e[t]).index()]={sorter:"rank-percentage"};if(e=o.find("th.rank-value"),e.length>0)for(t=0;t<e.length;t++)a.headers[$(e[t]).index()]={sorter:"rank-value"};if(e=o.find("th.value-rank"),e.length>0)for(t=0;t<e.length;t++)a.headers[$(e[t]).index()]={sorter:"value-rank"};if(e=o.find("th.rank-numeric"),e.length>0)for(t=0;t<e.length;t++)a.headers[$(e[t]).index()]={sorter:"rank-numeric"};o.tablesorter(a)}))});var to=0;$(".ch-edu-calc-input input").on("mousedown mouseup focus click",function(){var e=this;window.setTimeout(function(){$(e).select()},50)}).on("keyup",function(){var e=$(this),t=e.closest(".ch-edu-calc");clearTimeout(to),to=setTimeout(function(){t.addClass("loading");var o="hotelrewards";t.hasClass("airline")&&(o="airlines"),$.ajax({url:"/ajax.php",type:"GET",dataType:"json",data:{action:o+"_calc",input:parseInt(e.val().replace(/[^\d]+/g,""))},success:function(e){t.removeClass("loading"),"Best"in e&&("#REF!"==e.Best.name&&(e.Best.name="N/A"),"#REF!"==e.Best.value&&(e.Best.value="N/A"),t.find(".ch-edu-calc-title:first").html(e.Best.name),t.find(".ch-edu-calc-content:first").html("WalletHub Score: "+e.Best.value)),"RunnerUp"in e&&("#REF!"==e.RunnerUp.name&&(e.RunnerUp.name="N/A"),"#REF!"==e.RunnerUp.value&&(e.RunnerUp.value="N/A"),t.find(".ch-edu-calc-title:last").html(e.RunnerUp.name),t.find(".ch-edu-calc-content:last").html("WalletHub Score: "+e.RunnerUp.value))}})},300)}).autoNumeric({aSign:"$",mDec:0}),$(document).ready(function(){var e=null,t=/cca\-tooltip([0-9]+)/i;$(".cca-qmark").each(function(){null!=(e=this.className.match(t))&&$("#tooltip"+e[1]).length>0&&$(this).click(function(){var e="tooltip"+this.className.match(t)[1];$("#tooltip").html($("#"+e).html()),fnShowTooltip(this)})}),$(".cca-aoslink").click(function(){var e=$(".cca-qmark-aos").get(0);return $("#tooltip").html($("#tooltip"+e.className.match(t)[1]).html()),fnShowTooltip(e),!1}),$("#tooltip-close").click(function(){return fnCloseTooltip(),!1})});var gTt=0;if($(".cc-section .main-content .top-nav a").on("click",function(e){e.preventDefault();var t=$(this).attr("href").substring(1);$(".cc-section .top-nav .nav-content a").each(function(){$(this).removeClass("selected")}),$(".cc-section .main-content .content").each(function(){$(this).removeClass("selected")}),$(this).addClass("selected"),$(".cc-section .main-content ."+t).addClass("selected")}),$(".cc-section .main-content .key-terms span.cc-edu-link").on("click",function(e){e.preventDefault(),$(".cc-section .main-content .top-nav a[href=#additional-info-content]").click()}),$(".cc-section .main-content .key-terms .rewards-link").on("click",function(e){e.preventDefault(),$(".cc-section .main-content .top-nav a[href=#additional-info-content]").click()}),$(".cc-section").length>0){var timer;timer=null;var hash=location.hash.substr(1),_cids=[];$(".cc-section").each(function(){_cids.push($(this).data("cc-id"))}),cookie.is_logged_in()&&($(".content.minimum-credit-needed").addClass("loading"),$(".content.minimum-credit-needed .loading-spinner").show(),_dta={action:"Edu.CreditCard",ids:_cids},$.ajax({type:"POST",url:"/ajax.php",data:_dta,dataType:"json",success:function(e){if(e.error||Object.keys(e.res).forEach(function(t){if(""!=e.res[t].html){if($(".cc-section[data-cc-id="+t+"] .content.minimum-credit-needed").empty().append(e.res[t].html),window.screen.width<600){var o=$("span.score").html();if(o>=300&&o<=640){var a=o-640;a*=.0882,$("span.score").css("left",a+"%")}else if(o>640&&o<=700){var a=o-640;a=.5*a+30,$("span.score").css("left",a+"%")}else if(o>700){var a=o-700;a=.2*a+60,$("span.score").css("left",a+"%")}var i=$(".cc-section[data-cc-id="+t+"] .minimum-credit-needed").height();$(".cc-section[data-cc-id="+t+"] img.tu-logo").css("top",i-42+"px")}$(".cc-section .minimum-credit-needed .credit-score-result").height()>150&&($(".cc-section .minimum-credit-needed").css("height",$(".cc-section .minimum-credit-needed .credit-score-result").height()-20+"px"),$(".cc-section .tu-logo").css("margin-top",$(".cc-section .minimum-credit-needed .credit-score-result").height()-125+"px"))}$(".cc-section[data-cc-id="+t+"] .cc-section .card-details-container .stars i").each(function(o){e.res[t].rating>o+1?($(this).removeClass($(this).attr("class")),$(this).addClass("bf-icon-star")):e.res[t].rating==o?($(this).removeClass($(this).attr("class")),$(this).addClass("bf-icon-star")):e.res[t].rating>=o+.5?($(this).removeClass($(this).attr("class")),$(this).addClass("bf-icon-star-half")):($(this).removeClass($(this).attr("class")),$(this).addClass("bf-icon-star-empty"))}),$(".cc-section[data-cc-id="+t+"] .cc-section .card-details-container .stars a.review").html("("+e.res[t].reviews+")"),$(".cc-section[data-cc-id="+t+"] .cc-section .card-details-container .stars .popup-review span.bold").html(e.res[t].rating+" / 5"),$(".cc-section[data-cc-id="+t+"] .cc-section .card-details-container .stars .popup-review span.reviews").html("from "+e.res[t].reviews+" review"+(e.res[t].reviews>1?"s":""))}),$(".content.minimum-credit-needed .loading-spinner").hide(),$(".content.minimum-credit-needed").removeClass("loading"),hash.length>0&&"card"==hash){var t=$(".cc-section").offset().top;$(window).width()<416&&(t=$(".cc-section").offset().top),$("html,body").animate({scrollTop:t-80})}},error:function(e,t,o){}})),$(".cc-section .stars i, .cc-section .stars a").on("mouseover",function(){$(".cc-section .popup-review").show(),null!=timer&&clearTimeout(timer)}).on("mouseout",function(){null!=timer&&clearTimeout(timer),timer=setTimeout(function(){$(".cc-section .popup-review").hide()},1e3)}),$(".cc-section .popup-review").on("mouseover",function(){null!=timer&&clearTimeout(timer)}).on("mouseout",function(){null!=timer&&clearTimeout(timer),timer=setTimeout(function(){$(".cc-section .popup-review").hide()},1e3)})}!function($){var chVote=function(opt){var ajaxCall=!1,voting=!1,cached=!1,voted=!1,rating=!1,_s=$.extend({star_parent:".stars",star_el:!1,star_hover_cl:"bf-icon-star-hover",star_chosen_cl:"bf-icon-star-active",offset:{}},opt);if(!_s.star_el||!_s.star_parent||$(_s.star_parent).find(_s.star_el).length<1)return void console.log("no star element defined or the current star_parent is invalid ( default is '.stars')");var _parent=$(_s.star_parent),_base=_s.star_el,getInfo=function(vote){if(!voted||!cached){var guid=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return function(){return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}}(),cke;cke=cookie.read("wh_ratings_tracking"),null==cke&&cookie.create("wh_ratings_tracking",guid(),365),cke=cookie.read("wh_ratings"),cke=eval("("+cke+")");var _this=this,rtg=$(_this).index()+1,data={};if(data.id=_parent.find("a.review").attr("href"),!voting&&!voted){if(cached)return;return $(".stars .loading").show(),ajaxCall=$.get("/ajax.php",{action:"Details.GetRate",uri:data.id},function(e,t){if(e.error&&"rtg-hasreview"==e.type){switch($(".popup-review p:first-child").html("Thanks for rating"),e.rating){case 1:$(".popup-review p.green span").html("Bad"),rating="Bad",$(".stars i:eq(1)").addClass("selected-rating");break;case 2:$(".popup-review p.green span").html("Bellow Average"),rating="Bellow Average",$(".stars i:eq(2)").addClass("selected-rating");break;case 3:$(".popup-review p.green span").html("Average"),rating="Average",$(".stars i:eq(3)").addClass("selected-rating");break;case 4:$(".popup-review p.green span").html("Good"),rating="Good",$(".stars i:eq(4)").addClass("selected-rating");break;case 5:$(".popup-review p.green span").html("Excellent"),rating="Excellent",$(".stars i:eq(5)").addClass("selected-rating")}voted=!0}cached=!0,$(".stars .loading").hide()},"json"),!1}voting&&!voted&&($(".stars .loading").show(),ajaxCall=$.post("/ajax.php",{action:"Details.SetRate",rtg:rtg,uri:data.id,path:window.location.pathname},function(e,t){if(e.error)return"cookie"==e.type?(window.alert("Please make sure your browser supports cookies."),cookie.delete("wh_ratings_tracking")):console.log("rating error: "+e.type),top.location.reload(),!1;if(e.guest&&e.redirect)return"self"==e.redirect&&(e.redirect="/join/light?fm&redirect_to="+escape(window.location.href)),window.location.href=e.redirect,!1;e.voted=!0,e.voted_rating=rtg,e.total>1?(_parent.find("a.review").html("("+e.total_formatted+")"),$(".popup-review p.rating span.bold").html("from "+e.total_formatted+" reviews")):1==e.total&&$(".popup-review p.rating span.bold").html("from "+e.total_formatted+" review");for(var o=e.rating_rounded,a=o-Math.floor(o),i=0;i<5;i++)i==Math.floor(o)&&a>.1?_parent.children("i:eq( "+i+" )").addClass("bf-icon-star-half").removeClass("bf-icon-star-empty").removeClass("bf-icon-star"):i<o?_parent.children("i:eq( "+i+" )").addClass("bf-icon-star").removeClass("bf-icon-star-empty").removeClass("bf-icon-star-half"):_parent.children("i:eq( "+i+" )").addClass("bf-icon-star-empty").removeClass("bf-icon-star").removeClass("bf-icon-star-half");$(".popup-review p:first-child").empty().append("Thanks for rating"),$(".popup-review p.rating span.bold").html(e.rating_formatted+" / 5"),voting=!1,voted=!0,$(".stars .loading").hide()},"json"))}},setVote=function(){var e=this;voting||voted||(ajaxCall&&ajaxCall.abort(),ajaxCall=!1,voting=!0,getInfo.call(e,!0))};$(_parent).find(_base).mouseenter(function(){if(!voting)switch(getInfo.call(this),$(".cc-section .stars").addClass("hover"),$(this).add($(this).prevAll(_base)).addClass(_s.star_hover_cl),$(this).index()){case 1:return $(".popup-review p.green span").html("Bad"),void(voted&&"Bad"!=rating?$(".popup-review p:first-child").html("Change my rating to:"):rating?$(".popup-review p:first-child").html("Change my rating to:"):$(".popup-review p:first-child").html("Click to submit your rating"));case 2:return $(".popup-review p.green span").html("Bellow Average"),void(voted&&"Bellow Average"==rating?$(".popup-review p:first-child").html("Keep my existing rating"):rating?$(".popup-review p:first-child").html("Change my rating to:"):$(".popup-review p:first-child").html("Click to submit your rating"));case 3:return $(".popup-review p.green span").html("Average"),void(voted&&"Average"==rating?$(".popup-review p:first-child").html("Keep my existing rating"):rating?$(".popup-review p:first-child").html("Change my rating to:"):$(".popup-review p:first-child").html("Click to submit your rating"));case 4:return $(".popup-review p.green span").html("Good"),void(voted&&"Good"==rating?$(".popup-review p:first-child").html("Keep my existing rating"):rating?$(".popup-review p:first-child").html("Change my rating to:"):$(".popup-review p:first-child").html("Click to submit your rating"));case 5:return $(".popup-review p.green span").html("Excellent"),void(voted&&"Excellent"==rating?$(".popup-review p:first-child").html("Keep my existing rating"):rating?$(".popup-review p:first-child").html("Change my rating to:"):$(".popup-review p:first-child").html("Click to submit your rating"))}}).mouseleave(function(){$(this).add($(this).prevAll(_base)).removeClass(_s.star_hover_cl),voted&&rating?($(".popup-review p.green span").html(rating),$(".popup-review p:first-child").html("Keep my existing rating")):($(".popup-review p.green span").empty(),$(".popup-review p:first-child").html("Click to submit your rating")),$(".cc-section .stars").removeClass("hover")}).click(function(){voting||(voted=!1,setVote.call(this))})};window.chVote=chVote}(jQuery),$(".stars").each(function(){window.chVote({star_parent:this,star_el:'[class*="bf-icon-star"]'})})});