﻿$(document).ready(prepareElements);

function onPopupOpen(e) {
	window.open(e.currentTarget.href, '_blank', 'width=850,height=630,scrollbars=yes,resizable=no');
	return false;
}

function prepareElements() {
	$("a[class~='action']").text("");

	$("a[class~='button']").each(function(index, e) {
		if ($(this).data("wrapped") == null) {
			this.innerHTML = "<b>" + this.innerHTML + "</b>";
			$(this).data("wrapped", true);
		}
	});

	$("a[target='_blank']").each(function(index, e) {
		var a = $(this);

		if (a.data("popupWrapped") == null) {
			a.click(onPopupOpen);
			a.data("popupWrapped", true);
		}
	});
}

