function plugin_footer() {

	window.scrollAmount = 5;
	window.scrollInterval = 20;

	$('div.arrow_up').fadeTo(500, 0.3);
	$('div.arrow_down').fadeTo(500, 0.3);

	window.scrollDown = function(popup) {
		if (popup.scrollEnabled) {

			if (popup.scrollTop >= popup.scrollMax) {
				popup.scrollTop = popup.scrollMax;
				$('div.arrow_up', popup).css({ top: popup.scrollTop });
				$('div.arrow_down', popup).css({ top: popup.scrollTop + 246 });
				return;
			}

			popup.scrollTop += window.scrollAmount;

			var arrow = $('div.arrow_down', popup);
			var arrowTop = parseInt(arrow.css('top').replace(/px/, ''));
			arrow.css({ top: arrowTop + window.scrollAmount });

			arrow = $('div.arrow_up', popup);
			arrowTop = parseInt(arrow.css('top').replace(/px/, ''));
			arrow.css({ top: arrowTop + window.scrollAmount });

			setTimeout('window.scrollDown(popup)', window.scrollInterval);
		}
	}

	window.scrollUp = function(popup) {
		if (popup.scrollEnabled) {

			if (popup.scrollTop <= 0) {
				popup.scrollTop = 0;
				$('div.arrow_up', popup).css({ top: 0 });
				$('div.arrow_down', popup).css({ top: 246 });
				return;
			}

			popup.scrollTop -= window.scrollAmount;

			var arrow = $('div.arrow_down', popup);
			var arrowTop = parseInt(arrow.css('top').replace(/px/, ''));
			arrow.css({ top: arrowTop - window.scrollAmount });

			arrow = $('div.arrow_up', popup);
			arrowTop = parseInt(arrow.css('top').replace(/px/, ''));
			arrow.css({ top: arrowTop - window.scrollAmount });

			setTimeout('window.scrollUp(popup)', window.scrollInterval);
		}
	}

	$('div.arrow_down')
		.mouseover(function() {
			$(this).css({ background: 'red' });
			var popup = $(this).parent().get(0);
			popup.scrollEnabled = true;
			scrollDown(popup);
		})
		.mouseout(function() {
			$(this).css({ background: 'black' });
			var popup = $(this).parent().get(0);
			popup.scrollEnabled = false;
		});

	$('div.arrow_up')
		.mouseover(function() {
			$(this).css({ background: 'red' });
			var popup = $(this).parent().get(0);
			popup.scrollEnabled = true;
			scrollUp(popup);
		})
		.mouseout(function() {
			$(this).css({ background: 'black' });
			var popup = $(this).parent().get(0);
			popup.scrollEnabled = false;
		});


	$('div.popup a').mouseover(function() {
		var timeout = $(this).parent().prev().get(0).timeout;
		if (timeout) {
			clearTimeout(timeout);
		}
	})

	$('div.popup')
		.mouseover(function() {
			var timeout = $(this).prev().get(0).timeout;
			if (timeout) {
				clearTimeout(timeout);
			}
		})
		.mouseout(function() {
			var link = $(this).prev().get(0);
			link.timeout = setTimeout(popup_close, 100);
		});

	$('a.popup_trigger').mouseover(function() {

		var trigger = $(this);
		var popup = trigger.next();

		$('div.popup').hide();

		var topOffset = $.browser.msie ? 16 : 11;
		popup.show().css({
			left: $(this).position().left - 130,
			top: $(this).position().top - $(this).next().height() - topOffset
		});

		if (!popup.get(0).scrollMax) {
			popup.get(0).scrollMax = popup.height() - 250 - 3;
		}

		var topOffset2 = $.browser.msie ? 5 : 0;
		if (popup.height() > 250) {
			popup.css({
				height: 250,
				top: $(this).position().top - 250 - topOffset + topOffset2
			});
		} else if (popup.height() < 245) {
			$('div.arrow_up', popup.get(0)).hide();
			$('div.arrow_down', popup.get(0)).hide();
		}
	});

	$('a.popup_trigger').mouseout(function() {
		this.timeout = setTimeout(popup_close, 100);
		window.popup = $(this).next().get(0);
	});
}

function popup_close() {
	if (window.popup) {
		$(window.popup).hide();
	}
}
