var UI;

$(function(){

    $("#hp_dynamicContent .contentBlock").css({display:'none'});
    $("#hp_dynamicContent").css({top:'410px'});
    
    UI = {
        dynamicView : $('#hp_interactiveContent'),
        logoBar : $("#hp_logoBar"),
        contentForFlash : {
            icon1 : $("#dynamicContent_1"),
            icon2 : $("#dynamicContent_2"),
            icon3 : $("#dynamicContent_3"),
            icon4 : $("#dynamicContent_4"),
            icon5 : $("#dynamicContent_5"),
            icon6 : $("#dynamicContent_6"),
            icon7 : $("#dynamicContent_7"),
            contentCloseButton : null
        }
    }
    
    flashAnimationItemClicked(false);
    
});

function flashAnimationItemClicked(senderId){
    
    var heightCollapsed = 71;
    var heightExpanded = 335;
    
    $("#hp_dynamicContent").animate({top:((heightExpanded + 10) + 'px')}, 200, function(){
        $("#hp_dynamicContent .contentBlock").css({display:'none'});
        
        if(!UI.contentForFlash[senderId]){
            
            UI.logoBar.fadeIn(300);
            UI.dynamicView.animate({height:(heightCollapsed + 'px')}, 200);
            
        } else {
            
            UI.contentForFlash[senderId].css({display:'block'});
            UI.logoBar.fadeOut(300);
            UI.dynamicView.animate({height:(heightExpanded + 'px')}, 200, function(){
                $("#hp_dynamicContent").animate({top:('0px')}, 200);
                
            });
        }
    
    });
    
    
}