text: $(loadCy=function(){cy=cytoscape(options={container:document.getElementById("cy"),minZoom:.5,maxZoom:2,style:[{selector:"node",css:{content:"data(name)","font-family":"helvetica","font-size":14,"text-outline-width":3,"text-outline-color":"#999","text-valign":"center",color:"#fff",width:"mapData(weight, 30, 80, 20, 50)",height:"mapData(height, 0, 200, 10, 45)","border-color":"#fff"}},{selector:":selected",css:{"background-color":"#000","line-color":"#000","target-arrow-color":"#000","text-outline-color":"#000"}},{selector:"edge",css:{width:2,"curve-style":"bezier","target-arrow-shape":"triangle"}},{selector:".foo",css:{"border-width":4,"border-color":"red"}}],elements:{nodes:[{data:{id:"j",name:"Jerry",weight:65,height:174}},{data:{id:"e",name:"Elaine",weight:48,height:160}},{data:{id:"k",name:"Kramer",weight:75,height:185}},{data:{id:"g",name:"George",weight:70,height:150}}],edges:[{data:{source:"j",target:"e",id:"je"}},{data:{source:"j",target:"k",id:"jk"}},{data:{source:"j",target:"g",id:"jg"}},{data:{source:"e",target:"j",id:"ej"}},{data:{source:"e",target:"k",id:"ek"}},{data:{source:"k",target:"j",id:"kj"}},{data:{source:"k",target:"e",id:"ke"}},{data:{source:"k",target:"g",id:"kg"}},{data:{source:"g",target:"j",id:"gj"}}]},ready:function(){}})}),$(function(){function debounce(e,t){var o;return function(){var n=this,i=arguments;clearTimeout(o),o=setTimeout(function(){o=null,e.apply(n,i)},t)}}$("#navigation").on("wheel mousewheel DOMMouseScroll MozMousePixelScroll scroll",function(e){e.stopPropagation()}),$("#open-navigation").on("click",function(){$("body").addClass("navigation-open")}),$("#open-navigation-bg, #navigation a").on("click",function(){$("body").removeClass("navigation-open")}),$("#navigation a").on("click",function(){var e=$("#navigation").scrollTop();setTimeout(function(){$("#navigation").scrollTop(e+10),$("#navigation").scrollTop(e-10),$("#navigation").scrollTop(e)},0)});var $toclinks=$(".section > .toclink"),$tocinput=$("#toc-input"),$tocsections=$("#toc-sections"),lastTxt,filterSections=debounce(function(){txt=$tocinput.val().toLowerCase();var e=""===txt?$toclinks:$toclinks.filter(function(e,t){return t.text.toLowerCase().match(txt)}),t=$toclinks.not(e);e.show(),t.hide(),e.parent().each(function(e,t){var o=$(t);o.hasClass("lvl3")?(o.prevAll(".lvl2:first").children(".toclink").show(),o.prevAll(".lvl1:first").children(".toclink").show()):o.hasClass("lvl2")?(o.prevAll(".lvl1:first").children(".toclink").show(),o.nextUntil(".lvl2, .lvl1").children(".toclink").show()):o.hasClass("lvl1")&&o.nextUntil(".lvl1").children(".toclink").show()}),$tocsections.removeClass("toc-sections-searching")},250);$tocinput.on("keydown keyup keypress change",function(){txt=$tocinput.val().toLowerCase(),txt!==lastTxt&&(lastTxt=txt,$tocsections.addClass("toc-sections-searching"),filterSections())}),$("#toc-clear").on("click",function(){$tocinput.val("").trigger("change")}),loadCy(),$(document).on("click",".gallery-refresh",function(){var e=$(this).attr("data-embed-id"),t=document.getElementById(e);t.classList.remove("loaded"),t.src=t.src}),$(".gallery-embed").on("load",function(){$(this).addClass("loaded")}),$("body").on("mousedown click","#cy-refresh",function(){loadCy(),$("#cy").attr("style","")}),window.showCy=function(e){if($("#cy, #cy-hide, #cy-refresh, #cy-label").removeClass("hidden"),$("#cy-show").addClass("hidden"),e){var t=$("#cy-etc");t.removeClass("hidden").remove(),e.after(t)}cy.resize()},window.hideCy=function(){$("#cy, #cy-hide, #cy-refresh, #cy-label, #cy-etc").addClass("hidden"),$("#cy-show").removeClass("hidden")},$("#cy-hide").on("click",function(){hideCy()}),$("#cy-show").on("click",function(){showCy()}),$("#demo-source .expander").on("click",function(){$("#demo-source").removeClass("collapsed")}),$(document).on("click",".run.run-inline-code",function(){var $run=$(this),$pre=$(this).prevAll("pre:first");showCy($run);var text=$pre.text(),$title=$("#cy-title"),$content=$title.find(".content");$content.html(text),$title.show(),$content.hide().fadeIn(100).delay(250).hide(200,function(){var ret=eval(text),isEles=function(e){return null!=e&&null!=e.isNode};if(isEles(ret)&&ret.length>0){var css={"text-outline-color":"#4183C4","background-color":"#4183C4","line-color":"#4183C4","target-arrow-color":"#4183C4","source-arrow-color":"#4183C4"},delay=200;ret.stop(!0).animate({css:css}).delay(delay,function(){ret.removeCss()}).animate({css:css}).delay(delay,function(){ret.removeCss()}).animate({css:css}).delay(delay,function(){ret.removeCss(),$title.hide()})}})}),$("#download-button").on("click",function(){_gaq&&_gaq.push(["_trackEvent","Actions","Download"])})});