function loadXMLDoc(trk)
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
	var STKadd = document.getElementById('STKno');
	
	if(STKadd.value != "")
		{var trk = "STK_" + STKadd.value;}

    txt="<div id='tracking_center'><table border='1' cellpadding='2' rules='all' frame='box'><tr align='center'><th>STK No.</th><th>Status</th><th>Location</th><th>Cont. No.</th><th>UTS Ref.</th></tr>";
    x=xmlhttp.responseXML.documentElement.getElementsByTagName(trk);
    for (i=0;i<x.length;i++)
      {
      txt=txt + "<tr align='center'>";
      xx=x[i].getElementsByTagName("STKno");
        {
        try
          {
          txt=txt + "<td>" + xx[0].firstChild.nodeValue + "</td>";
          }
        catch (er)
          {
          txt=txt + "<td></td>";
          }
        }
      xx=x[i].getElementsByTagName("Status");
        {
        try
          {
          txt=txt + "<td>" + xx[0].firstChild.nodeValue + "</td>";
          }
        catch (er)
          {
          txt=txt + "<td></td>";
          }
        }
      xx=x[i].getElementsByTagName("Loc");
        {
        try
          {
          txt=txt + "<td>" + xx[0].firstChild.nodeValue + "</td>";
          }
        catch (er)
          {
          txt=txt + "<td></td>";
          }
        }
      xx=x[i].getElementsByTagName("ContNo");
        {
        try
          {
          txt=txt + "<td>" + xx[0].firstChild.nodeValue + "</td>";
          }
        catch (er)
          {
          txt=txt + "<td></td>";
          }
        }
      xx=x[i].getElementsByTagName("HRef");
        {
        try
          {
          txt=txt + "<td>" + xx[0].firstChild.nodeValue + "</td></tr></table><br /><table border='1' cellpadding='2' rules='all' frame='box'><tr align='center'><th>ORG Port</th><th>Vess.-Voy.</th><th>DEP</th></tr>";
          }
        catch (er)
          {
          txt=txt + "<td></td>";
          }
        }
      xx=x[i].getElementsByTagName("ORG");
        {
        try
          {
          txt=txt + "<tr align='center'><td>" + xx[0].firstChild.nodeValue + "</td>";
          }
        catch (er)
          {
          txt=txt + "<td></td>";
          }
        }
      xx=x[i].getElementsByTagName("VESS-VOY");
        {
        try
          {
          txt=txt + "<td>" + xx[0].firstChild.nodeValue + "</td>";
          }
        catch (er)
          {
          txt=txt + "<td></td>";
          }
        }
      xx=x[i].getElementsByTagName("DEP");
        {
        try
          {
          txt=txt + "<td>" + xx[0].firstChild.nodeValue + "</td></tr><tr align='center'><th>DST Port</th><th>ET DST</th><th>ET DLV</th></tr>";
          }
        catch (er)
          {
          txt=txt + "<td></td>";
          }
        }
      xx=x[i].getElementsByTagName("DST");
        {
        try
          {
          txt=txt + "<tr align='center'><td>" + xx[0].firstChild.nodeValue + "</td>";
          }
        catch (er)
          {
          txt=txt + "<td></td>";
          }
        }
      xx=x[i].getElementsByTagName("ETDST");
        {
        try
          {
          txt=txt + "<td>" + xx[0].firstChild.nodeValue + "</td>";
          }
        catch (er)
          {
          txt=txt + "<td></td>";
          }
        }
      xx=x[i].getElementsByTagName("ETDLV");
        {
        try
          {
          txt=txt + "<td>" + xx[0].firstChild.nodeValue + "</td>";
          }
        catch (er)
          {
          txt=txt + "<td></td>";
          }
        }
      txt=txt + "</tr>";
      }
    txt=txt + "</table></div>";
    document.getElementById('txtTrkInfo').innerHTML=txt;
    }
  }
xmlhttp.open("GET",'Tracking/UTStrk.xml',true);
xmlhttp.send();
}
