function PriceEstimateBubble() {
	var _this = this;
	
	
	
	this.init = function() {
		this.indicator = jQuery('span.bubbleIndicator');
		this.bubble = jQuery('div.noticeBubble');
		this.holder = jQuery('td.noticeHolder');
		
		if (this.indicator.length && this.bubble.length && this.holder.length) {
			this.holderTop = this.holder.position().top;
			this.holderLeft = this.holder.position().left;
			this.holderWidth = this.indicator.outerWidth();
			
			this.bubbleWidth = this.bubble.outerWidth();
			this.bubbleHeight = this.bubble.outerHeight();
			
			this.timeout = null;
			
			this.addEventListeners();
		}
	}
	
	
	
	this.addEventListeners = function() {
		this.indicator.bind('mouseenter', function() {
			_this.showBubble();
		}).bind('mouseout', function() {
			_this.hideBubble();
		});
	}
	
	
	
	this.showBubble = function() {
		clearTimeout(this.timeout);
		this.bubble.css({ top: this.holderTop - 30 + 'px', left: this.holderLeft + this.holderWidth + 5 + 'px', height: 0, width: 0 });
		this.bubble.show();
		this.bubble.animate({ left: this.holderLeft + this.holderWidth + 10 + 'px', height: this.bubbleHeight + 'px', width: this.bubbleWidth + 'px' }, { duration: 100, easing: 'swing' });
	}
	
	
	
	this.hideBubble = function() {
		this.timeout = setTimeout(function() {
			_this.bubble.animate({ left: _this.holderLeft + _this.holderWidth + 5 + 'px', height: 0, width: 0 }, { duration: 100, easing: 'swing', complete: function() {
				_this.bubble.hide();
			}});
		}, 300);
	}
	
	
	
	this.init();
}

jQuery(window).load(function() {
	var bubble = new PriceEstimateBubble();
})
