﻿// Dropdown menu function -- hang on to this one
function toggleDropdown(name) {
 var arrow = '#' + name + 'Arrow';
 var menu = '#' + name + 'Menu';
 
 if ($(arrow).attr('src') == '/images/dropdown_darr.png') {
    $(menu).slideUp('normal');
    $('.dropdown-arrow').attr('src', '/images/dropdown_rarr.png');
 } else {
    $('.dropdown-arrow').attr('src', '/images/dropdown_rarr.png');
    $(arrow).attr('src', '/images/dropdown_darr.png');
    $('.dropdown-menu:visible').slideUp('normal');
    $(menu).slideDown('normal');
 }
}

jQuery(document).ready(function() {
    try {
        // Pad the subcontent area a little
        $('.subcontent').css('min-height', $('.subcontent').height() + 100);
        // Make #main and .dropdown-container end at the same Y
        var diff = $('.dropdown').offset().top - $('#main').offset().top; // calculate the difference in starting positions
        var height = Math.max($('.dropdown-container').height(), $('#main').height() - diff);
        $('.dropdown-container').css('min-height', height + 'px');
        $('#main').css('min-height', (height + diff) + 'px');
    } catch (e) { }
});
