jQuery(function($) {

// iphone config
if (typeof window.orientation != 'undefined') {
    window.scrollTo(0, 1); // scroll past url bar
}

    
// add documentation expand/collapse

$('#setUpDocs').each(function() {

    $('.post h3').each(function(){
       if ($(this).html().match(/Variables|Methods/))
         $(this).html('<span class="right small"><a class="expand_all" href="#">expand</a>/<a class="collapse_all" href="#">collapse</a></span>'
            + $(this).html());
    });

    $('.post h4').click(function() {
        $(this).next().slideToggle('fast');
        return false;
    }).next().hide();

    // re-order H3 and H4 tags so that they can be auto-formatted.

    $('a.expand_all').click(function() { 
        $(this).parent().parent().next().slideDown('fast').find('h4').each(function() {$(this).next().slideDown('fast');});
        return false;
    });
    $('a.collapse_all').click(function() {
        $(this).parent().parent().next().find('h4').each(function() {$(this).next().slideUp('fast');});
        return false;
    });

});

// add link highlighting

$('a').hover(contentIn, contentOut);
//$('.current_page_item').hover(contentOut, contentIn).stop().animate({'color':'#ff6'},600);
$('.current_page_item').hover();

function contentIn () { $(this).stop().animate({'color':'#eee'},5).animate({'color':'#ff6'},600); }
function contentOut () { $(this).stop().animate({'color':'#c33'},600); }

});


