(function($) {
// easing
$.extend($.easing, {
	bounceout: function(p, n, firstNum, delta, duration) {
		if ((n/=duration) < (1/2.75)) {
			return delta*(7.5625*n*n) + firstNum;
		} else if (n < (2/2.75)) {
			return delta*(7.5625*(n-=(1.5/2.75))*n + .75) + firstNum;
		} else if (n < (2.5/2.75)) {
			return delta*(7.5625*(n-=(2.25/2.75))*n + .9375) + firstNum;
		} else {
			return delta*(7.5625*(n-=(2.625/2.75))*n + .984375) + firstNum;
		}
	}
});

})(jQuery);

/* 春节滑动图片 */
var timerHideSpring = null;
$(function() {
    $('body').append(
        $(
            "<div id='spring_pic' style='margin:0px auto;display:block;width:960px;height:0px;position:absolute;left:0px;top:0px;z-index:999;display:none;'>" +
            "<img src='module/index/templates/default/new_images/spring01.jpg' usemap='#spring_map'/>" +
            "<map name='spring_map' id='spring_map'>" + 
            "<area shape='circle' coords='935,25,15' href='#' onclick='hideSpring();return false;'/>" +
            "</map>" +
            "</div>"
        )
    );
    
    $('#spring_pic').css(
        {
            'left' : (screen.width - 960) / 2 - 10,
            'top' : (screen.height - 250) / 2 + 82,
            'opacity' : 0.9
        }
    )
    .show()
    .animate({'height' : 250}, 1500, 'bounceout');
    
    timerHideSpring = setTimeout(
        function() {
            $('#spring_pic')
            .animate(
                {'height' : 0}, 
                1000, 
                function () {
                    $('#spring_pic').hide();
                }
            );
        },
        10000
    );
});
function hideSpring() {
    if (timerHideSpring) {
        clearTimeout(timerHideSpring);
        timerHideSpring = null;
    }
    $('#spring_pic').slideUp(800);
}

