(function($){
	
	/* Плагин добавляет к ядру jQuery Core четыре метода */
	
	/* Преобразование элемента в выпадающее окно: */
	$.fn.bounceBox = function(left_width){
		
		/*
			Применение некоторых правил CSS, которые центрируют элемент в середине страницы
			и перемещают его выше области видимости браузера.
		*/
		
		/*
		this.css({
			top			: -this.outerHeight(),
			marginLeft	: -this.outerWidth()/2,
			position	: 'fixed',
			left		: '50%'
		});
		*/
		/*
		this.css({
			top			: -this.outerHeight(),
			marginLeft	: -this.outerWidth()/2,
			
			position	: 'fixed',
			left: top_width/2+topline_width/2-230+100,
			//display : 'none',
		});
		*/
		
		this.css({
			top			: -this.outerHeight(),
			marginLeft	: -this.outerWidth()/2,
			
			position	: 'fixed',
			left: left_width,
			//display : 'none',
		});
		
		return this;
	}
	
	/* Метод boxShow */
	$.fn.bounceBoxShow = function(top_height){
		
		/* Запуск анимации выпадения окна */
		
		this.css({
			
			display : 'block',
		});
		
		this.stop().animate({top:top_height},{easing:'easeOutBounce'});
		this.data('bounceShown',true);
		return this;
	}
	
	/* Метод boxHide */
	$.fn.bounceBoxHide = function(){
		
		/* Запуск анимации поднимания окна */
		//alert(-this.outerHeight());
		this.animate({top:-this.outerHeight()});
		this.data('bounceShown',false);
		return this;
	}
	
	/* Метод boxToggle */
	$.fn.bounceBoxToggle = function(top_height){
		
		/* 
			Показываем или скрываем bounceBox в зависимости от значения
			переменной 'bounceShown'
		*/
		
		if(this.data('bounceShown'))
			this.bounceBoxHide(top_height);
		else
			this.bounceBoxShow(top_height);
		
		return this;
	}
	
})(jQuery);
