function getNodeValue( aoxml, asTagName , aiIndex ) {
    try 
    {
        return aoxml.getElementsByTagName(asTagName)[aiIndex].firstChild.nodeValue;
    } 
    catch ( e ) {
        return "";
    }
}

function getNodeLen( aoxml, asTagName ) {
    try {
        return aoxml.getElementsByTagName( asTagName ).length ;
    } 
    catch( e ) 
    {
        return 0 ;
    }
}

function LoadXml(xml) {
    var xmlDoc
    if (window.ActiveXObject)
    {
      xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
      xmlDoc.async=false;
      xmlDoc.loadXML(xml);
      

    }
    // code for Mozilla, etc.
    else if (document.implementation && document.implementation.createDocument)
    {
      xmlDoc= document.implementation.createDocument("","",null);
      xmlDoc.loadXML(xml);

     }
     return  xmlDoc
}


function GetXml(xml) {
    var xmlDoc
    if (window.ActiveXObject)
    {
      xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
      xmlDoc.async=false;
      xmlDoc.load(xml);
      

    }
    // code for Mozilla, etc.
    else if (document.implementation && document.implementation.createDocument)
    {
      xmlDoc= document.implementation.createDocument("","",null);
      xmlDoc.load(xml);

     }
     return  xmlDoc
}
