$(document).ready(function()
{
	$("ul.hidden").hide();
	$(".module a.view-all").click(function()
	{
		if ($(this).data("is_open") != "1")
		{
			$("ul.hidden", $(this).parent()).slideDown(500);
			$(this).data("is_open", "1").html("close <b>X</b>");
		}
		else
		{
			$("ul.hidden", $(this).parent()).slideUp(500);
			$(this).data("is_open", "0").html("view all");
		}
		return false;
	});
});

function openWinHW (URL, H, W)
{
	bWindow = window.open(URL, "bwindow", "toolbar = no, width = " +W+ ", height = " +H+ " , status = no, scrollbars = no, resize = yes, menubar = no");
	if (window.focus)
	{
		bWindow.focus();
	}
}

// Since the target attribute is not valid in XHTML strict, we need a way to open links in a new window
function externalLinks()
{
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++)
	{
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
		{
			anchor.target = "_blank";
		}
	}
}
window.onload = externalLinks;