$(document).ready(function() {

    //detect konqueror and change letter-spacing on heading 1-3
    //if (BrowserDetect.browser == "Konqueror") {
    //    //alert("This is Konqueror!");
    //    $('h1').css({
    //        'letter-spacing': '-11px',
    //        'margin-left': '-20px'
    //    });
    //    $('h2').css('letter-spacing', '-6px');
    //    $('h3').css('letter-spacing', '-4px');
    //}

    //stretch the padding to full width on header.body
    //I'll need to add a function to account for window resizing
    var bodypadding = $('body').width() - 960;
    bodypadding = bodypadding / 2;
    $('header.body').css({
        'padding-left': bodypadding,
        'padding-right': bodypadding
    });

    //make the aside the same height as the content section
    $('section.body>aside').css({height: $('section.body').height()});

    //hide the submenus
    $('#main-menu>ul>li>ul').hide();

    //if there's a submenu, put a triangle to indicate said submenu
    $('<span>&nbsp;▼</span>').appendTo('#main-menu>ul>li:has(ul)>a');

    // menu blob
    // todo: instead of putting the div on the FIRST menu item, instead put it on
    // the CURRENT menu item by default and on mouseout
    $('<div id="navigation_blob"></div>').css({ 
        width: $('#main-menu>ul>li:first>a').width() + 10, 
        height: $('#main-menu>ul>li:first>a').height() + 10,
        left: $('#main-menu>ul>li:first').position().left + 10,
        top: $('#main-menu>ul>li:first>a').position().top + 10
    }).appendTo('#main-menu>ul');
    //menu blob moving
    $('#main-menu>ul>li').hover(function() {
        //mouseover
        $('#navigation_blob').animate(
            {width: $(this).width() - 20, left: $(this).position().left + 10},
            {duration: '500', easing: 'swing', queue: false}
        );
        $(this).children("ul").fadeIn();
    }, function() {
        //mouseout
        $('#navigation_blob')
        .stop(true)
        .animate(
            {width: $('#main-menu>ul>li:first').width() - 20},
            {duration: '500', easing: 'swing', queue: false}
        )
        .animate(
            {left: $('#main-menu>ul>li:first').position().left + 10},
            {duration: '500'}
        );
        $(this).children("ul").fadeOut();
    });

    //home page slider
    $('#slider-code').tinycarousel({controls: false, pager: true, axis: 'y', interval: false});

});

