$(document).ready(function(){


	setTimeout('setShadowHeight()', 100);
	bottomLogo();

	/**
	 * header animation
 	 */
	$('#animation > ul').innerfade({
		speed: 3000,
		timeout: 6000,
		type: 'sequence',
		containerheight: 'auto'
	});  

});

function setShadowHeight() {
	/**
	 * expand .wrp-2
	*/
	var wrp2 = $('.wrp-2').outerHeight('false');
	$('.wrp-1').css({
		'height': wrp2,
		'background-image': 'url(/static/images/bgr_s.png)'
		});
	setTimeout('setShadowHeight()', 40);
}

function bottomLogo() {
	//alert($(window).scrollTop());
	/**
	 * place logo at bottom of viewport
	 */
	if ($(window).height() > (460+$('#logo > img').outerHeight('false'))) {
		//move = 0;
		//delta = 10;
		targetPos = $(window).height()+$(window).scrollTop()-($('#logo > img').outerHeight('false')+20);
		
//		if ($('#logo').css('top').replace("px", "") < targetPos) {
//			move = delta;
//		}
//
//		if ($('#logo').css('top').replace("px", "") > targetPos) {
//			move = -1 * delta;
//		}
		
		$('#logo').css('top', targetPos);
	}
	if ($(window).height() >  $('.wrp-1').outerHeight('false')) {
		$('.wrp-1').css({
			'height': $(window).height()
		});
	}
	setTimeout('bottomLogo()', 40);
}
