function setUpTBPopups () {
    // pop up setup
    $('div#hiddenInfo').addClass('hidden');

    $('a.thickbox').each(
        function () {
            var targetID = $(this).attr('href').substr(1);
            $(this).attr('href', 'TB_inline?inlineId=' + targetID +'&width=620');
        }
    );
}

$(document).ready(function() {

    // apply behaviour to signup welcome page
    if ($('#pageIdentifier').hasClass('signupWelcomePage') || $('#pageIdentifier').hasClass('signupPendingPage')) {

        // set up popups
        setUpTBPopups();

        // hide menu
        $('div#dContentL').hide();

        // hide more info
        $('div#moreInfo div.moreInfo').hide();

        // upgrade show span to a link
        $('div#moreInfo span.moreInfo').replaceWith('<a href="#" class="moreInfo">' + $('div#moreInfo span.moreInfo').html() + '</a>');

        // show/hide more info
        $('div#moreInfo a.moreInfo').click(

            function () {
                $('div#moreInfo div.moreInfo').toggle();
                return false;
            }

        );

        // enhance print feature
        var html = $('p.printPage span').html();
        var reg_exp = /<!--(.*)-->/;

        if (match_array = reg_exp.exec(html)) {

            if (match_array.length) {
                $('p.printPage span').html(match_array[1]);
            }

        }

        // enable print feature
        $('a.printPage').click(

            function () {
                $('div#moreInfo div.moreInfo').show();
                window.print();
                return false;
            }

        );

    }

});