$( function() {$( '.content p img' ).each( function() {var img = $( this );var p = img.parent();p.before( img );p.remove();});$( '.content .text img:first-child' ).css( 'margin-top', '0' );$( '.content .amazlet-box img' ).css( 'margin', '0' );$( '.content .amazlet-box' ).css( 'margin', '3em 0 1.5em' );$( '.content p' ).not( '#comments p' ).wrapInner( $( '<span />' ) );var idmap = {};var colors = [ '#FF0000', '#0000FF' ];$( 'a' ).mouseover( function() {var anchor = $( this );var text = anchor.text();var strLen = text.length;var index = $( 'a' ).index( this );index = index.toString();if( idmap[ index ] ) {clearInterval( idmap[ index ].id );text = idmap[ index ].text;idmap[ index ] = undefined;}var ind = 0;var timer = 0;var s1 = '';var s2 = '';var s3 = '';var str = '';var id = setInterval( function() {if ( ind <= strLen) {s1 = "";s2 = text.substr( 0, ind );s3 = text.substr( ind );for (var i = 0; i <  strLen; i++) {s1 += String.fromCharCode(33+Math.round(Math.random()*90));}var intString  = s2 + s1;str = intString.substring( 0, strLen );anchor.text( str );if ( timer > 0) {ind++;timer = 0;} else {timer++;}} else {clearInterval( id );idmap[ index ] = undefined;}}, 20 );idmap[ index ] = { id:id, text:text };$( this ).css( 'color', colors[ Math.floor( Math.random() * colors.length ) ] );} );$( 'a' ).mouseout( function() {$( this ).css( 'color', '#555555' );} );$( '.nav-main' ).each( function() {var n = $( this ).find( '.title' );var t = n.text();n.text( '+ ' + t );var sub = $( this ).find( '.nav-sub' );var i = $( '.nav-main' ).index( $( this ) );var v = parseInt( $.cookie( "menu-" + i ) );if( v ) {n.text( '- ' + t );}else {sub.addClass( 'hidden' );n.text( '+ ' + t );}n.click( function() {sub.toggle( 300 );v = v ? 0 : 1;$.cookie( "menu-" + i, v, { expires: 7 } );if( v ) {n.text( '- ' + t );}else {n.text( '+ ' + t );}});sub.find( '.link a' ).each( function() {var t = $( this ).text();t = '> ' + t;$( this ).text( t );});sub.find( '.text' ).each( function() {var t = $( this ).text();t = '- ' + t;$( this ).text( t );});sub.find( '.sub a' ).each( function() {var t = $( this ).text();t = '/ ' + t;$( this ).text( t );});});var sep = [ '/', '-', '>' ];var sl = sep.length;$( 'hr' ).each( function() {var l = 75;var t = '';while( l -- ) {t += sep[ Math.floor( Math.random() * sl ) ];}var p = $( '<p class="end"/>' );p.text( t );$( this ).before( p );$( this ).remove();});$( '.content p.date').each( function() {var t = $( this ).text();t = '/ ' + t;$( this ).text( t );});$( '#comments .author' ).click( function() {var id = $( this ).attr( 'id' );$( '.' + id ).toggle( 200 );});});