(function($) {

var ie6 = $.browser.msie && $.browser.version=='6.0';
var ie7 = $.browser.msie && $.browser.version=='7.0';

$(function() {
    var $nav = $('#nav');
    (ie6 || ie7) && $nav.find('li').hover(function() {
                $(this).addClass('hover');
            }, function() {
                $(this).removeClass('hover');
            }).end()
            .find('a img').each(function() {
                var $this = $(this);
                $this.width($this.closest('li').width());
            }).end()
            .find('li.current a img').show();
});

$(function() {
    $('.post .entry img:not(.nocover)').each(function() {
        var $this = $(this);
        $this.wrap('<div class="img-cover ' +$this.attr('class')+ '" style="' +$this.attr('style')+ '"></div>');
        $this.attr('class','');
        setTimeout(function() {
            $this.closest('.img-cover')
                 .append('<span class="cover-lt"></span><span class="cover-rb"></span>')
                 .height($this.height())
                 .width($this.width());
        }, 10);
    }).load(function() {
        var $this = $(this);
        $this.closest('.img-cover').height($this.height()).width($this.width());
    });
});

})(jQuery);