// JavaScript Document

var localRoot = "/"
var testimonialXML
if (window.XMLHttpRequest)
  {
  testimonialXML=new window.XMLHttpRequest()
  testimonialXML.open("GET",localRoot + "xml/testimonials.xml",false)
  testimonialXML.send("")
  testimonialXML=testimonialXML.responseXML
  }
// IE 5 and IE 6
else if (ActiveXObject("Microsoft.XMLDOM"))
  {
  testimonialXML=new ActiveXObject("Microsoft.XMLDOM")
  testimonialXML.async=false
  testimonialXML.load(localRoot + "xml/testimonials.xml")
  }

var testimonialBox = $("testimonialBox")
var quotes = testimonialXML.getElementsByTagName("testimonial")
var htmlString = new Array();
htmlString.push("<img src=" + localRoot + "img/testimonial_icon.png alt=Testimonial Icon style=float:right; margin:-5px 0 0 5px; /><b>Testimonials</b><p>")

var i = Math.floor(Math.random()*(quotes.length))

htmlString.push(quotes[i].getElementsByTagName("quote")[0].childNodes[0].nodeValue)
htmlString.push("</p><p><b>")
htmlString.push(quotes[i].getElementsByTagName("person")[0].childNodes[0].nodeValue)
htmlString.push(", ")
htmlString.push(quotes[i].getElementsByTagName("position")[0].childNodes[0].nodeValue + " ")
htmlString.push("</b><br />")
htmlString.push(quotes[i].getElementsByTagName("company")[0].childNodes[0].nodeValue + " ")
htmlString.push("</p>")

testimonialBox.innerHTML = htmlString.join("");