// JavaScript Document
var xmlDoc=null;
if (window.ActiveXObject)
{// code for IE
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
else if (document.implementation.createDocument)
{// code for Mozilla, Firefox, Opera, etc.
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}
if (xmlDoc!=null)
{
xmlDoc.async=false;
xmlDoc.load("../xml/stock-price.xml");

document.write("<table border='0' width='170px'>");

var x=xmlDoc.getElementsByTagName("STOCK");
for (i=0;i<x.length;i++)
{ 
document.write("<tr>");
document.write("<td><b>Close:</b></td>");
document.write("<td align='right'><b>$");
document.write(
x[i].getElementsByTagName("LASTTRADE")[0].childNodes[0].nodeValue);
document.write("</b></td>");
document.write("</tr>");

document.write("<tr>");
document.write("<td>52 Week High:</td>");
document.write("<td align='right'>$");
document.write(
x[i].getElementsByTagName("HIGH")[0].childNodes[0].nodeValue);
document.write("</td>");
document.write("</tr>");

document.write("<tr>");
document.write("<td>52 Week Low:</td>");
document.write("<td align='right'>$");
document.write(
x[i].getElementsByTagName("LOW")[0].childNodes[0].nodeValue);
document.write("</td>");
document.write("</tr>");

document.write("<tr>");
document.write("<td>Shares Out:</td><td align='right'>");
document.write(
x[i].getElementsByTagName("SHAREOUTSTANDING")[0].childNodes[0].nodeValue);
document.write("</td>");
document.write("</tr>");

document.write("<tr>");
document.write("<td colspan='2' align='right'><br>Quote as of <b>");
document.write(
x[i].getElementsByTagName("DATE")[0].childNodes[0].nodeValue);
document.write("</b></td>");
document.write("</tr>");
}
document.write("</table>");
}
