// prevent flickering background images in IE6
try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}


$(document).ready(function() {

    // sitenav dropdown menus
    $('#sitenav > li').hover(function() {
        $('.menu', this).show();
    }, function() {
        $('.menu', this).hide();
    });
    $('#sitenav a.menu-title[href=#]').click(function() {
        return false;
    });
    
    // expandables
    $('.expandable .expandable-opener').click(function() {
        $(this).parent().toggleClass('active');
        $(this).nextAll('.expandable-content').toggle();
        return false;
    });
	if (window.location.hash.search(/#.+/) != -1) {
		var $expandable = $('.expandable' + window.location.hash);
		$expandable.addClass('active');
		$('.expandable-content', $expandable).show();
	}
	
	// open student budget calculator in popup window
	$('a.student-budget-calculator').click(function() {
		window.open(this.href, 'bsl_student_budget_calculator', 'toolbar=no,location=no,scrollbars=yes,directories=no,width=973,height=660');
		return false;
	});

});