// allJournalArticles.js

/*
 * -----------------------------------------------------------------
 * 'SAUTI' (c) 2005/2006, Kwame Ansong-Dwamena 
 * -----------------------------------------------------------------
 */

/* 
  * This .js file controls the population of a select element with options that list all
  * the SAUTI articles by volume in the div (id='allVolArticles').
  */
var totalVols = 2;				// number of journal articles released
var volArray = new Array();		// holds the array that contains the titles of the journal volume selected
var xtrctArr = new Array();		// holds the array that contains the extract of the various titles of the journal volume selected

var vol1 = new Array();
vol1[0] = "article1";
vol1[1] = "article2";
vol1[2] = "article3";
vol1[3] = "article4";
vol1[4] = "article5";
vol1[5] = "article6";
vol1[6] = "article7";
vol1[7] = "article8";
vol1[8] = "article9";
vol1[9] = "article10";
  
var vol2 = new Array();
vol2[0] = "Causality and the Casualty of Truth";
vol2[1] = "Reflections from Africa I";
vol2[2] = "Mobile Telecommunications In Africa";
vol2[3] = "Personal Reflection";
vol2[4] = "The Role of Elections in Post-Conflict Situations";
vol2[5] = "Reflections from Africa II";
vol2[6] = "Punishing Genocide";
vol2[7] = "Mobile Phone Use and Policy in Southern Africa";
vol2[8] = "Energy Issues in Sub-Saharan Africa";
vol2[9] = "Learning of Science and Math among Females";

var vol1Extract = new Array();
vol1Extract[0] = "extract";
vol1Extract[1] = "extract";
vol1Extract[2] = "extract";
vol1Extract[3] = "extract";
vol1Extract[4] = "extract";
vol1Extract[5] = "extract";
vol1Extract[6] = "extract";
vol1Extract[7] = "extract";
vol1Extract[8] = "extract";
vol1Extract[9] = "extract";


var vol2Extract = new Array();
vol2Extract[0] = "David Rieff accurately assesses Africa’s image in the West. From magazines like The Economist to articles like Rieff’s in academic journals, Africa’s fate seems to be nigh certain: the continent is “bleak, inhospitable… in a state of crisis. Mainstream newspaper and magazine writers pen an incessant stream of tales about African countries governed by corrupt despots, who rule over states that are among the most underdeveloped on Earth, with little to offer other than raw materials and a steady supply of violent conflicts to occupy our televisions. Africa’s failure has become cliché; books and articles chronicle this...";
vol2Extract[1] = "In the last year, Rwanda has shown that it is not only dealing with its own problems, but is willing to reach out and have an impact on the health of the entire region. On May 30, 2005, Rwanda hosted the second COMESA1 Business Summit during which Rwanda’s president, Paul Kagame, was elected as chairman of the regional association. Considering that Rwanda was abandoned by the peacekeepers of the world in 1994, they sent a powerful message to the world in 2005 by sending thousands of troops to Southern Sudan as part of an African Union peacekeeping force. In 2005, Rwanda was able to assert itself as a key player in the economic and social development of East Africa. This year Rwanda hopes to become an official member of the East African Community, and will have the chance to become a key player in regional politics (The EAC currently consists of Kenya, Uganda, and Tanzania)...";
vol2Extract[2] = "It would definitely not be an exaggeration to claim that cellular telephony represents high technology’s most successful foray in to the African continent. The numbers clearly bear out this assertion: as at the end of August 2005, a mere 18 years after the first cell phones arrived in Africa, the number of mobile handsets in active use by subscribers stood at 76.8 million (representing a conservative estimation). The annualized aggregate growth rate in handset numbers was pegged at a healthy 58%, a figure that clearly propelled the African cellular market to outperform all others worldwide1. Cumulative growth between 1998 and 2005 stood at an astonishing 5,000, a technology-related growth rate that has...";
vol2Extract[3] = "It was the end of a three-day journey through the Zambian countryside on a bus, which also carried several pounds of dust and the heavy smell of the fish that had preceded us as passengers. We had been in this bus since our original transport broke down about an hour into our journey. However, we had been warned about these kinds of logistical problems, and I was proudly unfazed. But now, our destination was racing towards us from the horizon so fast I was afraid it might hit us. No one spoke as we pressed our faces to the dirty windows to get the best view of this place we had been learning about, talking about, and dreaming about for the past six months: Mwange Refugee Camp. Mwange harbors 24,000 refugees from the conflict in the Democratic Republic of the Congo (DRC), most of whom had been living there since 1998. I traveled to Mwange with a group of eight students through an organization called FORGE to bring opportunities to the refugees. When we got off the bus in Mwange, the first thing...";
vol2Extract[4] = "Since the mid-1990s, elections have come to be seen as an integral part of post-conflict reconstruction operations. According to Simon Chesterman, this belief is rooted in theoretical literature on democratic peace and the right to democratic governance, and in normative support from successful operationsin Namibia and Cambodia.1 However, the focus of elections tends to be on their form, or the “simple, single-moment, horse race-type event – the actual2 balloting and the intriguing issue of who ‘wins’ and who ‘loses,’” rather than their substance. Instead,the focus should be on what elections are actually meant to achieve, the conditions necessary to ensure the success of elections, and the definition of success. I will argue...";
vol2Extract[5] = "The introduction of free Primary school education was undoubtedly a significant development in Kenya’s education sector. Education in Kenya has been based on an 8-4-4 system since the late 1980s, with eight years of primary education followed by four years of secondary school and four years of college or university. With the generally poor standards of living among the people, many could not afford to go school before the ministry of education implemented this program in January 2003. Through the program, every citizen was offered an opportunity to acquire basic education up to Standard eight (equivalent to 8th Grade), although further education past this level still relies on personal resources. Nevertheless, this program has elicited major problems in the education sector which may not have been adequately considered. The available education resources can only adequately support half...";
vol2Extract[6] = "After the Nuremberg and Tokyo war crimes trials punished German and Japanese military officials for violations of international law and laws of war committed during World War II,1 the world waited over forty years without witnessing any other international prosecutions.2 Then, suddenly, in the early 1990s, two ad hoc internationalcriminal courts were created by the Security Council of the United Nations.3 Within nearly a year of one another, Security Council Resolutions created the International Criminal Tribunal for Yugoslavia (ICTY) and the InternationalCriminal Tribunal for Rwanda (ICTR). However, the resultant rebirth of international prosecution of war criminals did not cease with those two temporary courts. In 1998, nearly fifty years...";
vol2Extract[7] = "This essay looks at phone usage in the Southern African Development Community, a regional entity comprised of fourteen countries in Southern Africa (see map, Appendix 1). I choose to concentrate on the SADC because it is a cognizable and well-defined region of Africa with which I have personal experience. Of the fourteen countries in the SADC, I have travelled to eight and secured local mobile phone service in six. Although market penetration within the SADC remains small at just over 9% (see Appendix 2), mobile phone use in Africa as a whole has been growing at a rate of more than 50% per year, higher than that of any other continent (LaFraniere 2005). In addition, mobile phone use in the SADC region outstrips that of landline phones Countries in the SADC vary tremendously with respect to mobile phone use. The percentage of populationusing mobile phones varies from 1% in Malawi...";
vol2Extract[8] = "Sub-Saharan Africa lags the rest of the world in electrification; only 23.5% of the population has access to electricity.  This is particularly alarming because poverty and energy production and consumption are strongly correlated (see Figure 1), though experts debate which factor is the causal force.  The problem is cyclical, as both poverty and lack of energy contribute to the impact of the other.  Sub-Saharan Africa has low purchasing power, which leads to their inability to pay for the adequate energy resources that it needs.  In turn, this lack of energy contributes to current poverty levels.  Many single out energy poverty as the root much of Africa’s problems, because of its pivotal role in efficient daily activity and productive industry.  Substantial time and effort is spent to procure firewood or other forms of biomass for fueling traditional energy sources.  For instance, in rural sub-Saharan Africa, many women carry 20kg of fuel wood an average of 5km each day. (IEA, 2002) Additionally...";
vol2Extract[9] = "International comparisons of school achievement for both primary and secondary education have demonstratedthat African pupils are learning much less than their counterparts in other parts of the world. At the secondary school level, studies have demonstrated that the achievementof African students is particularly low in the key subjects of science and mathematics.Worldwide women choose to enroll in greater proportionsin arts, human studies and social science s than they do in science and mathematics related courses. The origin of this under representation is largely structural, created in and through the social...";


// This function is called from the xhtml file to execute the population
function setUpVolumes()
{
	setUpSelectElem();													// sets up the select element by listing the volumes starting from the oldest to the current
	document.getElementById("sautiVols").options[0].selected = true;	// sets vol1 as the default selected volume
	showArticles(document.getElementById("sautiVols"));					// this is the default list of articles that displays when page loads
}

// This function sets up the select element by setting its options as the volumes starting from the oldest to the current
function setUpSelectElem()
{
	var volumes = "";
	for (var i = 0; i < totalVols; i++)
	{
		volumes += "<option value='volume" + (i+1) + "' >Volume" + (i+1) + "</option>";
	}
	document.getElementById("articlesByVol").innerHTML = "<select id='sautiVols' onchange='showArticles(this)'>" + volumes + "</select> All Sauti Journal Articles by Volumes. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Article Extract";
}

/*
  * This function lists all the articles in the chosen journal volume.
  * 
  */
function showArticles(vol)
{
	//alert(vol.selectedIndex+1);
	var listItem = "";
	var volNum = vol.selectedIndex+1;
	getVolArray(volNum);
	for (var i = 0; i < volArr.length; i++)
	{
		listItem += "<li style='padding: 4px 0;'><a href='html/vol" + volNum + "/article" + (i+1) + ".html' onmouseover='showArticleExtract(this)' style='text-decoration: none' id='articleLink" + i + "'>" + volArr[i] + "</a></li>"
	}
	document.getElementById("volArticles").innerHTML = "<ul style='margin-top: 0; padding-top: 20px;'>" + listItem + "</ul>";
}

// This function displays the article extract in the div (id='xtrctArt')
function showArticleExtract(item)
{
	var index = (item.id).substring(11)*1;		// get index of number by parsing thru id, which has it's latter characters equal to the index of the list item in the ul
	document.getElementById("xtrctArt").innerHTML = xtrctArr[index];
}

// This function picks the array that contains the list items i.e. article titles, for the journal volume selected, and returns that array
function getVolArray(number)
{
	var arr = new Array();	// holds the resulting array from this switch function
	var xarr = new Array();	// holds the resulting array of extracts from this switch function
	switch(number)
	{
		case 1: arr = vol1; xarr = vol1Extract; break;
		case 2: arr = vol2; xarr = vol2Extract; break;
	}
	volArr = arr;				// set volume array to appropriate array
	xtrctArr = xarr;			// set extract array to appropriate array
}