function Sidebar()
{
this.left=40;
this.width=300;
this.top=300;
this.text;
this.id;
this.callingId = "bylineNote";
this.display="display:none; ";
}

sidebar = new Array();

sidebar[0] = new Sidebar();
sidebar[0].id = "sidebar0";
sidebar[0].callingId = "Lee";
sidebar[0].text = "The book, published in 1956, is a memoir about a Chinese American family living in the Midwest. In this passage the old man mistakes the child for a Filipino. There is no way to verify any of the old man’s remarks, and indeed they are suspect for many reasons, but they do conform to reports from the war in the Philippines concerning policies to take no prisoners and the indiscriminate killing of civilians.";

sidebar[1] = new Sidebar();
sidebar[1].id = "sidebar1";
sidebar[1].text = "<em>The Bold Ant</em> is a modern fable, first appearing in written form in the 1930s, though it may have been adapted from an older source. A corrupted version of the story appears in <em>Arise, Fox! Fables For a New China</em>, published in Beijing in 1956. In that version, when Master Zhu is asked which side he will fight on, he replies, “The side of the people!”";

sidebar[2] = new Sidebar();
sidebar[2].id = "sidebar2";
sidebar[2].text = "Anonymous reporter’s notes filed with photos from April 1927 at the <em>Shanghai Daily News,</em> an English-language newspaper in Shanghai.";

sidebar[3] = new Sidebar();
sidebar[3].id = "sidebar3";
sidebar[3].text = "A memoir of an American businessman's life in Shanghai during the twenties and thirties. The title is a reference to a large indoor amusement center of the same name, which, during the early decades of the twentieth century, went from being a family-oriented place to a center of drugs, prostitution, and crime. Throughout the book, Nyquist uses The Great World Amusement Center as a metaphor for Shanghai itself.";

sidebar[4] = new Sidebar();
sidebar[4].id = "sidebar4";
sidebar[4].text = "The Sons of Taiwan Find Solace</em> appears to be an uncompleted documentary. Approximately twenty-five hours of audio tape was found in the headquarters of a Taiwanese “literary discussion group” after leaders of the group were arrested for sedition. The audio contained sync marks, indicating that it had been made during filming, though no film was ever found.";

sidebar[5] = new Sidebar();
sidebar[5].id = "sidebar5";
sidebar[5].callingId = "nameNote";
sidebar[5].text = "In China it is customary to give children names that carry auspicious meanings. The dead man’s name, Chung-yi, suggests acting according to moral principles. Chung-ping, on the other hand, suggests leading a trouble-free life.";

sidebar[6] = new Sidebar();
sidebar[6].id = "sidebar6";
sidebar[6].text = "This unsent letter was found among papers confiscated during the April 1927 raids. It is fairly certain that it was written by Li Chung-yi. The tantalizing part is the name Ming-kang, which was the given name of Hsieh Pingying, author of <em>War Diary</em> (1928). Many of the facts match: she was billeted for a time in Kiayu; she had an older brother who died around that time; and she grew up in Hsinhua district, though she never writes about the trip across the district that Li mentions. Hsieh joined the Army at a time when nationalists and communists were fighting side by side against the warlords. Later she reenlisted in the Nationalist Army under Chiang Kai-shek to fight the Japanese.";

sidebar[7] = new Sidebar();
sidebar[7].id = "sidebar7";
sidebar[7].text = "From the opening pages of “Diary of My Father’s Son,” by Martin Bowles. Throughout the diary, Bowles contrasts his own life with that of his father. Shortly after the scene presented here, Bowles is drafted into the Army and sent to Vietnam. He accepts this turn of events, interpreting it in the same terms of “bondage” and “victimhood” that are present throughout the diary. This point of view remains consistent even through an episode in which, after a fire fight where one of his buddies is killed, he and a fellow soldier execute three Vietcong captives. It becomes particularly insistent when he returns to the States, “spat on,” he says, suffering nightmares, unable to hold a job, unable to get treatment for his alcoholism. In the last pages of the diary he returns explicitly to the photographs, describing himself as “bound hand and foot, headless.” The diary was never published. A rejection letter found with the manuscript speaks of its “unrelieved bitterness” and its “unrealistic obsession with a trivial childhood incident.”";

sidebar[8] = new Sidebar();
sidebar[8].id = "sidebar8";
sidebar[8].text = "From “My Town,” a column by Walter Harris in the <em>Huntington Herald</em>, November 17, 1920. Harris’s twice-weekly column, which ran between 1913 and 1929, is an example of a type of evocative account that was fairly common in small-town newspapers throughout the Midwest in the early decades of the 20th century. It reveals the influence of literature at a time when literature itself was being influenced by the mundane qualities of newspaper writing. As a group, these writers have been called “Hometown Hemingways,” a term that was, at the time, a compliment. They have subsequently been all but forgotten. Most of their work, including Harris’s, has never been collected and will likely disappear as old archives are lost.";


Sidebar.prototype.writeSidebar = writeSidebar;
Sidebar.prototype.revealSidebar = revealSidebar;


//-------------------------------------------------------------------------------------
// writeSidebar() is a method of Sidebar. It is called inside loadSidebars(), which itself
// is called on loading within a div at the bottom of the text panel. It basically sets values
// according to properties of Sidebar. Since display is initially set to "none," the sidebar
// text doesn't appear until you invoke revealSidebar().

function writeSidebar()
{
var displayValue = this.display;
writewhat = "<p id='" + this.id;
writewhat += "' style='" + displayValue + "'>";
writewhat += this.text + "</p>\n";
document.write(writewhat);
}

//-------------------------------------------------------------------------------------
// revealSidebar() is a method of Sidebar. This is called through a link or onclick to
// open the sidebar. calledFrom is the vertical location, in pixels, of the point where the
// method was called. offsetHeight is the height of the sidebar box.

function revealSidebar()
{
closeSidebar();
var sidebarText = document.getElementById(this.id);
sidebarText.style.display = "block";
var sidebarBox = document.getElementById("sidebarBox");
var calledFrom = document.getElementById(this.callingId).offsetTop;
var sidebarHeight = document.getElementById("sidebarBox").offsetHeight;
calledFrom -= sidebarHeight;
sidebarBox.style.top = calledFrom;
sidebarBox.style.visibility = "visible";
}


//-------------------------------------------------------------------------------------
// loadSidebars() is called when the page loads.

function loadSidebars()
{
	for(i=0; i<sidebar.length; i++)
	{
sidebar[i].writeSidebar();
	}
}


//-------------------------------------------------------------------------------------
// closeSidebar() returns the sidebar box to "invisible" and sets any sidebar text to "display:none."

function closeSidebar()
{
var sidebarBox = document.getElementById("sidebarBox");
sidebarBox.style.visibility = "hidden";
	for(i=0; i<sidebar.length; i++)
	{
document.getElementById(sidebar[i].id).style.display="none";
	}
}

//-------------------------------------------------------------------------------------
// scrollToTop() returns the sidebar box to "invisible" and sets any sidebar text to "display:none".
// It then scrolls to the top of the page.

function scrollToTop()
{
closeSidebar();
window.scrollTo(0,0);
}


