function toggleChevron(n){$(n.target).prev(".panel-heading").find("i.indicator").toggleClass("glyphicon-chevron-down glyphicon-chevron-up")}function getBaseLocation(){return location.href.toLowerCase().indexOf("dev4")>-1?"/dev4":location.href.toLowerCase().indexOf("sandbox4")>-1?"/sandbox4":location.href.toLowerCase().indexOf("staging4")>-1?"/staging4":location.href.toLowerCase().indexOf("ncee")>-1?"/ncee/wwc":location.href.toLowerCase().indexOf("members")>-1?"/websitetools/wwccms":""}function lowercase(n){return n.toLowerCase()}function capitalize(n){return n.charAt(0).toUpperCase()+n.slice(1)}function titleCase(n){return n.replace(/\w\S*/g,function(n){return n.charAt(0).toUpperCase()+n.substr(1).toLowerCase()})}function keywordsHighlight(n){var t=new RegExp("("+n+")(?![^<]*>|[^<]*<\/a>)","g");$(".keyword-search").each(function(){$(this).html($(this).html().replace(t,"<strong class='keywordHighlight'>"+n+"<\/strong>"))})}function keywordsHighlightAllCase(n){n&&(keywordsHighlight(n),keywordsHighlight(n.toLowerCase()),keywordsHighlight(n.toUpperCase()),keywordsHighlight(capitalize(n)),keywordsHighlight(titleCase(n)))}function keywords2Array(n){var t,i;if(n==null)return[];while(n.indexOf('"')>-1)t=n.substr(0,n.indexOf('"')+1),n=n.substr(t.length),i=n.substr(0,n.indexOf('"')),n=n.substr(i.length+1),t=t.replace('"',""),i=i.replace(/ /g,"~~~").replace(/\"/g,""),n=t+i+n;return n=n.replace(/ /g,"```").replace(/~~~/g," "),n.split("```")}function containsSpecialCharacters(n){return/[ !@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/g.test(n)}function ellipsize(n,t){var i=500,r=n.length,e=i,o=100,s,f,u;return r<i&&(e=r),s=0,t&&(s=t.length),f=n.indexOf(t),f>-1?f+s<=i?(u=n.substr(0,e),e!=r&&(u=u+"...")):(u="..."+n.substr(f-o,r-(f-o)),r-(f-o)<i&&(u="..."+n.substr(r-i,i))):u=r>i?n.substr(0,e)+"...":n,u}function reverseString(n){var i,t;if(n==null)return"";for(i="",t=n.length-1;t>=0;t--)i+=n[t];return i}function loading(){loadingComplete=!1;setTimeout(function(){loadingComplete||$(".loading-panel").show()},250)}function loaded(){loadingComplete=!0;$(".loading-panel").hide()}function httpGet(n){xmlhttp=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");xmlhttp.onreadystatechange=function(){xmlhttp.readyState==4&&xmlhttp.status==200&&alert(xmlhttp.responseText)};xmlhttp.open("GET",n,!1);xmlhttp.send()}function tooltipSet(n,t){$(n).tooltip({title:"<a onclick=\"$('"+n+"').tooltip('hide');\" class=\"pull-right\"><\/a>"+t,placement:"auto top",html:!0,delay:{show:50,hide:1e3},trigger:"hover"})}function tooltipDisplay(){if($(".glossary-tooltip").length){var n=Math.random();tooltipDisplayId=n;removedHtmlTags=[];$(".glossary-tooltip a, .glossary-tooltip img, .glossary-tooltip area").addClass("exclude-definition");$(".glossary-tooltip .exclude-definition").each(function(){removedHtmlTags.push($(this).prop("outerHTML"));$(this).replaceWith("<removed class='"+(removedHtmlTags.length-1)+"' />")});$("[sticky-tooltip]").each(function(){$(this).removeAttr("sticky-tooltip").removeClass("hilite")});$.ajax({type:"post",url:"//"+location.host+getBaseLocation()+"/Glossary/Items",dataType:"json",data:{type:"tooltip",letter:null,keywords:null},success:function(t){n==tooltipDisplayId&&($.each(t,function(){var i;if(n==tooltipDisplayId){var t=$(this)[0],r=$("<a/>").addClass("glossary-term").addClass("g"+t.GlossaryId),i=new RegExp(lowercase(t.Term),"g");$(".glossary-tooltip:contains('"+lowercase(t.Term)+"')").each(function(){$(this).html($(this).html().replace(i,r.prop("outerHTML")))});i=new RegExp(capitalize(t.Term),"g");$(".glossary-tooltip:contains('"+capitalize(t.Term)+"')").each(function(){$(this).html($(this).html().replace(i,r.addClass("C").prop("outerHTML")))});i=new RegExp(titleCase(t.Term),"g");$(".glossary-tooltip:contains('"+titleCase(t.Term)+"')").each(function(){$(this).html($(this).html().replace(i,r.addClass("T").prop("outerHTML")))})}}),$.each(removedHtmlTags,function(n,t){$(".glossary-tooltip removed."+n).replaceWith(t)}),$.each(t,function(){var n=$(this)[0],t=titleCase(n.Term),i;t=t.replace(new RegExp("Wwc","g"),"WWC");t=t.replace(new RegExp(" Of ","g")," of ");t=t.replace(new RegExp(" And ","g")," and ");t=t.replace(new RegExp("s G","g"),"s <em>g<\/em>");t=t.replace(new RegExp("Abab","g"),"ABAB");t=t.replace(new RegExp(" An ","g")," an ");t=t.replace(new RegExp("-case","g"),"-Case");t=t.replace(new RegExp("A C","g"),"a C");t=t.replace(new RegExp("/w","g"),"/W");i="<p class='tooltip-title'>"+t+"<\/p>";n.DefinitionShort&&(i+="<p>"+n.DefinitionShort+"<p>");n.Definition&&(i+="<p>"+n.Definition+"<p>");i=i.replace("<a ","<a onclick=\"$('.tt"+n.GlossaryId+"').tooltip('hide');\"");$(".g"+n.GlossaryId+".T").removeClass("g"+n.GlossaryId).addClass("tt"+n.GlossaryId).removeClass("T").css("position","relative").attr("data-toggle","tooltip").attr("name",n.Term).html(titleCase(n.Term));$(".g"+n.GlossaryId+".C").removeClass("g"+n.GlossaryId).addClass("tt"+n.GlossaryId).removeClass("C").css("position","relative").attr("data-toggle","tooltip").attr("name",n.Term).html(capitalize(n.Term));$(".g"+n.GlossaryId).removeClass("g"+n.GlossaryId).addClass("tt"+n.GlossaryId).css("position","relative").attr("data-toggle","tooltip").attr("name",n.Term).html(lowercase(n.Term));$('[name="'+n.Term+'"]').tooltip({title:"<a onclick=\"$('.tt"+n.GlossaryId+"').tooltip('hide');\" class=\"pull-right\"><\/a>"+i,placement:"auto top",html:!0,delay:{show:50,hide:1e3},trigger:"hover"})}),$(".glossary-tooltip").each(function(){$(this).removeClass("glossary-tooltip")}))}})}}function surveyBlockVideo(n){product=n.substring(n.lastIndexOf("/")+1);switch(product){case"27poYdVXQUk":setTimeout(function(){$(".modal-dialog .modal-content .modal-body").prepend(surveyBlock(product));$(".surveyBlock").fadeIn(250)},250)}}function surveyBlockLinks(){}function surveyBlockPage(){window.location.href.toLowerCase().indexOf("practiceguide/20")>-1&&setTimeout(function(){$(".WWCwrap").prepend(surveyBlock("PG20"));$(".surveyBlock").fadeIn(250)},250)}function hideSurveyBlock(){$(".surveyBlock").fadeOut(250)}var loadingComplete,tooltipDisplayId;$(document).ready(function(){setTimeout(function(){tooltipDisplay()},500)});loadingComplete=!1;$(document).ready(function(){surveyBlockLinks();surveyBlockPage()})