/**
 *
 */

$(document).ready(function()
{

    $('#nav ul').lavaLamp();

    $('a[rel="external"]').attr('target', '_blank');

    $("#social li a").each(function()
    {
        var thisTitle = $(this).attr('title');
        $(this).css({ backgroundImage:'none' }).after('<span id="' + thisTitle + '">&nbsp;</span>');
    }).hover(function()
    {
        $(this).parent('li').children('span').stop().animate({opacity:0}, 'slow');
    }, function()
    {
        $(this).parent('li').children('span').stop().animate({opacity:1}, 'slow');
    });

    $('.theCategory').hover(function()
    {
        $(this).stop().animate({width:'45px'});
    }, function()
    {
        $(this).stop().animate({width:'15px'});
    });

    $('#catCloud ul li a').hover(function()
    {
        $(this).stop().animate({height:'35px'});
        $('#catCloud p').text($(this).attr('title'));
    }, function()
    {
        $(this).stop().animate({height:'23px'});
        $('#catCloud p').html('&nbsp;');
    });
    
    if ($('.object').length) {
        $('.object a').wbBoxText();
    }

    $('li.menu a').click(function(event)
    {
        event.preventDefault();
        var thisHref = $(this);
        thisHref = thisHref[0].hash.substr(1);
        $('div.object:not(.' + thisHref + ')').animate({width: 'hide', opacity: 0, marginRight: '0'}, 1000);
        $('div.object.' + thisHref).animate({width: 'show', opacity: 1, marginRight: '30px'}, 1000);
    });

        $('#slider').wbRotate({shortName:'headers'});

});

