﻿// custom easing
jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend(jQuery.easing,
	{
	    easeInQuad: function (x, t, b, c, d) {
	        return c * (t /= d) * t + b;
	    },
	    easeOutQuad: function (x, t, b, c, d) {
	        return -c * (t /= d) * (t - 2) + b;
	    }
	});

	
    // handle window resizing
	$(window).resize(function () {
	    setup();
	});

	function setup() {
        if ($('#popup').length != 0) {
            $('#popup')
                .css('height', $(window).height())
                .css('width', $(window).width());
            $('#popup .fade')
                .css('height', $(window).height())
                .css('width', $(window).width());
            $('#popup .content')
                .css('top', ($(window).height() - $('#popup .content').height()) / 2)
                .css('right', ($(window).width() - $('#popup .content').width()) / 2);
        }
	}

	function close() {
	    $('#popup').fadeOut(250, function () { $(this).remove() });
	}
