function removeRoundness(elem) {
	elem.find(".roundedHead").removeClass();
	elem.find(".boxContent").removeClass();
	elem.find(".roundedBottom").removeClass();
}

function isRoundedContentEmpty(elem) {
	return jQuery.trim(elem.find(".boxContent").text().replace(/\<!--[\s\S]*?--\>/gm, "")).length == 0;
}

function newWin(url, winName, width, height) {
	if (width == null) width = 540;
	if (height == null) height = 400;
	window.open(url, winName,'height=' + height + ',width=' + width + ',left=180,top=40,resizable=yes,menubar=no,toolbar=no,location=no,scrollbars=yes');
}
function toggleCategory(uuid, number) {
	$("." + uuid).hide();
	$("#categoryDescription" + uuid + number).show();
}

function showPopup(popupId, url) {
	var res = $.get(url, function(data) {
		var i = data.indexOf("<!-- text1 (do not remove) -->");
		if (i != -1) data = data.substring(i + 30);
		var j = data.indexOf("<!-- /text1 (do not remove) -->");
		if (j != -1) data = data.substring(0, j);
		$("#popup-content-" + popupId).html(data);
		$("#popup-" + popupId).show();
		$("#overlay-" + popupId).show();
	});
	res.error(function() {
		alert("Aja error occured");
	});
}

function hidePopup(popupId) {
	$("#popup-" + popupId).hide();
	$("#overlay-" + popupId).hide();
}

