var xmlHttp;
function showUser(str)
 { 
 xmlHttp=GetXmlHttpObject();
 if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  } 
 var url="responsexml.php";
 url=url+"?q="+str;
 url=url+"&sid="+Math.random();
 xmlHttp.onreadystatechange=stateChanged;
 xmlHttp.open("GET",url,true);
 xmlHttp.send(null);
 }
function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
	
 var xmlDoc=xmlHttp.responseXML;
 
 function so_clearInnerHTML(obj) {
	// perform a shallow clone on obj
	nObj = obj.cloneNode(false);
	// insert the cloned object into the DOM before the original one
	obj.parentNode.insertBefore(nObj,obj);
	// remove the original object
	obj.parentNode.removeChild(obj);
}
so_clearInnerHTML(document.getElementById("Container"));/**/
 
 
 //var x=xmlDoc.firstChild.childNodes;
 var x=xmlDoc.getElementsByTagName( 'carriers' )[0].childNodes;


for (i=0;i<x.length;i++)
{
	
// create a DIV element, using the variable eDIV as a reference to it
eDIV = document.createElement("div");
//use the setAttribute method to assign it an id
eDIV.setAttribute("id","myDiv");
// add the text "hello world" to the div with createTextNode
//eDIV.appendChild(document.createTextNode(xmlDoc.getElementsByTagName('carrier_name')[i].childNodes[0].nodeValue ));

/* */// create your anchor element
//eAnchor = document.createElement("a");
eAnchor = document.createElement("p");
// set its href attribute with the setAttribute method
//eAnchor.setAttribute("href",xmlDoc.getElementsByTagName('link')[i].childNodes[0].nodeValue);
//eAnchor.setAttribute("href",x.length+" /// "+x.nodeValue);
// add the text "hello world" to the anchor element
//eAnchor.setAttribute("target","_blank");
eAnchor.appendChild(document.createTextNode(xmlDoc.getElementsByTagName('carrier_name')[i].childNodes[0].nodeValue));
 // append your newly created anchor element to the div
eDIV.appendChild(eAnchor);

// append your newly created DIV element to an already existing element.
document.getElementById("Container").appendChild(eDIV);

	

} // end loop
	
 
 
 
 } // end connection state
} 
//end function

function GetXmlHttpObject()
 { 
 var objXMLHttp=null;
 if (window.XMLHttpRequest)
  {
	  
	 // If IE7, Mozilla, Safari, etc: Use native object
  objXMLHttp=new XMLHttpRequest();
  }
 else if (window.ActiveXObject)
  {
	// ...otherwise, use the ActiveX control for IE5.x and IE6 
  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 return objXMLHttp;
 }

