/*
 * 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($){
	$.fn.bubbleup = function(options) {
		//Extend the default options of plugin
		var opt = $.extend({}, $.fn.bubbleup.defaults, options),tip = null;
		
		return this.each(function() {
			
			

			$(this).hover(function(){
				

				var $this = $(this).children(0).children(0);
			
				var w=$this.width();
				var width_li = this.width;
			
				
				
				$this.parent('a').children('img.normal,img.hover').css({'top':0,'left':42.5,'width':w}).animate({
					left:(151-opt.scale)/2,
					top:-opt.scale/2+w/2,
					width:opt.scale
				},opt.inSpeed,function() {
					
					
					//$this.parent('a').children('img.hover').css({'display':'block'});
					$this.parent('a').children('img.hover').show('slow');
					$this.parent('a').children('img.normal').css({'z-index':5,'display':'none'});
				});
				$this.parent('a').children('img.normal').css({'z-index':5,'display':'none'});

				
			},function(){
				var $this = $(this).children(0).children(0);
				
				var w=$this.width();
				var width_li = this.width;
				
				$this.parent('a').children('img.normal').css({'z-index':20});
				$this.parent('a').children('img.hover').css({'display':'block'});
				
				$this.parent('a').children('img.normal,img.hover').stop().animate({left:(151-66)/2,top:0,width:66},opt.outSpeed,function(){
					
					$this.parent('a').children('img.hover').css({'display':'none'});
					
				});
				//$this.parent('a').children('img.hover').css({'display':'none','background':'url(/static/image/interface/bg-menu-li.jpg)'});
				/*
				$this.parent('a').children('img.normal,img.hover').stop().animate({left:(151-66)/2,top:0,width:66},opt.outSpeed);
				$this.parent('a').children('img.hover').css({'display':'none'});
				*/
				
				
			})
		})
	}
	$.fn.bubbleup.defaults = {
		tooltip: false,
		scale:96,
		fontFamily:'Helvetica, Arial, sans-serif',
		color:'#333333',
		fontSize:12,
		fontWeight:'bold',
		inSpeed:'fast',
		outSpeed:'fast'
	}
})(jQuery);
