/// <reference path="jquery-1.2.6-vsdoc.js" />

function PrepareLinks()
{
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i = 0; i < anchors.length; i++)
	{
		var anchor = anchors[i];
		if (anchor.getAttribute("rel") == "external")
		{
			anchor.target = "_blank";
		}
		else if (anchor.getAttribute("rel") == "email")
		{
			anchor.href = anchor.href.replace("[at]", "@");
			anchor.href = anchor.href.replace("[dot]", ".");
			anchor.innerHTML = anchor.innerHTML.replace("[at]", "@");
			anchor.innerHTML = anchor.innerHTML.replace("[dot]", ".");
		}
	}
}
$(document).ready(PrepareLinks);

function ToggleSamplesOn()
{
	var parent = $(this).parent();
	parent.children(".other").show("fast");
	parent.children(".expand").hide("fast");
	parent.children(".collapse").show("fast");
	return false;
}
function ToggleSamplesOff()
{
	var parent = $(this).parent();
	parent.children(".other").hide("fast");
	parent.children(".collapse").hide("fast");
	parent.children(".expand").show("fast");
	return false;
}
function HideSamples()
{
	$("#groupings .other").hide("fast");
	$("#groupings .expand").show("fast").click(ToggleSamplesOn);
	$("#groupings .collapse").hide("fast").click(ToggleSamplesOff);
}
$(document).ready(HideSamples);