// App Box Click and Replace Thumb/Text code
$(document).ready(function(){
    $('.fpTextBox').hide();
    $('#impactInventing').fadeIn(1000);
    $('.appRowTop, .appRowLeft').hover(function(event){
        event.preventDefault();
        var newPic = $(this).attr('id');
        if(newPic != 'applicationHeaderThumb') {
            var oldPic = $('.picHover').attr('id'),
                    newText = newPic.substr(0,newPic.length - 5),
                    oldText = oldPic.substr(0,oldPic.length - 5);
            $('#' + oldText).hide();
            $('#' + oldPic).removeClass('picHover');
            $('#' + newPic).addClass('picHover');
            $('#' + newText).show();
        }
    });
    $('.appRowTop, .appRowLeft').click(function(){
        var newPic = $(this).attr('id');
        if(newPic != 'applicationHeaderThumb') {
            var oldPic = $('.picHover').attr('id'),
            newText = newPic.substr(0,newPic.length - 5),
            oldText = oldPic.substr(0,oldPic.length - 5);
            $('#' + oldText).hide();
            $('#' + oldPic).removeClass('picHover');
            $('#' + newPic).addClass('picHover');
            $('#' + newText).show();
        }
    });
    //$('#applicationHeaderThumb').removeClass('thumbPointer');
    // get Applications page var located only on Applications.php: line 13
    var whichApp = $('#appSwitch').attr('rel');
    if (whichApp) {
       $('.fpTextBox').hide();
       $('#impactInventingThumb').removeClass('picHover');
       $('#' + whichApp + 'Thumb').addClass('picHover');
       $('#' + whichApp).fadeIn(1000);
       //$('.appRowTop, .appRowLeft').removeClass('thumbPointer');
       $('#applicationHeaderThumb').addClass('thumbPointer').click(function(){
           window.location = "/";
       })
    }
});
