'use strict';window.StackExchange={};function CTIsPlayback(){try{return parent&&parent.WebPlayer}catch(g){return!1}}if(!CTIsPlayback()&&top!=self)throw top.location.replace(document.location),$(function(){$("head").add("body").remove()}),alert("For security reasons, framing is not allowed; click OK to remove the frames."),Error();
StackExchange.init=function(){var g=function(a){if(!window.jQuery)if("complete"!=document.readyState)setTimeout(function(){g(a)},1E3);else{var d=document.createElement("div");d.id="noscript-padding";var c=document.createElement("div");c.id="noscript-warning";c.innerHTML=a+" requires external JavaScript from another domain, which is blocked or failed to load.";document.body.insertBefore(d,document.body.firstChild);document.body.appendChild(c)}},a=function(){$(document).keyup(function(a){27==a.which&&
($("#lightbox:not(.no-esc-remove), .error-notification, .popup, .share-tip, .esc-remove").fadeOutAndRemove(),$(".esc-hide").fadeOut(),window.genuwine&&genuwine.isVisible()&&genuwine.click(),window.profileLink&&profileLink.hide())})},e=function(){var a=$("#hlinks"),d=$("#search input[name=q]"),c=d.width(),e=2.5*c,g,h=function(c){d.queue("expand",c)},k=!1,l=!("placeholder"in document.createElement("input"));l&&!StackExchange.options.isMobile&&(""==d[0].value&&(d[0].value="search"),d.bind({focus:function(){"search"==
this.value&&(this.value="")}}));d.keydown(function(c){if(k||46>c.keyCode&&8!=c.keyCode&&32!=c.keyCode)return!0;k=!0;clearTimeout(g);d.clearQueue("expand");h(function(c){d[0].placeholder="";a.fadeOut(100,c)});h(function(c){d.animate({width:e,"max-width":e},100,c)});h(function(){0==d.parent().find(".search-prompt").length&&d.before('<span class="search-prompt">search:</span>')});3==d.queue("expand").length&&d.dequeue("expand")}).focusout(function(){g=setTimeout(function(){h(function(c){d.parent().find(".search-prompt").remove();
c()});h(function(a){d.animate({width:c,"max-width":c},100,a)});h(function(c){l&&""==d[0].value&&(d[0].value="search");d[0].placeholder="search";a.fadeIn(100,c)});3==d.queue("expand").length&&d.dequeue("expand");k=!1},200)});$("#search").keydown(function(c){if(13==c.which&&c.ctrlKey&&d.val())return window.open("/search?q="+encodeURIComponent(d.val()),"_newtab"),!1})};return function(f){StackExchange.options=f;var d=f.serverTime-(new Date).getTime()/1E3;g(f.site.name);$.ajaxSetup({cache:!1});StackExchange.init.createJqueryExtensions();
$(function(){a();e();StackExchange.using(StackExchange.options.user.isAnonymous?"anonymous":"loggedIn",function(){StackExchange.initialized.resolve()},!0,f.fullPostfix);StackExchange.ready(function(){genuwine.init(f.user.accountId||null,f.user.inboxUnviewedCount,f.user.notificationsUnviewedCount);f.user.messages&&StackExchange.notify.showMessages(f.user.messages,f.isMobile);f.site.globalAuthDisabled||(!f.site.isChildMeta&&f.user.isAnonymous&&gauth.checkStackAuth(f.stackAuthUrl),gauth.informStackAuth(f.stackAuthUrl));
f.user.isAnonymous||profileLink.init(f.user.gravatar,f.isMobile,f.user.profileUrl+"?tab=activity",d);f.enableUserHovercards&&StackExchange.usermenu.init();StackExchange.tagPreferences?StackExchange.tagPreferences.init():StackExchange.tagmenu.init()})})}}();
StackExchange.debug={log:function(){},init:function(){this.log=function(g){$(function(){var a=$("#debug-messages");a.length||(a=$("<div id='debug-messages' style='text-align:left;position:fixed;top:50px;left:50px;z-index:1000;background:white;border:2px solid black;width:300px;padding:10px;' />").append($("<span style='cursor:pointer;color:#999'>(close debug messages)</span>").click(function(){$("#debug-messages").remove()})).appendTo("body"));$("<div style='margin-top:10px' />").text(g).appendTo(a)})}}};
StackExchange.initialized=$.Deferred();StackExchange.ready=function(g){StackExchange.initialized.done(g)};if(window.serq)for(var i=0;i<window.serq.length;i++)StackExchange.ready(window.serq[i]);
(function(){var g={anonymous:"full-anon.js",loggedIn:"full.js",prettify:"prettify-full.js",pseudoModerator:"moderator.js",inlineEditing:"full.js",editor:"wmd.js",autocomplete:"third-party/jquery.autocomplete.min.js",tagAutocomplete:"tageditor.js",tagEditor:"tageditornew.js",mobile:"mobile.js",help:"help.js",inlineTagEditing:"inline-tag-editing.js",mathjaxEditing:"mathjax-editing.js",mathjaxEditingNew:"mathjax-editing-new.js",revisions:"revisions.js",suggestedEdits:"suggested-edits.js",mockups:"mockups.js"},
a={},e={},f,d={},c=function(c,a){return function(d){var e=c[d];e||(e=c[d]=a(d));return e}},o=function(c){var c=a[c],d,e=$.Deferred(),f=$.when(e),g;if(c)for(d=0;d<c.length;d++)(g=c[d].call(null))&&$.isFunction(g.promise)&&(f=$.when(f,g));e.resolve();return f},j=function(){if(!f){var c=$("script[src*='/stub.js']:first");0==c.length?(StackExchange.debug.log("couldn't figure out location of stub.js"),f="/content/js/"):f=c.attr("src").replace(/\/stub\.js.*$/,"/")}return f},h=function(c){var a=d["js/"+
c];return!a?(StackExchange.debug.log("no cache breaker for "+c),""):"?v="+a},k=function(c){c=g[c];return!c?$.Deferred().reject().promise():l(c)},l=c({},function(c){var a=$.Deferred(),d=document.createElement("script");d.async="async";d.type="text/javascript";d.src=j()+c+h(c);d.onload=d.onreadystatechange=function(c,e){if(!d.readyState||/loaded|complete/.test(d.readyState))e?a.reject():a.resolve()};d.onerror=function(){a.reject()};$("head")[0].appendChild(d);return a.promise()}),n=c({},function(c){function a(){(e=
StackExchange[c])?o(c).done(function(){d.resolve()}):0<f?(f--,StackExchange.debug.log("retrying "+c),setTimeout(a,20)):(StackExchange.debug.log("object "+c+" not available although file was loaded"),d.reject())}var d=$.Deferred(),e=StackExchange[c],f=3;e?d.resolve():k(c).done(a).fail(d.reject);return d.promise()}),p=$.Deferred(),q=function(c,d,a,e){if(!a&&!p.isResolved())p.done(function(){q(c,d)});else{if(a)for(var f in g)g.hasOwnProperty(f)&&(g[f]=g[f].replace(/^(full(?:-anon)?).js$/,"$1"+(e||"")+
".js"));e=n(c);a?p.resolve():e=$.when(e,StackExchange.initialized);e.done(function(){d()}).fail(function(){StackExchange.debug.log("failed to provide object "+c)});return e}};q.setCacheBreakers=function(c){for(var a in c)c.hasOwnProperty(a)&&(d[a]=c[a])};StackExchange.using=q;StackExchange.ifUsing=function(c,d,f){if("undefined"!==typeof f){if(e["u_"+f])return;e["u_"+f]=!0}StackExchange[c]?d():((f=a[c])||(f=a[c]=[]),f.push(d))}})();
String.prototype.format=function(){var g=this.toString();if(!arguments.length)return g;var a="string"==typeof arguments[0]?arguments:arguments[0],e;for(e in a)g=g.replace(RegExp("\\{"+e+"\\}","gi"),a[e]);return g};String.prototype.truncate=function(g,a){var e=this.toString();g&&e.length>g&&(e=e.substr(0,g)+a);return e};
StackExchange.init.createJqueryExtensions=function(){var g=StackExchange.helpers;$.fn.extend({fadeOutAndRemove:function(){return this.each(function(){var a=$(this);a.fadeOut("fast",function(){a.trigger("removing").remove()})})},charCounter:function(a){return this.each(function(){var e=a.target?$(a.target):$(this).parents("form").find("span.text-counter"),f=this;$(this).bind("blur focus keyup paste",g.DelayedReaction(function(){var d=a.min,c=a.max,g=a.setIsValid||function(){},j=f.value?f.value.length:
0,h=j>0.8*c?"supernova":j>0.6*c?"hot":j>0.4*c?"warm":"cool",k="";0==j?(k="enter at least "+d+" characters",g(!1)):j<d?(k=d-j+" more to go...",g(!1)):(k=c-j+" character"+(1!=c-j?"s":"")+" left",g(j<=c));e.text(k);e.hasClass(h)||e.removeClass("supernova hot warm cool").addClass(h)},100,{sliding:!0}).trigger)})},selectRange:function(a,e){return this.each(function(){if(this.setSelectionRange)this.focus(),this.setSelectionRange(a,e);else if(this.createTextRange){var f=this.createTextRange();f.collapse(!0);
f.moveEnd("character",e);f.moveStart("character",a);f.select()}})},addSpinner:function(a){return this.each(function(){g.addSpinner(this,a)})},addSpinnerAfter:function(a){return this.each(function(){$(this).after(g.getSpinnerImg(a))})},removeSpinner:function(){return this.each(function(){$(this).find("img.ajax-loader").remove()})},showErrorPopup:function(a,e,f){return this.each(function(){g.showErrorPopup(this,a,e,f)})},center:function(){var a=this.parent();"static"===a.css("position")&&(a=a.offsetParent());
var a=a.offset(),e=$(window);this.css("position","absolute");this.css("top",(e.height()-this.height())/2+e.scrollTop()-a.top+"px");this.css("left",(e.width()-this.width())/2+e.scrollLeft()-a.left+"px");return this},helpOverlay:function(){g.bindHelpOverlayEvents(this);return this},hideHelpOverlay:function(){g.hideHelpOverlay(this);return this},enable:function(){0==arguments.length||arguments[0]?this.removeAttr("disabled").css("cursor","pointer"):this.attr("disabled","disabled").css("cursor","default");
return this},disable:function(){return this.enable(!1)},loadPopup:function(a){var e=this;e.addSpinnerAfter({padding:"0 3px"});$.ajax({type:"GET",url:a.url,dataType:"html",success:function(f){var d=$(f);d.find(".popup-actions-cancel, .popup-close a").click(function(){d.fadeOutAndRemove()});d.find("input:radio[disabled=disabled] + label.action-label").addClass("action-disabled");a.hideDescriptions&&d.find("ul.action-list > li:not(.action-selected) .action-desc").hide();f=d.find("input:radio:not(.action-subform input)");
f.closest("li").bind("hide-action",function(){var c=$(this),d=".action-subform"+(a.hideDescriptions?", .action-desc":"");c.removeClass("action-selected").find(d).slideUp("fast")}).bind("show-action",function(){var c=$(this);c.hasClass("action-selected")||(c.siblings(".action-selected").trigger("hide-action"),c.addClass("action-selected").find(".action-subform").slideDown("fast",function(){a.subformShow&&a.subformShow($(this));if(a.subformFocusInput){var c=$(this).find("input[type=text], textarea").not(".actual-edit-overlay").eq(0);
c.length&&c.focus()}}),a.hideDescriptions&&c.find(".action-desc").slideDown("fast"),a.actionSelected&&a.actionSelected(c),d.find(".popup-submit").enable())});f.click(function(){$(this).closest("li").trigger("show-action")});d.appendTo(e.parent());a.loaded&&a.loaded(d);f=function(){};if(a.subformShow){var c=d.find("li.action-selected .action-subform");0<c.length&&(f=function(){c.each(function(){a.subformShow($(this))})})}a.dontCenter||d.center().fadeIn("fast",f)},error:function(){e.parent().showErrorPopup("Unable to load popup - please try again")},
complete:g.removeSpinner});return e}})};
StackExchange.helpers=function(){function g(c,d,a){for(var e=0;e<a.length;e++){var g=a[e];try{if(/\*/.test(g))for(var l=0;4>l;l++){var n=g.replace(/\*/g,f[l]),p=c.css(n);d.css(n,p)}else d.css(g,c.css(g))}catch(q){}}}function a(c,d,a,e){if(c.is(":visible")){var f=$.browser.msie?0:0.4;a()?(c.css("opacity",f+(e?0.2:0)),c.addClass("edit-field-overlayed"),a=c.prev(".actual-edit-overlay"),0==a.length&&(e=c.parent().find("span.edit-field-overlay").text(),a=c.width(),f=c.height(),a=c.clone().prop("className",
"actual-edit-overlay").attr("name",null).attr("id",null).attr("disabled","disabled").css({position:"absolute",backgroundColor:"white",color:"black","-webkit-text-fill-color":"black",opacity:1,width:a,height:f}),a.is("textarea,input")?(a.val(e),g(d,a,["line-height"])):a.text(e).css("line-height",f+"px").prepend("&nbsp;"),g(d,a,["font-family","font-size","text-align"]),g(c,a,["border-*-style","border-*-color","border-*-width"]),c.css({zIndex:1,position:"relative"}),a.insertBefore(c),e=c.offset().top-
a.offset().top,0!=e&&(d=parseInt(a.css("margin-top")),e=d+e,c.is("textarea")||(e=parseInt(a.prevAll(":visible").eq(0).css("margin-bottom"))+d),a.css("margin-top",e)),c=c.offset().left-a.offset().left,0!=c&&(d=parseInt(a.css("margin-left")),a.css("margin-left",d+c)))):c.css("opacity",1).css("filter","").removeClass("edit-field-overlayed")}}function e(c,a){$(c).find("input[type='submit']").prop("disabled",a)}var f=["left","right","top","bottom"],d={genericBindOverlayEvents:function(c,e,f){StackExchange.options.isMobile||
e.bind("keydown contextmenu",function(){d.hideHelpOverlay(c)}).focus(function(){a(c,e,f,!0)}).blur(function(){a(c,e,f)}).each(function(){a(c,e,f)})},bindHelpOverlayEvents:function(c){c.each(function(){var c=$(this);d.genericBindOverlayEvents(c,c,function(){return""===c.val()})})},hideHelpOverlay:function(c){c.css("opacity",1);c.css("filter","");c.removeClass("edit-field-overlayed")},onClickDraftSave:function(c){$(c).click(function(){var c=this.href;StackExchange.cardiologist.ensureDraftSaved(function(){window.onbeforeunload=
null;window.location.href=c});return!1});return!0},showErrorPopup:function(c,a,d,e){$(".error-notification").remove();var f=$('<div class="error-notification supernovabg"><h2>'+a+"</h2>"+(d?"":'<span class="error-close">(click on this box to dismiss)</span>')+"</div>"),g=function(){f.fadeOutAndRemove();e&&e()};$(c).append(f);f.click(g).fadeIn("fast");setTimeout(g,d?Math.max(2500,40*a.length):3E4)},removeErrorPopup:function(){$(".error-notification").fadeOutAndRemove()},addSpinner:function(c,a){$(c).append(d.getSpinnerImg(a))},
getSpinnerImg:function(c){var a=$('<img class="ajax-loader" src="/content/img/progress-dots.gif" title="loading..." alt="loading..." />');c&&a.css(c);return a},removeSpinner:function(){$("img.ajax-loader").remove()},enableSubmitButton:function(c){e(c,!1)},disableSubmitButton:function(c){e(c,!0)},loadTicks:function(c){var a;a=c?c.find(".edit-block"):$(".edit-block");0==a.find("input[name=i1l]").length&&!a.data("loading-ticks")&&(a.data("loading-ticks",!0),$.ajax({url:"/questions/ticks",cache:!1,success:function(c){a.append("<input type='hidden' name='i1l' value='"+
c+"' />")},complete:function(){a.data("loading-ticks",!1)}}))},showFancyOverlay:function(c){var c=c||{},a=$("#overlay-header"),d=c.message||"",e=$.browser.msie?{background:"#fff",opacity:0}:{};!1!==c.showClose&&(d+='<br><a class="close-overlay">close this message</a>');a.html(d).css(e).animate({opacity:"1",height:"show"},"slow",c.complete).find(".close-overlay").click(function(){a.animate({opacity:"0",height:"hide"},"fast")})},DelayedReaction:function(c,a,d){var d=d||{},e,f,g=d.always,n=function(){e=
null;c.apply(null,f)};return{trigger:function(){f=arguments;g&&g.apply(null,f);e?d.sliding&&(clearTimeout(e),e=setTimeout(n,a)):e=setTimeout(n,a)},cancel:function(){e&&(clearTimeout(e),e=null)}}},fireAndForget:function(c){$.ajax({type:"POST",url:c,async:!0})}};return d}();
function prepareEditor(g){var a=g.postfix||"",e=function(){setTimeout(function(){StackExchange.editor.initIfShown(g)},1)};if(g.onDemand){for(var f="bold-button,italic-button,spacer1,link-button,quote-button,code-button,image-button,spacer2,olist-button,ulist-button,heading-button,hr-button,spacer3,undo-button,redo-button".split(","),d=$('<ul id="wmd-button-row'+a+'" class="wmd-button-row" />').appendTo(".wmd-button-bar"),c=0,o=0;o<f.length;o++){var j=f[o],h=/spacer/.test(j),j=$("<li id='wmd-"+j+a+
"' />").prop("className","wmd-"+(h?"spacer":"button")).css("left",25*o).appendTo(d);$("<span />").css("background-position",c+"px -20px").appendTo(j);h||(c-=20)}var k=!1;$("#wmd-input, #title, #tagnames, #edit-comment, #m-address, #display-name").one("focus click keydown",function(){k||(k=!0,d.addSpinner({"float":"right"}),StackExchange.using("editor",function(){d.remove();g.autoShowMarkdownHelp&&(g.immediatelyShowMarkdownHelp=!0);e()}))})}else StackExchange.using("editor",e)}
StackExchange.switchMobile=function(g,a){$.post("/mobile/"+g,{returnurl:a},function(a){window.location=a})};
jQuery.cookie=function(g,a,e){if("undefined"!=typeof a){e=e||{};null===a&&(a="",e.expires=-1);var f="";if(e.expires&&("number"==typeof e.expires||e.expires.toUTCString))"number"==typeof e.expires?(f=new Date,f.setTime(f.getTime()+864E5*e.expires)):f=e.expires,f="; expires="+f.toUTCString();var d=e.path?"; path="+e.path:"",c=e.domain?"; domain="+e.domain:"",e=e.secure?"; secure":"";document.cookie=[g,"=",encodeURIComponent(a),f,d,c,e].join("")}else{a=null;if(document.cookie&&""!=document.cookie){e=
document.cookie.split(";");for(f=0;f<e.length;f++)if(d=jQuery.trim(e[f]),d.substring(0,g.length+1)==g+"="){a=decodeURIComponent(d.substring(g.length+1));break}}return a}};jQuery.expr[":"].regex=function(g,a,e){var a=e[3].split(","),f=/^(data|css):/,e=a[0].match(f)?a[0].split(":")[0]:"attr",f=a.shift().replace(f,"");return RegExp(a.join("").replace(/^\s+|\s+$/g,""),"ig").test(jQuery(g)[e](f))};
$.extend($.expr[":"],{containsExact:function(g,a,e){return $.trim(g.innerHTML.toLowerCase())===e[3].toLowerCase()},containsExactCase:function(g,a,e){return $.trim(g.innerHTML)===e[3]},containsRegex:function(g,a,e){a=/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})$/.exec(e[3]);return RegExp(a[1],a[2]).test($.trim(g.innerHTML))}});
$.extend({URLEncode:function(g){for(var a="",e=0,g=g.toString(),f=/(^[a-zA-Z0-9_.]*)/;e<g.length;){var d=f.exec(g.substr(e));null!=d&&1<d.length&&""!=d[1]?(a+=d[1],e+=d[1].length):(" "==g[e]?a+="+":(d=g.charCodeAt(e).toString(16),a+="%"+(2>d.length?"0":"")+d.toUpperCase()),e++)}return a},URLDecode:function(g){for(var a,e=/(%[^%]{2})/;null!=(m=e.exec(g))&&1<m.length&&""!=m[1];)b=parseInt(m[1].substr(1),16),a=String.fromCharCode(b),g=g.replace(m[1],a);return g}});
(function(g){g.fn.typeWatch=function(a){function e(a){if("TEXT"==a.type.toUpperCase()||"TEXTAREA"==a.nodeName.toUpperCase()){var c={timer:null,text:g(a).val().toUpperCase(),cb:f.callback,el:a,wait:f.wait};f.highlight&&g(a).focus(function(){this.select()});var e=function(a){var d=c.wait,e=!1;13==a.keyCode&&"TEXT"==this.type.toUpperCase()&&(d=1,e=!0);clearTimeout(c.timer);c.timer=setTimeout(function(){var a=e,d=g(c.el).val();if(d.length>f.captureLength&&d.toUpperCase()!=c.text||a&&d.length>f.captureLength)c.text=
d.toUpperCase(),c.cb(d)},d)};g(a).keydown(e).bind("paste",null,function(c){c.which||e(this)})}}var f=g.extend({wait:750,callback:function(){},highlight:!0,captureLength:2},a);return this.each(function(){e(this)})}})(jQuery);
(function(g){function a(a){var d;return a&&a.constructor==Array&&3==a.length?a:(d=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a))?[parseInt(d[1]),parseInt(d[2]),parseInt(d[3])]:(d=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(a))?[2.55*parseFloat(d[1]),2.55*parseFloat(d[2]),2.55*parseFloat(d[3])]:(d=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(a))?[parseInt(d[1],16),parseInt(d[2],16),parseInt(d[3],16)]:
(d=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(a))?[parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16),parseInt(d[3]+d[3],16)]:/rgba\(0, 0, 0, 0\)/.exec(a)?e.transparent:e[g.trim(a).toLowerCase()]}g.each("backgroundColor,borderBottomColor,borderLeftColor,borderRightColor,borderTopColor,color,outlineColor".split(","),function(e,d){g.fx.step[d]=function(c){if(!c.colorInit){var e;e=c.elem;var f=d,h;do{h=g.curCSS(e,f);if(""!=h&&"transparent"!=h||g.nodeName(e,"body"))break;f="backgroundColor"}while(e=e.parentNode);
e=a(h);c.start=e;c.end=a(c.end);c.colorInit=!0}c.elem.style[d]="rgb("+[Math.max(Math.min(parseInt(c.pos*(c.end[0]-c.start[0])+c.start[0]),255),0),Math.max(Math.min(parseInt(c.pos*(c.end[1]-c.start[1])+c.start[1]),255),0),Math.max(Math.min(parseInt(c.pos*(c.end[2]-c.start[2])+c.start[2]),255),0)].join()+")"}});var e={transparent:[255,255,255]}})(jQuery);
