// mini normdaten
$(document).ready(function()
{
	if (location.search.match(/printable=yes/))
	{
		// do nothing in printable version
		return;
	}
	
	$("div.normdaten-typ-p,div.normdaten-typ-k,div.normdaten-typ-v,div.normdaten-typ-w,div.normdaten-typ-s,div.normdaten-typ-g,div.normdaten-typ-fehlt,div.normdaten-andere").each(function(i)
	{
		var uls = $("ul", this);
		if (uls.length == 1)
		{
			uls.first().css("margin", "0.3em 0px 0px 0px");
			var lis = $("li", uls.first()).each(function(j)
			{
				var uids = $("span.uid", this);
				if (uids.length == 1)
				{
					var uid0 = uids.first();
					var label = $("a", this).first().html();
					var href = $("a", uid0).attr("href");
					var title = uid0.text();
					$(this).html("<a class='external text' rel='nofollow' href='"+href+"' title='"+title+"'>"+label+"</a>");
				}
				else if (uids.length > 1)
				{
					var a0 = $("a", this).first();
					var label = a0.text();
					a0.replaceWith("<span>"+label+"</span>");
					uids.each(function(k)
					{
						var a = $("a", this).first();
						$(this).attr("title", a.text());
						a.text(k + 1);
					})
				}
			});
		}
	})
});