$(function() {
	var bubble = $('#jquerybubblepopup');
	$('#ourProperties > ul > li > a').each(function(index) {
		if ($(this).parent().children('ul')[0]) {
			$(this).click(function() {
				var html = '<ul>' + $(this).parent().children('ul').html() + '</ul>';
				var width = $(this).width();
				var height = ($(bubble).height() - $(this).height())/2;
				var x = $(this).position().left + width + 5;
				var y = $(this).position().top - height;
				
				$(bubble).find('.jquerybubblepopup-innerHtml').html(html)
				$(bubble).css({display: 'block', left: x + 20, top: y, opacity: 0}).animate({left: x, opacity: 1},{
					duration: 500,
					queue: false
				});
				
				return false;
			});
		}
	});
	$('#jquerybubblepopup').bind('hide',function() {
		var x = $(this).position().left;
		$(this).animate({left: x + 20, opacity: 0},{
			duration: 500,
			queue: false
		});
	});
	
	$('#ourProperties').mouseleave(function() {$(bubble).trigger('hide');});
	$('#jquerybubblepopup').mouseleave(function() {$(this).trigger('hide');});
});
