﻿// issueview.js
//
// Copyright 2008 Bryan Jensen.  All rights reserved.
// Used by permission.
//
// Usage instructions:
//
// 1. Be sure to include jquery and this script in your code.
// 2. Create a div on your page with an id of nfteissueview,
// 3. Ensure this div has visible:none as a css attribute

// Called to close the viewer
function closeIssue()
{
	$("div#nfteissueview").fadeOut("fast");
}

// Opens the passed issue number in the div and makes it visible
function openIssue(issuePath,rtnTag)
{
	var pathParts = issuePath.split("/");
	var fnParts = pathParts[1].split(".");
	var title = "Notes From the Edge Issue #" + fnParts[0];
	if (pathParts[0] != "back-issues")
	{
		title = "Notes From the Edge Interview";
	}
	if (rtnTag == null)
	{
		rtnTag = fnParts[0];
	}
	$("div#nfteissueview").html("<div class='issueHeader'><div class='issueTitle'>"
		+ title 
		+ "</div><div class='issueClose'><a href='#"
		+ rtnTag
		+ "' onclick='javascript:closeIssue();'>close</a></div></div><iframe src='" 
		+ issuePath 
		+ "' width='100%' height='96%' frameborder='0' title='"
		+ title 
		+ "'></iframe>").fadeIn("slow");
}