$(function() {
    
    $('.add').click(function(){
        $('#ListMagic').slideDown("slow",function(){
            $('#ListMagic').css('display','block');    
        });
        $('.exit').css('display','block');
        $('.exit').animate({opacity: '1'},{duration: 700});
        $('.add').css('display','none');
        $('.add').animate({opacity: '0'},{duration: 700});
    });
    
    $('.exit').click(function(){
        $('#ListMagic').slideUp("slow",function(){
            $('#ListMagic').css('display','none')
        });
        $('.exit').css('display','none');
        $('.exit').animate({opacity: '0'},{duration: 700});
        $('.add').css('display','block');
        $('.add').animate({opacity: '1'},{duration: 700});
    });
    
	$('#TableLink a').click(function() {
	     if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
	             var $target = $(this.hash);
	             $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
	             if ($target.length) {
	                 var targetOffset = $target.offset().top-15;
	                 $('html,body').animate({scrollTop: targetOffset}, 1000);
	                 return false;
	            }
	       }
	});
	$('#ListMagic a').click(function() {
	     if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
	             var $target = $(this.hash);
	             $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
	             if ($target.length) {
	                 var targetOffset = $target.offset().top-15;
	                 $('html,body').animate({scrollTop: targetOffset}, 1000);
	                 return false;
	            }
	       }
	});

});