// JavaScript Document

function loadXMLDoc(url)
{
xmlhttp=null;

if (window.XMLHttpRequest)
  {// code for IE7, Firefox, Opera, etc.
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=alertContents;
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
  }
else
  {
  alert("Your browser does not support XMLHTTP.");
  }

}

function alertContents() 
{
   if(xmlhttp.readyState!=4) 
    {
		return;
	}
	if(xmlhttp.status!=200)
  	{
  		alert("Problem retrieving XML data");
  		return;
  	}

	// get reference to "part" element
	var parts = xmlhttp.responseXML.documentElement.getElementsByTagName("part");
	// now get tour button "item" tags in the part 0
	var tourbutton = parts[0].getElementsByTagName("item");
	// now get label 1 "item" tags in the part 1
	var label1 = parts[1].getElementsByTagName("item");
	// now get label 2 "item" tags in the part 2
	var label2 = parts[2].getElementsByTagName("item");


	//apply URL to Take a Tour button
	//txt='<form class="green_button" onclick="';
	//xy=tourbutton[0].getElementsByTagName("link");
	//txt=txt + xy[0].firstChild.nodeValue + '">';
	
	//alert(txt);
	//document.getElementById('tour_button_copy').innerHTML=txt;

	//fill top label with content
	txt="<ul>";
	for (i=0;i<label1.length;i++)
	  {
	  txt=txt + "<li>";
	  xx=label1[i].getElementsByTagName("description");
 	  xy=label1[i].getElementsByTagName("link");
	    {
	    try
	      {
	      txt=txt + "<a href='" + xy[0].firstChild.nodeValue + "' target='_blank'>" + xx[0].firstChild.nodeValue + "</a>";
	      }
	    catch (er)
	      {
	      txt=txt;
	      }
	    }
	  txt=txt + "</li>";
	  }
	txt=txt + "</ul>";
	document.getElementById('top_label_copy').innerHTML=txt;
	
	//fill bottom label with content
	txt="<ul>";
	for (i=0;i<label1.length;i++)
	  {
	  txt=txt + "<li>";
	  xx=label2[i].getElementsByTagName("description");
 	  xy=label2[i].getElementsByTagName("link");
	    {
	    try
	      {
	      txt=txt + "<a href='" + xy[0].firstChild.nodeValue + "' target='_blank'>" + xx[0].firstChild.nodeValue + "</a>";
	      }
	    catch (er)
	      {
	      txt=txt;
	      }
	    }
	  txt=txt + "</li>";
	  }
	txt=txt + "</ul>";
	document.getElementById('bottom_label_copy').innerHTML=txt;
}


