﻿$(document).ready(function(){

    // initially hide all drop downs and show expand features
    $('.dropper').hide(); 
    $('#controls').show();
    

    // expand all functionality
    $('#showAll').click(function(){
        $('.dropper:hidden').show();
        $('.dropHeaderLeft').children().addClass('minus').removeClass('plus');
    })
    
    // hide all functionality
    $('#hideAll').click(function(){
        $('.dropper:visible').hide();
        $('.dropHeaderLeft').children().addClass('plus').removeClass('minus');
    })
    
    // add individual toggling
    $('.dropHeaderLeft').click(function(){
        $(this).siblings('.dropper').toggle();
        setClass($(this));
    })
    
    $('.volume').click(function(){
        $(this).siblings('.contactClick').fadeIn();
        return false;
    })
    
    $('.closer').click(function(){
        $(this).parent().fadeOut()
    })
    
    //$('#bannerRight a').hover(
    //    function(){showInfo($(this).attr('title'))},
    //    function(){hideInfo()}
    //    )
})

function setClass(box){
    if($(box).siblings('.dropper:visible').length == 1){
        $(box).children().addClass('minus').removeClass('plus')
    }
    else{
        $(box).children().addClass('plus').removeClass('minus')
    }
}

function showInfo(title){
    $('#message p').text(title);
    $('#message').stop().animate({
        opacity:    "show",
        bottom:     '75px'
    }, {queue: false, "easing": "easeOutBack"}, 500);
}

function hideInfo(){
    $('#message').animate({
        opacity:    'hide',
        bottom:     '45px'
    }, {queue: false},500);
    $('#message p').text("");
}