jQuery ( function () {
	initImgBox ();
})

// initImgBox
function initImgBox () {
	var animateSpeed = 500;
	jQuery ( '.img-box' ).each ( function () {
		var holder = jQuery ( this ),
			imageDef = jQuery ( '.state', this ),
			imageOver = jQuery ( '.hover', this ),
			h = holder.height ();
		
		imageDef.css ({
			display: 'block',
			position: 'absolute',
			top: 0,
			left: 0,
			zIndex: 1
		});
		imageOver.css ({
			display: 'block',
			position: 'absolute',
			top: 0,
			left: 0
		});
		
		holder.mouseover ( function () {
			imageDef.animate ({ top: h }, { queue: false, duration: animateSpeed })
		}).mouseleave ( function () {
			imageDef.animate ({ top: 0 }, { queue: false, duration: animateSpeed })
		})
	})
}
