+
+ clearTimeout( mshotSecondTryTimer );
+ clearTimeout( mshotThirdTryTimer );
+
+ var thisHref = $.URLEncode( $( this ).attr( 'href' ) );
+
+ var mShot = $( '<div class="akismet-mshot mshot-container"><div class="mshot-arrow"></div><img src="//s0.wordpress.com/mshots/v1/' + thisHref + '?w=450" width="450" height="338" class="mshot-image" /></div>' );
+ mShot.data( 'link', this );
+
+ var offset = $( this ).offset();
+
+ mShot.offset( {
+ left : Math.min( $( window ).width() - 475, offset.left + $( this ).width() + 10 ), // Keep it on the screen if the link is near the edge of the window.
+ top: offset.top + ( $( this ).height() / 2 ) - 101 // 101 = top offset of the arrow plus the top border thickness
+ } );
+
+ mshotSecondTryTimer = setTimeout( function () {
+ mShot.find( '.mshot-image' ).attr( 'src', '//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=2' );
+ }, 6000 );
+
+ mshotThirdTryTimer = setTimeout( function () {
+ mShot.find( '.mshot-image' ).attr( 'src', '//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=3' );
+ }, 12000 );
+
+ $( 'body' ).append( mShot );
+ } ).mouseout( function () {
+ mshotRemovalTimer = setTimeout( function () {
+ clearTimeout( mshotSecondTryTimer );
+ clearTimeout( mshotThirdTryTimer );
+
+ $( '.akismet-mshot' ).remove();
+ }, 200 );
+ } );
+