function writeName() {
	var term = queryField("term");
	document.write(term);
}

function writeDef() {
	var term = queryField("term");
	viewTerm(term);
}
	

termArray1 = new Array(
"pobusang",
"yangban",
"munkwa",
"kisaeng",
"kwangi",
"naeoe",
"sodang",
"mansin",
"kut",
"amhaeng osa",
"ma-pae",
"cangue",
"chungin",
"sangmin",
"chonmin",

"Neo-Confucianism",
"Brotherhood of Nations",
"five Confucian relationships",
"King Kojong",
"the Taewongun",
"extraterritoriality",
"most favored nation status",
"good offices",
"suzerainty"
);

termArray3 = new Array(
"pobusang",
"yangban",
"munkwa",
"kisaeng",
"kwangi",
"naeoe",
"sodang",
"mansin",
"kut",
"amhaeng osa",
"ma-p'ae",
"cangue",
"chung'in",
"sangmin",
"ch'onmin",

"Neo-Confucianism",
"Brotherhood of Nations",
"five Confucian relationships",
"King Kojong",
"the Taewon'gun",
"extraterritoriality",
"most favored nation status",
"good offices",
"suzerainty"
);


termArray2 = new Array(
							 "Traveling peddler who brought news as well " +
                             "as goods to villages. Often used by the King as " +
                             "information gatherers and agents.",

                             "Korean nobility. Scholar-officials who "+
                             "ran the government and military. Yangban was a "+
                             "hereditary class, but one could move ahead of "+
                             "one's parents through great study and the passing "+
                             "of rigorous Confucian exams.",
							 
                              "The highest Confucian civil exam.",
							  
                             "Female entertainer belonging to the ch'onmin class. "+
                             "Often used as a vehicle for political dissension. "+
                             "Kisaengs' sons, regardless of their patrimony, "+
                             "were not allowed to sit for high-level Confucian "+
                             "exams.",
							 
                             "Royal, or government kisaeng, trained "+
                             "specifically in schools for service to the court "+
                             "and military.",
							 
                             "The sex segregation code of Choson culture.",
							 
                              "The private yangban elementary school.",
							  
                             "Korean shaman. These women occupied the "+
                             "lowest social class in Choson Korea, but held "+
                             "tremendous spiritual and oftentimes financial "+
                             "power.",
							 
                              "Ceremony, often an exorcism, performed by "+
                             "shamans for people of all classes. The kut was "+
                             "used to dispel pesky ghosts or demons, and restore "+
                             "good fortune to a family or individual.",
							 
                              "Royal secret inspector envoy, used "+
                             "by the king to secretly police his magistrates "+
                             "and ensure no abuse of power was taking place "+
                             "in the provinces.",
							 
                             "Amhaeng osa's badge of office, literally "+
                             "&quot;horse badge,&quot; typically made of bronze. This badge functioned as a traveling passport.",
							 
                             "Square, wooden restraint that closed around "+
                             "a prisoner's neck, similar to western stocks.",

                             "Middle people, consisting of clerks and "+
                             "technical specialists such as doctors, scribes, "+
                             "accountants and astronomers.",
							 
                             "Commoners, or the lower-middle class, "+
                             "consisting of merchants, artisans, and farmers.",
                             
							 "Humble people, consisting of private "+
                             "and public slaves, such as kisaengs and court "+
                             "slaves.",
							 
							 //Lesson2

                              "The resurgence and integration "+
                             "of Confucian philosophy into all aspects of social "+
                             "and political spheres.",
							 
                             "The unequal relationship between brother countries, "+
                             "where China held the 'big brother' position and all "+
                             "other neighboring countries the 'little brother' positions.  "+
                             "These relationships guided their political dealings in accordance with the five Confucian relationships. ",
							 
                              "Ruler-subject, father-son, "+
                             "husband-wife, elder brother-younger brother, and "+
                             "friend-friend.",
							 
                              "Korea's ruler from 1873 until "+
                             "the Japanese annexation in 1910.",
							 
                              "Kojong's father and Regent, who "+
                             "was staunchly anti-Western. The Regent attempted "+
                             "to oust Kojong and replace him with his other "+
                             "son, Kojong's half-brother, but was defeated with "+
                             "China's intervention.",
							 
                             "The right of foreign nationals "+
                             "accused of crimes to be represented by representatives "+
                             "from their own country, and tried under their "+
                             "native laws.",
                              
							 "Treaty clause indicating " +
                             "that any future trade agreements or treaties made "+
                             "between countries will automatically confer their "+
                             "benefits to the pre-existing most favored nation.",
							 
                             "Treaty clause that had vastly different "+
                             "interpretations. The US introduced the language "+
                             "as simply a token of friendship; the Chinese and "+
                             "Korean negotiators took it as a binding pledge "+
                             "of &quot;elder brother&quot; protection on the "+
                             "part of the US.",
							 
                              "Tributary relations between countries. "+
                             "While retaining an independent national identity, "+
                             "a tributary nation sent monetary and political "+
                             "propitiations to its sovereign nation, which in "+
                             "turn refrained from military advances, and, in "+
                             "some cases, offered protection to the weaker country."
);
							 
function viewTerm(whichTerm) {
	var notfound = true;
	for(i=0; i<termArray1.length; i++) {
		if (termArray1[i] == whichTerm) {
			document.write(termArray2[i]);
			notfound = false
		}
	}
	if (notfound) {
		document.write("Term not defined");
	}
}


function viewName(whichTerm) {
	var notfound = true;
	for(i=0; i<termArray1.length; i++) {
		if (termArray1[i] == whichTerm) {
			document.write(termArray3[i]);
			notfound = false
		}
	}
	if (notfound) {
		document.write("Term not defined");
	}
}