Cufon // initialize cufon.
    .now()
    .replace('h2', {
        fontFamily: 'DINPro-Bold'
    });

jQuery(document).ready(function($) {
    $('#fade div.post_content').show();

    $('ul.topnav li a#m5-active').hover(function() {
        $(this).addClass('subhover').parent().find('ul.subnav').slideDown('fast').show();

        $(this).parent().hover(function() {}, function(){
            $(this).parent().find('ul.subnav').slideUp('slow');
        });
    }, function() {
        $(this).removeClass('subhover');
    });

    $('#mycarousel').jcarousel({
        auto: 5,
        animation: 500,
        wrap: 'last',
        scroll: 1,
        initCallback: function(carousel) {
            var $carousel, $fade, i, $indicator, l, stop, t;
            $carousel = $('#mycarousel');
            $fade = $('#fade');
            stop = $carousel.find('li').length;
            l = Math.round($fade.offset().left + 5);
            t = Math.round($fade.offset().top + 5);

            $indicator = $('<ul></ul>')
                .attr('id', 'indicator')
                .css({
                    top: t,
                    left: l
                });

            for (i = 0; i < stop; i += 1) {
                $indicator
                    .append(
                        $('<li></li>')
                    );

                if (i < 1) {
                    $indicator
                        .find('li:first')
                        .addClass('active');
                }
            }

            $('#fade').after($indicator);
        },
        itemVisibleInCallback: function(carousel, item, idx, state) {
            var c, $indicator, $li, i, stop;
            $indicator = $('#indicator');
            $li = $indicator.find('li');
            stop = $li.length;
            c = parseInt($(item).attr('jcarouselindex'), 10) - 1;

            if (c === 0) {
            $li
                .eq(stop - 1)
                .removeClass('active');
            }

            $li
                .eq(c)
                .addClass('active')
                .prev('li')
                .removeClass('active');
        }
    });

    $('#register_039d2').jRegister({
        height: 101,
        width: 453
    });

    $('input#s').focus(function () {
        var data = $(this).data('v');

        if (typeof data === 'undefined') {
            data = $(this).val();
            $(this).data('v', data);
        }

        if ($(this).val() === data) {
            $(this).val('');
        }
    }).blur(function () {
        var data = $(this).data('v');

        if (!$(this).val()) {
            $(this).val(data);
        }
    });
});