var xmlDoc;
var req;
function loadXML()
{
// code for IE
if (window.ActiveXObject)
{
      req = new ActiveXObject("Microsoft.XMLHTTP");
      if (req) {
          req.onreadystatechange = getmessage;
          req.open("GET", "theatre.xml", true);
          req.send();
      }
  }
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation &&
document.implementation.createDocument)
  {
    req = new XMLHttpRequest();
    req.onreadystatechange = getmessage;
    req.open("GET", "theatre.xml", true);
    req.send(null);
  }
else
  {
  alert('Your browser cannot handle this script');
  }
}

function changeClass(Elem, myClass) {
	var elem;
	if(document.getElementById) {
		var elem = document.getElementById(Elem);
	} else if (document.all){
		var elem = document.all[Elem];
	}
	elem.className = myClass;
}

function DefaultDesc()
{
	changeClass("Desc", "desc_g");

	document.getElementById("Desc").innerHTML= "<b>THEATRE </b> offers unique opportunities for expression as students use body, voice, and mind to convey ideas and emotions.  Students’ imagination is engaged in the most immediate way: characters are developed, settings are conjured, and stories are told.  By it’s very nature, theatre asks that students bring themselves to the experience, and the whole self is incorporated in exercises and exploration, rehearsal and performance. Theatre also has an exceptional capacity to reinforce classroom learning, and encourage cooperation and teamwork. <br />";

}

function LoadDesc(i)
{
	changeClass("Desc", "desc");


	document.getElementById("Desc").innerHTML= "<a name='"+ xmlDoc.getElementsByTagName("Link")[i].childNodes[0].nodeValue + "' class='medium_bold'>" + xmlDoc.getElementsByTagName("Name")[i].childNodes[0].nodeValue + "</a><br /><br />" + xmlDoc.getElementsByTagName("Desc")[i].childNodes[0].nodeValue + "<div style='text-align:right'><br />";

}

function LoadOriginal(num)
{
  var original_desc='';
  changeClass("Desc", "desc");
  
  if(num==0)
  {
  
  original_desc="<b> <a class='medium_bold' name='#original_works'> CREATE! Original Works: From The Pen To The Stage</a></b><br /><br/> In the following residencies, students are guided through the creation of original theatrical works, drawing inspiration from curriculum or other sources. Each student's creative input is encouraged and the final product is a reflection of their efforts. The model for these projects includes theme selection, content development, rehearsal and performance techniques, and the exploration of production elements. <br/><br/> <span class='subsection'> <b>Historical Theater Projects</b> <br /><br/>     Students create an original production, including a completely original script, songs, choreography, scenic and costume design. Based on a selected event in history, students have the opportunity to delve deeply into the characters and social climates of bygone eras. They learn to talk, act and dress like the people they are studying, while simultaneously discovering the magic of stagecraft.</span>";
  
  }
  else if(num==1)
  {
    original_desc="<b> <a class='medium_bold' name='#original_works'> CREATE! Original Works: From The Pen To The Stage</a></b><br /><br/> In the following residencies, students are guided through the creation of original theatrical works, drawing inspiration from curriculum or other sources. Each student's creative input is encouraged and the final product is a reflection of their efforts. The model for these projects includes theme selection, content development, rehearsal and performance techniques, and the exploration of production elements. <br/><br/> <span class='subsection'> <b>Let's Put On A Play!</b> <br /><br/>   Oh, the drama! How often have you looked around the classroom at your marvelous selection of junior thespians, and felt that they belong on a stage, where their dramatic displays would be best appreciated? Designed as an entrée into the theatre for grades K-3, this program is both skill based and fun. Options include staging a work of children's literature, or presenting scenes based on classroom themes.</span>";
  }
  
  else
  {
    original_desc="<b> <a class='medium_bold' name='#original_works'> CREATE! Original Works: From The Pen To The Stage</a></b><br /><br/> In the following residencies, students are guided through the creation of original theatrical works, drawing inspiration from curriculum or other sources. Each student's creative input is encouraged and the final product is a reflection of their efforts. The model for these projects includes theme selection, content development, rehearsal and performance techniques, and the exploration of production elements. <br/><br/> <span class='subsection'> <a href='#original_works'  onclick='LoadOriginal(0);'>Historical Theater Project</a> <br /><br/> <a href='#original_works' onclick='LoadOriginal(1);' >Let's Put On A Play!</b> <br /></span>";
   }
    
  document.getElementById("Desc").innerHTML = original_desc;

}


function getmessage()
{
xmlDoc = req.responseXML;
var x=xmlDoc.getElementsByTagName("Name");

var courses= "";

for (var i=0;i<x.length;i++)

  { 

	courses= courses + "<a name='#'" + xmlDoc.getElementsByTagName("Link")[i].childNodes[0].nodeValue + "' onclick='LoadDesc(" + i + ")'>" + x[i].childNodes[0].nodeValue + "</a> <br />";

  }

  

document.getElementById("Names").innerHTML = courses;

}
