/*!
 * 
 * jQuery Pagepeel v1.0
 * 
 * @author: 	Damon Williams
 * @company: 	Neo-Pangea
 * @created: 	04-10-2010
 * @modified: 	04-10-2010
 * 
 */
 
(function($) {
	
	$.fn.extend({
		
		pagepeel: function(options) {
			
			var defaults = {
				imgOpenWidth: 213,
				imgOpenHeight: 213, 
				imgOpenDuration: 500,
				imgCloseWidth: 50,
				imgCloseHeight: 52,
				imgCloseDuration: 500, 
				msgOpenWidth: 213,
				msgOpenHeight: 205,
				msgOpenDuration: 460, 
				msgCloseWidth: 50,
				msgCloseHeight: 50,
				msgCloseDuration: 460
			}
			
			var options = $.extend(defaults, options);
			
			return this.each(function() {
				
				var opt = options;
			
				// OVER
				$(this).mouseover(function () {
					$("#"+this.id+" img")
						.stop()
						.animate({
							width: opt.imgOpenWidth, 
							height: opt.imgOpenHeight
						}, opt.imgOpenDuration);
						
					$(".msgBlock")
						.stop()
						.animate({
							width: opt.msgOpenWidth, 
							height: opt.msgOpenHeight
						}, opt.msgOpenDuration);
				});
				
				// OUT
				$(this).mouseout(function () {
					$("#"+this.id+" img")
						.stop()
						.animate({
							width: opt.imgCloseWidth, 
							height: opt.imgCloseHeight
						}, opt.imgCloseDuration);
						
					$(".msgBlock")
						.stop()
						.animate({
							width: opt.msgCloseWidth, 
							height: opt.msgCloseHeight
						}, opt.msgCloseDuration);
				});
				
			});

		}
		
	});
	
})(jQuery);

