Cufon.set('fontFamily', 'tuscan');
Cufon.replace('.cufon').replace('#header h1,#header h3,#blogroll > h1,#content > h2,#sidebar .block > h2');

$().ready(function(){
    $('ul.sf-menu').superfish({
        delay:300
    });
    $('li.drop-menu-one li a').last().css('border-bottom-style','none');
    $('li.drop-menu-two li a').last().css('border-bottom-style','none');
    $('.tooltip a,.album img').tooltip({
        track:true,
        delay: 0,
        fade:250 ,
        showURL :false,
        bodyHandler: function() {
            return $(this).attr("alt");
        }
    });
    bindTrending();

    function bindTrending(){
        //$('.trending .listings:gt(0)').hide();
        $('.trending .header a').click(function(){
            var index = $('.trending .header a').index($(this));
            $('.trending .header a').not($(this)).removeClass('active');
            $(this).addClass('active');
            $.get(blogurl + '/?act=ajax&most_type=' + index);
            if (index == 0) {
                $('.trending .dsq-widget-list').hide();
                $('.trending .listings').show();
            }
            else {
                $('.trending .listings').hide();
                $('.trending .dsq-widget-list').show();
            }
            return false;
        });
    }

    $("span.dsq-widget-comment").append('"');
    $("span.dsq-widget-comment").prepend('"');
    $(".dsq-widget-user").each(function() {
        var author = $(this).text();
        $(this).replaceWith(author);
    });
    $('#searchform input[type=text]').each(function(){
        $(this).data('default', $(this).val());
    })
    .bind('focus',function(){
        $(this).val('');
    })
    .bind('blur',function(){
        if($(this).val() == '')$(this).val($(this).data('default'));
    });

    $('.external').attr('target', 'blank');
    $("a.fancybox").fancybox();
});
