var MsSc=MsSc||{},jq2143;MsSc.Cards=MsSc.Cards||{};jq2143=jq2143||jQuery;jq2143(document).ready(function(){MsSc.Cards.Init();jq2143(".flex-card-title h6").text(function(n,t){var i=jq2143(this).parent().attr("data-maxlength");return t.length>=i?t.trim().substr(0,i)+"...":t})});MsSc.Cards.Init=function(){var n,t;jq2143(".flex-card-panel.flex-card-clickable").on("click",".content-panel, .image-panel, .icon-panel, .colored-stripe-panel",function(){var n=jq2143(this).parent().find(".cta-panel a:first-child")[0],t=jq2143(this).parent().find(".cta-link a:first-child")[0];n&&n.click();!n&&t&&t.click()});if(jq2143(".flex-card-panel.flex-card-clickable").keyup(function(n){if(n.preventDefault(),n.keyCode===13&&n.target===this){var t=jq2143(this).parent().find(".cta-panel a:first-child")[0];t&&t.click()}}),jq2143("a.flex-link2").hover(function(){$(this).closest(".flex-card-panel").toggleClass("flex-hover")}),jq2143(".flex-card-expandable")){n=jq2143(".flex-card-expandable");n.on("click",".flex-card-expand .icon",function(){n.find(".flex-card-expand .icon").not(this).removeClass("icon-caret-up").addClass("icon-caret-down");n.find(".flex-card-expand .icon").not(this).closest(".flex-card-panel").removeClass("flex-card-open");jq2143(this).toggleClass("icon-caret-down icon-caret-up");jq2143(this).closest(".flex-card-panel").toggleClass("flex-card-open")});n.on("keypress",".flex-card-expand .icon",function(t){var i=t.which;if(i==13)return n.find(".flex-card-expand .icon").not(this).removeClass("icon-caret-up").addClass("icon-caret-down"),n.find(".flex-card-expand .icon").not(this).closest(".flex-card-panel").removeClass("flex-card-open"),jq2143(this).toggleClass("icon-caret-down icon-caret-up"),jq2143(this).closest(".flex-card-panel").toggleClass("flex-card-open"),!1});t=function(){n.each(function(){$(this).height($(this).height());var n=jq2143(this).find(".content-panel .long-des").text().trim();n||jq2143(this).find(".flex-card-expand").addClass("hidden")})};t();$(window).resize(function(){n.find(".flex-card-panel").removeClass("flex-card-open");n.find(".flex-card-expand .icon").removeClass("icon-caret-up").addClass("icon-caret-down");n.height("auto");t()})}}