/* load an existing document */
try
	{
    	 document_contact_information = document.implementation.createDocument("","root",null);
  	}
catch(error)
  	{
  	 try  /* Microsoft insist on being fucktards with Internet Explorer; so I have to do this */
    	 	{
  		 document_contact_information = new ActiveXObject("Microsoft.XMLDOM");
    		}
  	 catch(error) 
		{
	        document.write("This page did not load correctly. Here is the error: " + error.message);
	  	}
	}
 	
try
  	{
  	 document_contact_information.async = false;
  	 document_contact_information.load("documents/news.xml");
        post_text(document_contact_information.getElementsByTagName("*"));
  	}
catch(error) 
	{
	 document.write("This page did not load correctly. Here is the error: " + error.message);
	}


function post_text(tag_list)
{
 /* I'm going to format and display all the text within the tags I come across*/
 var element_counter = 0;

 /* Get a directory listing and all images that belong inside of that directory.  List the directory and link the images  */
 do
 {
  document.write("<br/>");
  switch(tag_list[element_counter].nodeName)
  {
   case "contact_information":
    element_counter++;    
   case "name":
    document.write(tag_list[element_counter].nodeName + ":  " + tag_list[element_counter].childNodes[0].nodeValue + "<br />");  
    element_counter++;
    break;    
   case "email_address":
    document.write(tag_list[element_counter].nodeName + ":  <a href=mailto:" + tag_list[element_counter].childNodes[0].nodeValue + ">" + tag_list[element_counter].childNodes[0].nodeValue + "</a><br />");  
    element_counter++;
    break;        
   case "image":
    document.write("<a href=" + tag_list[element_counter].childNodes[0].nodeValue + " target=_blank>" + "<img src=" + tag_list[element_counter].childNodes[0].nodeValue + " /></a> ");
    document.write("<p>" + tag_list[element_counter].childNodes[0].nodeValue + "</p>" + "<br />");
    element_counter++;
    break;
    default:
    document.write(tag_list[element_counter].nodeName + ":  " + tag_list[element_counter].childNodes[0].nodeValue + "<br />");
     element_counter++;
  }  
 }
 while(element_counter < tag_list.length)
}
