
var animated = true
var tm
var corner_time_delay = 7000


function CornerAnimation() {

    if (animated == true) {

    $(".top-left-corner").animate(

        {width: '57px', height: '60px'}, 
        500, 
        function() {
            $(".top-left-corner").animate({width: '45px', height: '49px'}, 500)
        }
    );
    }
    tm = setTimeout('CornerAnimation();', corner_time_delay);
}


	$(document).ready(function(){
		    $('.popup').hover(
            function() {
                $(this).addClass('hovered');
                $(this).show();
            },
            function() {
                $(this).removeClass('hovered');
                $(this).hide();
            }
        )

    $('#popup-link').hover(
        function() {

            $('.popup').show();
            //$('.popup').addClass('hovered')

            animated = false
            clearTimeout(tm)
        },

        function() {
            if ($('.popup').hasClass('hovered')!= 'true') {    
                $('.popup').hide();
            }
        }
    )


		CornerAnimation();
	});
