//Mini gallery 0.0.1
(function ($) {
    $.fn.mini_gallery=function(){
        img=$(this).find('.image img');
        ul=$(this).find('.links ul');
        height=$(this).height();
        
        $(this).find('.image').css({'float':'left'});
        $(this).find('.links').css({'overflow': 'hidden'}).height(height);
        $(this).find('ul').css({'list-style':'none'});
        $(this).find('li').css({'display':'block', 'float': 'left'});
        $(this).find('a').css({'display':'block', 'float': 'left'});
        $(this).find('a:first').addClass('hover');
        $(this).find('a img').css({'display':'block', 'float': 'left'});
        $(this).find('a').click(function(){
            $(this).parent().parent().find('a').removeClass('hover');
            $(this).addClass('hover');
            temp=img.clone().css({'position': 'absolute'});
            img.before(temp);
            img.attr('src', $(this).attr('href'));
            temp.hide(1000);
            pos=this.offsetTop;
            old=-parseInt(ul.css('margin-top'));
            n=old+pos-height/2;
            if(n<0) n=0;
            ul.animate({
                'margin-top': -n+'px'
                });
            return false;
        });
        $(this).find('.links').mousemove(function(e){
            
        });
    }
})(jQuery);
