$(document).ready(function(){

    //Cufon Custom Fonts (Eurostile)
    //Cufon.Replace('h1');

    $(this).find('a.toggleSlide').each(function(){
        var $div = $('#controlPanelContainer');
        var height = $div.height();
//        alert(height);
        $div.hide().css({ height : 0 });
        $(this).click(function () {
            if ( $div.is(':visible') ) {
            $div.animate(   { height: 0 },
                            { 
                                duration: 250, complete: function ()
                                { $div.hide(); }
                            
                        });
            } else {
                $div.show().animate({ height : height }, { duration: 250 });
            }
        });
    });

//    var $div = $('#test');
//    var height = $div.height();
//    $div.hide().css({ height : 0 });
//
//    $('a').click(function () {
//      if ( $div.is(':visible') ) {
//        $div.animate({ height: 0 }, { duration: 2500, complete: function () {
//            $div.hide();
//          }
//        });
//      } else {
//        $div.show().animate({ height : height }, { duration: 2500 });
//      }
//
//      return false;
//    });

});
