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&windowed=true');
        }
    );
}
    var imageSwap = {};
    $(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;
            }

        );

    }

     if( $('#ConfirmForm') ){
        $('#ConfirmForm').submit(function(){
            $('#submit').attr('disabled', 'disabled');
        });
     }
    if ($('ul.imageSwap').length > 0) {
        imageSwap.swapImages = function () {
            var active = $('ul.imageSwap li.active');
            var next = $(active).next('li').length;
            (next < 1) ? next = $('ul.imageSwap li:first') : next = $(active).next('li');
            $(active).removeClass('active');
            $(next).addClass('active');
        }
        var int = setInterval("imageSwap.swapImages()", 12000);
     }

});
