\begin{Verbatim}[commandchars=\\\{\}] \PY{k+kd}{var}\PY{+w}{ }\PY{n+nx}{each}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{p}{(}\PY{n+nx}{a}\PY{p}{,}\PY{n+nx}{c}\PY{p}{)}\PY{p}{=\PYZgt{}}\PY{+w}{ }\PY{n+nb}{Array}\PY{p}{.}\PY{n+nx}{prototype}\PY{p}{.}\PY{n+nx}{forEach}\PY{p}{.}\PY{n+nx}{call}\PY{p}{(}\PY{n+nx}{a}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{c}\PY{p}{)}\PY{p}{;} \PY{k+kd}{var}\PY{+w}{ }\PY{n+nx}{node}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{n+nx}{elem}\PY{+w}{ }\PY{p}{=\PYZgt{}}\PY{+w}{ }\PY{n+nx}{elem}\PY{+w}{ }\PY{o+ow}{instanceof}\PY{+w}{ }\PY{n+nb}{window}\PY{p}{.}\PY{n+nx}{\PYZdl{}}\PY{+w}{ }\PY{o}{?}\PY{+w}{ }\PY{n+nx}{elem}\PY{p}{[}\PY{l+m+mf}{0}\PY{p}{]}\PY{+w}{ }\PY{o}{:}\PY{+w}{ }\PY{n+nx}{elem}\PY{p}{;} \PY{k+kd}{var}\PY{+w}{ }\PY{n+nx}{smrm}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{n+nx}{elem}\PY{+w}{ }\PY{p}{=\PYZgt{}}\PY{+w}{ }\PY{n+nx}{getComputedStyle}\PY{p}{(}\PY{n+nx}{node}\PY{p}{(}\PY{n+nx}{elem}\PY{p}{)}\PY{p}{)}\PY{p}{.}\PY{n+nx}{animationName}\PY{o}{!==}\PY{l+s+s2}{\PYZdq{}none\PYZdq{}}\PY{o}{?}\PY{n+nx}{node}\PY{p}{(}\PY{n+nx}{elem}\PY{p}{)}\PY{p}{.}\PY{n+nx}{addEventListener}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}animationend\PYZsq{}}\PY{p}{,}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PY{+w}{ }\PY{o}{\PYZgt{}}\PY{+w}{ }\PY{n+nb}{window}\PY{p}{.}\PY{n+nx}{innerHeight}\PY{p}{)} \PY{+w}{ }\PY{p}{)}\PY{p}{;} \PY{p}{\PYZcb{}} \PY{k+kd}{var} \PY{+w}{ }\PY{n+nx}{popup}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{l+s+s1}{\PYZsq{}popup\PYZsq{}}\PY{p}{,} \PY{+w}{ }\PY{n+nx}{popupA}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{l+s+s1}{\PYZsq{}popupA\PYZsq{}}\PY{p}{,} \PY{+w}{ }\PY{n+nx}{popupF}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{l+s+s1}{\PYZsq{}popupF\PYZsq{}}\PY{p}{,} \PY{+w}{ }\PY{n+nx}{hilite}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{l+s+s1}{\PYZsq{}highlighted\PYZsq{}} \PY{p}{;} \PY{k+kd}{var}\PY{+w}{ }\PY{n+nx}{nav}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{n+nx}{setHighlight}\PY{o}{:}\PY{+w}{ }\PY{p}{(}\PY{c+cm}{/*HTMLElement | JQuery*/}\PY{+w}{ }\PY{n+nx}{post}\PY{p}{,}\PY{+w}{ }\PY{c+cm}{/*boolean*/}\PY{+w}{ }\PY{n+nx}{status}\PY{p}{)}\PY{+w}{ }\PY{p}{=\PYZgt{}}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{k}{switch}\PY{+w}{ }\PY{p}{(}\PY{n+nx}{status}\PY{p}{)}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{k}{case}\PY{+w}{ }\PY{k+kc}{true}\PY{o}{:} \PY{+w}{ }\PY{n+nx}{node}\PY{p}{(}\PY{n+nx}{post}\PY{p}{)}\PY{p}{.}\PY{n+nx}{classList}\PY{p}{.}\PY{n+nx}{add}\PY{p}{(}\PY{n+nx}{hilite}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{k}{break}\PY{p}{;} \PY{+w}{ }\PY{k}{case}\PY{+w}{ }\PY{k+kc}{false}\PY{o}{:} \PY{+w}{ }\PY{n+nx}{node}\PY{p}{(}\PY{n+nx}{post}\PY{p}{)}\PY{p}{.}\PY{n+nx}{classList}\PY{p}{.}\PY{n+nx}{remove}\PY{p}{(}\PY{n+nx}{hilite}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{k}{break}\PY{p}{;} \PY{+w}{ }\PY{k}{case}\PY{+w}{ }\PY{k+kc}{undefined}\PY{o}{:} \PY{+w}{ }\PY{n+nx}{node}\PY{p}{(}\PY{n+nx}{post}\PY{p}{)}\PY{p}{.}\PY{n+nx}{classList}\PY{p}{.}\PY{n+nx}{contains}\PY{p}{(}\PY{n+nx}{hilite}\PY{p}{)} \PY{+w}{ }\PY{o}{?}\PY{+w}{ }\PY{n+nx}{node}\PY{p}{(}\PY{n+nx}{post}\PY{p}{)}\PY{p}{.}\PY{n+nx}{classList}\PY{p}{.}\PY{n+nx}{add}\PY{p}{(}\PY{n+nx}{hilite}\PY{p}{)} \PY{+w}{ }\PY{o}{:}\PY{+w}{ }\PY{n+nx}{node}\PY{p}{(}\PY{n+nx}{post}\PY{p}{)}\PY{p}{.}\PY{n+nx}{classList}\PY{p}{.}\PY{n+nx}{add}\PY{p}{(}\PY{n+nx}{hilite}\PY{p}{)} \PY{+w}{ }\PY{p}{;} \PY{+w}{ }\PY{k}{break}\PY{p}{;} \PY{+w}{ }\PY{k}{default}\PY{o}{:} \PY{+w}{ }\PY{k}{break}\PY{p}{;} \PY{+w}{ }\PY{p}{\PYZcb{}} \PY{+w}{ }\PY{p}{\PYZcb{}}\PY{p}{,} \PY{+w}{ }\PY{n+nx}{clonePost}\PY{o}{:}\PY{+w}{ }\PY{p}{(}\PY{n+nx}{clonedPost}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{parent}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{rm}\PY{p}{)}\PY{+w}{ }\PY{p}{=\PYZgt{}}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{k}{switch}\PY{+w}{ }\PY{p}{(}\PY{n+nx}{rm}\PY{p}{)}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{k}{case}\PY{+w}{ }\PY{k+kc}{true}\PY{o}{:} \PY{+w}{ }\PY{k}{case}\PY{+w}{ }\PY{k+kc}{undefined}\PY{o}{:} \PY{+w}{ }\PY{n+nx}{clonedPost}\PY{p}{.}\PY{n+nx}{attr}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}id\PYZsq{}}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{clonedPost}\PY{p}{.}\PY{n+nx}{attr}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}id\PYZsq{}}\PY{p}{)}\PY{o}{+}\PY{l+s+s1}{\PYZsq{}\PYZus{}copy\PYZsq{}}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{clonedPost}\PY{p}{.}\PY{n+nx}{addClass}\PY{p}{(}\PY{n+nx}{popup}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{clonedPost}\PY{p}{.}\PY{n+nx}{addClass}\PY{p}{(}\PY{n+nx}{popupA}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{getComputedStyle}\PY{p}{(}\PY{n+nx}{node}\PY{p}{(}\PY{n+nx}{clonedPost}\PY{p}{)}\PY{p}{)}\PY{p}{.}\PY{n+nx}{animationName}\PY{+w}{ }\PY{o}{!=}\PY{+w}{ }\PY{l+s+s1}{\PYZsq{}none\PYZsq{}} \PY{+w}{ }\PY{o}{?}\PY{+w}{ }\PY{n+nx}{clonedPost}\PY{p}{.}\PY{n+nx}{on}\PY{p}{(}\PY{+w}{ }\PY{l+s+s1}{\PYZsq{}animationend\PYZsq{}}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{e}\PY{+w}{ }\PY{p}{=\PYZgt{}}\PY{+w}{ }\PY{n+nx}{e}\PY{p}{.}\PY{n+nx}{target}\PY{p}{.}\PY{n+nx}{classList}\PY{p}{.}\PY{n+nx}{remove}\PY{p}{(}\PY{n+nx}{popupA}\PY{p}{)}\PY{+w}{ }\PY{p}{)} \PY{+w}{ }\PY{o}{:}\PY{+w}{ }\PY{n+nx}{clonedPost}\PY{p}{.}\PY{n+nx}{removeClass}\PY{p}{(}\PY{n+nx}{popupA}\PY{p}{)} \PY{+w}{ }\PY{p}{;} \PY{+w}{ }\PY{n+nx}{parent}\PY{p}{.}\PY{n+nx}{append}\PY{p}{(}\PY{n+nx}{clonedPost}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{k}{break}\PY{p}{;} \PY{+w}{ }\PY{k}{case}\PY{+w}{ }\PY{k+kc}{false}\PY{o}{:} \PY{+w}{ }\PY{n+nx}{clonedPost}\PY{p}{.}\PY{n+nx}{addClass}\PY{p}{(}\PY{n+nx}{popupF}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{smrm}\PY{p}{(}\PY{n+nx}{clonedPost}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{k}{break}\PY{p}{;} \PY{+w}{ }\PY{k}{default}\PY{o}{:} \PY{+w}{ }\PY{k}{break}\PY{p}{;} \PY{+w}{ }\PY{p}{\PYZcb{}} \PY{+w}{ }\PY{k}{return}\PY{+w}{ }\PY{n+nx}{clonedPost}\PY{p}{;} \PY{+w}{ }\PY{p}{\PYZcb{}}\PY{p}{,} \PY{p}{\PYZcb{}} \PY{k+kd}{function}\PY{+w}{ }\PY{n+nx}{enableFastNavigation}\PY{p}{(}\PY{p}{)}\PY{+w}{ }\PY{p}{\PYZob{}}\PY{+w}{ }\PY{c+c1}{// Highlights and popups} \PY{+w}{ }\PY{k+kd}{function}\PY{+w}{ }\PY{n+nx}{highlightOnLinkEnter}\PY{p}{(}\PY{c+cm}{/*JQuery*/}\PY{+w}{ }\PY{n+nx}{post}\PY{p}{,}\PY{+w}{ }\PY{c+cm}{/*JQuery*/}\PY{+w}{ }\PY{n+nx}{link}\PY{p}{)}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{n+nx}{nav}\PY{p}{.}\PY{n+nx}{setHighlight}\PY{p}{(}\PY{n+nx}{post}\PY{p}{,}\PY{+w}{ }\PY{k+kc}{true}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{link}\PY{p}{.}\PY{n+nx}{on}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}mouseleave\PYZsq{}}\PY{p}{,}\PY{+w}{ }\PY{k+kd}{function}\PY{+w}{ }\PY{n+nx}{mouseLeave}\PY{p}{(}\PY{p}{)}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{n+nx}{nav}\PY{p}{.}\PY{n+nx}{setHighlight}\PY{p}{(}\PY{n+nx}{post}\PY{p}{,}\PY{+w}{ }\PY{k+kc}{false}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{link}\PY{p}{.}\PY{n+nx}{off}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}mouseleave\PYZsq{}}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{mouseLeave}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{p}{\PYZcb{}}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{p}{\PYZcb{}} \PY{+w}{ }\PY{k+kd}{function}\PY{+w}{ }\PY{n+nx}{popup}\PY{p}{(}\PY{c+cm}{/*JQuery*/}\PY{+w}{ }\PY{n+nx}{clonedPost}\PY{p}{,}\PY{+w}{ }\PY{c+cm}{/*JQuery*/}\PY{+w}{ }\PY{n+nx}{link}\PY{p}{)}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{k+kd}{var}\PY{+w}{ }\PY{n+nx}{popupDeletionTimer}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{k+kc}{null}\PY{p}{;} \PY{+w}{ }\PY{k+kd}{var}\PY{+w}{ }\PY{n+nx}{parentPost}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{n+nx}{link}\PY{p}{.}\PY{n+nx}{parent}\PY{p}{(}\PY{p}{)}\PY{p}{.}\PY{n+nx}{parent}\PY{p}{(}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{c+cm}{/* Callbacks} \PY{c+cm}{ * W: Each one assumes that clonedPost and link are valid JQuery objects.*/} \PY{+w}{ }\PY{k+kd}{const}\PY{+w}{ }\PY{n+nx}{cbs}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{n+nx}{\PYZus{}initiateCountdown}\PY{o}{:}\PY{+w}{ }\PY{p}{(}\PY{p}{)}\PY{+w}{ }\PY{p}{=\PYZgt{}}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{n+nx}{popupDeletionTimer}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{n+nx}{setTimeout}\PY{p}{(}\PY{+w}{ }\PY{p}{(}\PY{p}{)}\PY{+w}{ }\PY{p}{=\PYZgt{}}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{n+nx}{nav}\PY{p}{.}\PY{n+nx}{clonePost}\PY{p}{(}\PY{n+nx}{clonedPost}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{parentPost}\PY{p}{,}\PY{+w}{ }\PY{k+kc}{false}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{link}\PY{p}{.}\PY{n+nx}{removeAttr}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}locked\PYZsq{}}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{p}{\PYZcb{}}\PY{p}{,}\PY{+w}{ }\PY{l+m+mf}{1000}\PY{+w}{ }\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{p}{\PYZcb{}}\PY{p}{,} \PY{+w}{ }\PY{c+cm}{/* Postlink mouseleave callback. */} \PY{+w}{ }\PY{n+nx}{linkLeave}\PY{o}{:}\PY{+w}{ }\PY{k+kd}{function}\PY{+w}{ }\PY{n+nx}{linkLeave}\PY{p}{(}\PY{n+nx}{e}\PY{p}{)}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{n+nx}{cbs}\PY{p}{.}\PY{n+nx}{\PYZus{}initiateCountdown}\PY{p}{(}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{clonedPost}\PY{p}{.}\PY{n+nx}{on}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}mouseenter\PYZsq{}}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{cbs}\PY{p}{.}\PY{n+nx}{popupEnter}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{link}\PY{p}{.}\PY{n+nx}{off}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}mouseleave\PYZsq{}}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{p}{\PYZcb{}}\PY{p}{,} \PY{+w}{ }\PY{c+cm}{/* Fires when cursor leaves a popup. */} \PY{+w}{ }\PY{n+nx}{popupLeave}\PY{o}{:}\PY{+w}{ }\PY{k+kd}{function}\PY{+w}{ }\PY{n+nx}{postLeave}\PY{p}{(}\PY{p}{)}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{n+nx}{cbs}\PY{p}{.}\PY{n+nx}{\PYZus{}initiateCountdown}\PY{p}{(}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{clonedPost}\PY{p}{.}\PY{n+nx}{on}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}mouseenter\PYZsq{}}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{cbs}\PY{p}{.}\PY{n+nx}{popupEnter}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{p}{\PYZcb{}}\PY{p}{,} \PY{+w}{ }\PY{c+cm}{/* Fires if cursor returns onto a popup before postDeletionTimer\PYZsq{}s time is up.} \PY{c+cm}{ Otherwise popup will be removed from document. */} \PY{+w}{ }\PY{n+nx}{popupEnter}\PY{o}{:}\PY{+w}{ }\PY{k+kd}{function}\PY{+w}{ }\PY{n+nx}{postEnter}\PY{p}{(}\PY{p}{)}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{n+nx}{clearTimeout}\PY{p}{(}\PY{n+nx}{popupDeletionTimer}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{postDeletionTimer}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{k+kc}{null}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{clonedPost}\PY{p}{.}\PY{n+nx}{off}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}mouseenter\PYZsq{}}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{popupEnter}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{p}{\PYZcb{}} \PY{+w}{ }\PY{p}{\PYZcb{}}\PY{p}{;} \PY{+w}{ }\PY{k}{if}\PY{+w}{ }\PY{p}{(}\PY{n+nx}{link}\PY{p}{.}\PY{n+nx}{attr}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}locked\PYZsq{}}\PY{p}{)}\PY{p}{)}\PY{+w}{ }\PY{k}{return}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{link}\PY{p}{.}\PY{n+nx}{attr}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}locked\PYZsq{}}\PY{p}{,}\PY{+w}{ }\PY{k+kc}{true}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{nav}\PY{p}{.}\PY{n+nx}{clonePost}\PY{p}{(}\PY{n+nx}{clonedPost}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{parentPost}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{k+kd}{let}\P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{(}\PY{+w}{ }\PY{n+nx}{beyond}\PY{p}{(}\PY{n+nx}{node}\PY{p}{(}\PY{n+nx}{post}\PY{p}{)}\PY{p}{)}\PY{+w}{ }\PY{p}{)}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{k+kd}{let}\PY{+w}{ }\PY{n+nx}{\PYZus{}embed}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{n+nx}{node}\PY{p}{(}\PY{n+nx}{post}\PY{p}{)}\PY{p}{.}\PY{n+nx}{cloneNode}\PY{p}{(}\PY{k+kc}{true}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{each}\PY{p}{(}\PY{n+nx}{\PYZus{}embed}\PY{p}{.}\PY{n+nx}{children}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{item}\PY{+w}{ }\PY{p}{=\PYZgt{}}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{k}{if}\PY{+w}{ }\PY{p}{(}\PY{n+nx}{item}\PY{p}{.}\PY{n+nx}{classList}\PY{p}{.}\PY{n+nx}{contains}\PY{p}{(}\PY{n+nx}{popup}\PY{p}{)}\PY{p}{)}\PY{+w}{ }\PY{n+nx}{item}\PY{p}{.}\PY{n+nx}{remove}\PY{p}{(}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{p}{\PYZcb{}}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{n+nx}{popup}\PY{p}{(}\PY{n+nx}{\PYZdl{}}\PY{p}{(}\PY{n+nx}{\PYZus{}embed}\PY{p}{)}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{link}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{p}{\PYZcb{}}\PY{+w}{ }\PY{k}{else}\PY{+w}{ }\PY{p}{\PYZob{}} \PY{+w}{ }\PY{n+nx}{highlightOnLinkEnter}\PY{p}{(}\PY{n+nx}{post}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{link}\PY{p}{)}\PY{p}{;} \PY{+w}{ }\PY{p}{\PYZcb{}} \PY{+w}{ }\PY{p}{\PYZcb{}} \PY{+w}{ }\PY{p}{\PYZcb{}} \PY{+w}{ }\PY{n+nx}{\PYZdl{}}\PY{p}{(}\PY{n+nb}{document}\PY{p}{)}\PY{p}{.}\PY{n+nx}{on}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}mouseenter\PYZsq{}}\PY{p}{,}\PY{+w}{ }\PY{l+s+s1}{\PYZsq{}.message a[href*=\PYZdq{}res\PYZdq{}]\PYZsq{}}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{show}\PY{p}{)}\PY{p}{;} \PY{p}{\PYZcb{}} \PY{n+nb}{document}\PY{p}{.}\PY{n+nx}{addEventListener}\PY{p}{(}\PY{l+s+s1}{\PYZsq{}DOMContentLoaded\PYZsq{}}\PY{p}{,}\PY{+w}{ }\PY{n+nx}{enableFastNavigation}\PY{p}{)}\PY{p}{;} \end{Verbatim}