$(document).ready(function(){
	var resizeTimer = null;
    $(window).bind('resize', function() {
		if (resizeTimer) clearTimeout(resizeTimer);
        resizeTimer = setTimeout(posizionaIndex, 200);
    });
	posizionaIndex();
});

function posizionaIndex(){
	var top = Math.ceil(($(window).height() / 2) - ($("#boxIndex").height() / 2));
	if(top < 40) top = 40;
	
	$('#boxIndex').animate({
		top: top
	}, 1500, 'easeOutElastic'); //easeOutBounce, swing
	
	//$("#boxIndex").animate({"top": top}, "fast");
	//$("#boxIndex").css('top', top);
	
}