$(document).ready(function(){

  $("#pageflip").hover(function() { //On hover...
	$("#pageflip img , .msg_block").stop()
		.animate({ //Animate and expand the image and the msg_block (Width + height)
			width: '307px',
			height: '319px'
		}, 500);
		
		clearInterval(cornerTimer);
  } , function() { //On hover out...
	$("#pageflip img").stop() //Go back to original size 50x52
		.animate({
			width: '50px',
			height: '52px'
		}, 220);
	$(".msg_block").stop() //Go back to original size 50x50
		.animate({
			width: '50px',
			height: '50px'
		}, 200); //Note this one retracts a bit faster (to prevent glitching in IE)
		
		cornerTimer = setInterval('cornerWiggle()', 2000);
  });

  var cornerTimer = setInterval('cornerWiggle()', 2000);

});

function cornerWiggle() {
	$("#pageflip img").animate({
		width: '62px',
		height: '67px'
	}, 400);
	$("#pageflip .msg_block").animate({
		width: '62px',
		height: '62px'
	}, 400);
	$("#pageflip img").animate({
		width: '50px',
		height: '52px'
	}, 400);
	$("#pageflip .msg_block").animate({
		width: '50px',
		height: '50px'
	}, 400);
}
