/*
 * Bubbleup - Spicing up menu jQuery plugin
 *
 * Tranform the images inside the list items like Mac Dock effect
 *
 * Homepage: http://aext.net/2010/04/bubbleup-jquery-plugin/
 *
 * Copryright? I don't have any!
 *
 * First written by Lam Nguyen (yah, it's me)
 * Written again by Jonathan Uhlmann http://jonnitto.ch
 * Thanks to Icehawg (Hey, I don't know anything from him, just a name http://aext.net/2010/02/learn-jquery-first-jquery-plugin-bubbleup/#comment-6777)
 *
 */

$(function(){	$("div#block div.list p img").bubbleup({ tooltip: false, scale:300 });	});

(function($){
	$.fn.bubbleup = function(options) {
		//Extend the default options of plugin
		var opt = $.extend({}, $.fn.bubbleup.defaults, options),tip = null;
		
		return this.each(function() {
			var w=$(this).width();
			var h=$(this).height();
			$(this).mouseover(function(){
				
				$(this).closest('p').css({'z-index':100000});
				
				$(this).stop().css({'z-index':100000,'top':0,'left':0,'width':w, 'height':h}).animate({
					left:-opt.scale/2+w/2,
					top:-opt.scale/2+w/8,
					width:opt.scale,
					height:opt.scale,
					border : '1px solid #ccc'
				},opt.inSpeed);
			}).mouseout(function(){
				
				$(this).closest('p').css({'z-index':100});
				$(this).closest('p').next().css({'z-index':0});
				$(this).closest('p').next().css({'z-index':0});
				$(this).closest('p').next().children('img').css({'z-index':0});
				
				if(opt.tooltip){tip.remove()}
				$(this).stop().animate({left:0,top:0,width:w, height:h, border : 0},opt.outSpeed,function(){
					$(this).css({'z-index':0});
					
				});
			})
		})
	}
	$.fn.bubbleup.defaults = {
		tooltip: false,
		scale:96,
		fontFamily:'"Lucida Sans",Arial,Helvetica,Sans-Serif',
		color:'#333333',
		fontSize:12,
		fontWeight:'bold',
		inSpeed:'slow',
		outSpeed:'fast'
	}
})(jQuery);
