
jQuery(document).ready( function() {

    fix_special_column();

} );

jQuery(window).bind('resize', function() { fix_special_column(); } );

function fix_special_column() {

    var height = jQuery('div#container').height() - 350;

    if (height > jQuery('special_column').height()) {
        jQuery('.special_column').height( height ).show();
    }

}


function change_tip( direction ) {

    if (!direction) { direction='next'; }

    var matches_1 = jQuery('#tip').html().match(/Tip #\d+/);
    var matches_2 = matches_1[0].match(/\d+/);
    var current_tip = matches_2[0];

    jQuery.get("/change-tip", { current_tip: current_tip, direction: direction }, function(data) {
        jQuery('#tip').html(data);
    } );

}
