var topics = new Array();

topics["Arts & Recreation"] = new Array();
topics["Arts & Recreation"][0] = "Arts";
topics["Arts & Recreation"][1] = "Sport";

topics["Health & Welfare"] = new Array();
topics["Health & Welfare"][0] = "Community";
topics["Health & Welfare"][1] = "Epidemics";
topics["Health & Welfare"][2] = "Health care";
topics["Health & Welfare"][3] = "Quarantine";

topics["International Relations"] = new Array();
topics["International Relations"][0] = "Africa";
topics["International Relations"][1] = "Asia & the Pacific";
topics["International Relations"][2] = "Britain";
topics["International Relations"][3] = "Cold War";
topics["International Relations"][4] = "Europe";
topics["International Relations"][5] = "Global citizen";
topics["International Relations"][6] = "North America";

topics["Labour & Economics"] = new Array();
topics["Labour & Economics"][0] = "Building and construction";
topics["Labour & Economics"][1] = "Manufacturing";
topics["Labour & Economics"][2] = "Primary industry";
topics["Labour & Economics"][3] = "The Depression";

topics["Our Democracy"] = new Array();
topics["Our Democracy"][0] = "Citizenship";
topics["Our Democracy"][1] = "Constitution";
topics["Our Democracy"][2] = "Federation";
topics["Our Democracy"][3] = "Law & Justice";
topics["Our Democracy"][4] = "Parliament";
topics["Our Democracy"][5] = "Referendums";

topics["People & Society"] = new Array();
topics["People & Society"][0] = "Citizenship";
topics["People & Society"][1] = "Education";
topics["People & Society"][2] = "Gender issues";
topics["People & Society"][3] = "Immigration";
topics["People & Society"][4] = "Indigenous issues";
topics["People & Society"][5] = "Multiculturalism";
topics["People & Society"][6] = "People";

topics["Place & Space"] = new Array();
topics["Place & Space"][0] = "Animals";
topics["Place & Space"][1] = "Antarctica";
topics["Place & Space"][2] = "Environment";
topics["Place & Space"][3] = "Transport";

topics["Science & Technology"] = new Array();
topics["Science & Technology"][0] = "Communications";
topics["Science & Technology"][1] = "Frontier science";
topics["Science & Technology"][2] = "Inventions";

topics["War & Peace"] = new Array();
topics["War & Peace"][0] = "Cold War";
topics["War & Peace"][1] = "Conscription";
topics["War & Peace"][2] = "Vietnam War";
topics["War & Peace"][3] = "World War I";
topics["War & Peace"][4] = "World War II";


function changeTopic(field, subtopicfield)
{
   

	subtopic = document.getElementById(subtopicfield);
	subtopic.disabled=false;
	subtopicArray = topics[field.options[field.selectedIndex].text];
	subtopic.options.length = 0;
	//subtopic.options[0] = new Option("Refine topic?","");
	subtopic.options[0] = new Option("All","");
	for (i=0; i < subtopicArray.length; i++)
	{
		subtopic.options[i+1] = new Option(subtopicArray[i],subtopicArray[i]);
	}
	
}

function displaySubTopics(topicField)
{
	field = document.getElementById(topicField);
	subtopic = document.getElementById("topicViewSubtopic");
	subtopicArray = topics[field.options[field.selectedIndex].text];
	subtopic.options.length = 0;
	subtopic.options[0] = new Option("Refine topic?","");
	subtopic.options[1] = new Option("All","");
	for (i=0; i < subtopicArray.length; i++)
	{
		subtopic.options[i+2] = new Option(subtopicArray[i],subtopicArray[i]);
	}
}

function setSubTopic( subtopicField, selectedSubTopic ) {
     for (i=0; i <= subtopicArray.length; i++)
	{
		if ( subtopic.options[i].text == selectedSubTopic )  {	
		    subtopic.options[i].selected = true ;		    
		} 
	}

}