$(document).ready(function()
{
	$("a[rel=external]").click(function()
	{
		href = $(this).attr("href");

		window.open(this.href);

		return false;
	});

	$("a[rel=download]").click(function()
	{
		href = $(this).attr("href");

		$("#overlay .button-download").attr("href", href);

		$("#overlay").fadeIn("fast");

		$("#overlay .box").css({
			"margin-top" : "-" + ($("#overlay .box").height() / 2) + "px",
			"height" : $("#overlay .box").height() + "px"
		});

		if($.browser.msie & $.browser.version.substr(0, 3)=="6.0")
		{
			$("#overlay .box").css({"top" : ($(window).scrollTop() + 320) + "px"});
		}

		return false;
	});

	$("#overlay .button-yellow").click(function()
	{
		$("#overlay").fadeOut("fast");

		if($(this).attr("rel")!="close" && $(this).hasClass("button-download"))
		{
			return true;
		}

		else
		{
			$(this).attr("href", void(0));

			return true;
		}
	});
});