$(document).ready(function () {
	var $clients = $('#clients ul');
    var clientHeight = $clients.height();
    
	var $studio = $('#dropdown-nav ul#studio-tour');
	var studioHeight = $studio.height();
	
	var $video = $('#dropdown-nav ul#video');
	var videoHeight = $video.height();
	
	var $tv = $('#dropdown-nav ul#tv');
	var tvHeight = $tv.height();
	
	//$clients.hide().css({ height: 0 });
	$studio.hide().css({ height: 0});
	//$tv.hide().css({ height: 0});
	
    $('#dropdown-nav #video-dropdown').addClass('active');
	$('#dropdown-nav #clients-dropdown').addClass('active');
	$('#dropdown-nav #tv-dropdown').addClass('active');
	
    $('a.clients').click(function () {
		if ($clients.is(':visible')) {
			$('#clients-dropdown').removeClass('active');
            $clients.animate({ height: 0 }, { duration: 200, complete: function () {
                $clients.hide();
            } });
        } else {
			$('#clients-dropdown').addClass('active');
			$clients.show().animate({ height : clientHeight }, { duration: 200 });
        }
        
        return false;
    });
	
	$('a.studio').click(function () {
		if ($studio.is(':visible')) {
			$('#studio-dropdown').removeClass('active');
            $studio.animate({ height: 0 }, { duration: 200, complete: function () {
                $studio.hide();
            } });
        } else {
			$('#studio-dropdown').addClass('active');
			$studio.show().animate({ height : studioHeight }, { duration: 200 });
        }
        
        return false;
    });
	
	$('a.video').click(function () {
		if ($video.is(':visible')) {
			$('#dropdown-nav #video-dropdown').removeClass('active');
            $video.animate({ height: 0 }, { duration: 200, complete: function () {
                $video.hide();
            } });
        } else {
			$('#dropdown-nav #video-dropdown').addClass('active');
			$video.show().animate({ height : videoHeight }, { duration: 200 });
        }
        
        return false;
    });
	
	$('a.tv').click(function () {
		if ($tv.is(':visible')) {
			$('#dropdown-nav #tv-dropdown').removeClass('active');
            $tv.animate({ height: 0 }, { duration: 200, complete: function () {
                $tv.hide();
            } });
        } else {
			$('#dropdown-nav #tv-dropdown').addClass('active');
			$tv.show().animate({ height : tvHeight }, { duration: 200 });
        }
        
        return false;
    });
    
});
