function xmlOpen(method, url, toSend, responseHandler)
{
    if (window.XMLHttpRequest)
    {
        req = new XMLHttpRequest();
    }
    else if (window.ActiveXObject)
    {
        req = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    if(req)
    {
    	req.onreadystatechange = responseHandler;
        req.open(method, url , true);        
        req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");        
        req.send(toSend);
    }
    else
    {
        alert('Your browser does not seem to support XMLHttpRequest.');
    }
}




function getNode(parent, tagName)
{
    var i;
    var max = parent.childNodes.length;
    
    // Check each child node
    for(i = 0; i < max; i++)
    {
        if(parent.childNodes[i].tagName)
        {
            if(parent.childNodes[i].tagName.toUpperCase() == tagName.toUpperCase())
            {
                // We found a matching child node; return it.
                alert(parent.childNodes[i]);
            }
        }
    }
    // One was not found; return null
    return null;
}

function Trim(STRING) {
      while (STRING.charAt(0) == " ") {
        STRING = STRING.replace(STRING.charAt(0), "");
      }

      while (STRING.charAt((STRING.length - 1)) == " ") {
        STRING = STRING.substring(0, STRING.length - 1);
      }

      return STRING;
    }