var URLStartPath="http://" + window.location.host;
function CallwebService(URL,inputXML)
{

    var SoapXML='<?xml version="1.0"?>'
    SoapXML += inputXML
  
    var result = null;
    var callBack =getAjax(); 
    if(callBack)
    {
        try
        {
            callBack.open('POST',URL, false); 
            if(SoapXML==null)SoapXML=''; 
            callBack.setRequestHeader('Content-Type','text/xml'); 
            callBack.send(SoapXML); 
            return callBack.responseText;
        }
        catch(e)
        {   
            return null;
        } 

        callBack = null;
    } 
    else
    {
        if(isDebug)alert('Dev Debug error: callBack is false'); 
    } 
    return result; 
}

function FillxmlIntoDropDown(xmlString,DropDownList)
{
        try 
        {
          xmldoc=new ActiveXObject("MSXML2.DOMDocument.3.0");
           xmldoc.async="true";
           xmldoc.loadXML(xmlString);
        }
       catch(e)
        {
        try 
         {
           parser=new DOMParser();
           xmldoc=parser.parseFromString(xmlString,"text/xml");
         }
         catch(e)
         {
          alert(e.message);
         return;
         }
       }

    
        DropDownList.innerText = '';
        if (window.ActiveXObject)
        {
            if (xmldoc !=null && xmldoc.documentElement.childNodes.length > 0)
            {
            var innHtm = '';

            for(i =0; i < xmldoc.documentElement.childNodes.length; i++)
            { 

            var  key = xmldoc.documentElement.childNodes[i].attributes[0].text;
            var  text = xmldoc.documentElement.childNodes[i].attributes[1].text;


            innHtm = innHtm + '<Option value="' + key + '">' + text + '</Option>';
            
            
            DropDownList.options.add(new Option(text,key));
            }
            }

        }
        else if (document.implementation && document.implementation.createDocument)
        {
                if (xmldoc !=null && xmldoc.documentElement.childNodes.length > 0)
                {
                var innHtm = '';

                for(i =1; i <= xmldoc.documentElement.childNodes.length;)
                { 

                var  key = xmldoc.documentElement.childNodes[i].attributes[0].nodeValue;
                var  text = xmldoc.documentElement.childNodes[i].attributes[1].nodeValue;


                innHtm = innHtm + '<Option value="' + key + '">' + text + '</Option>';

                i=i+2;
               
                DropDownList.options.add(new Option(text,key));
                }
                
                }
                
         }
    
    
   
    
    
}

function DoRequest(url, urlParmString)
 {
  var result = null;
  var callBack = 'XMLHTTP'; 
  if(callBack)
  {
    try
    {
        callBack.open('POST', url, true);
        if(urlParmString==null)urlParmString=''; 
        callBack.setRequestHeader('Content-Type','text/xml'); 
        callBack.send(urlParmString); 
        return callBack.responseXML
     }
    catch(e)
    {   
        return null;
    } 
 
     callBack = null;
   } 
   else
   {
     if(isDebug)alert('Dev Debug error: callBack is false'); 
   } 
    return result; 
 }
 
 function getAjax()
 {
    var XmlHttp;
	
	//Creating object of XMLHTTP in IE
	try
	{
		XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttp = null;
		}
	}
	//Creating object of XMLHTTP in Mozilla and Safari 
	if(!XmlHttp && typeof XMLHttpRequest != "undefined") 
	{
	   
		XmlHttp = new XMLHttpRequest();
	}
	
	return XmlHttp;
 }
 
 
 
function getXmlInnerText(xmlString)
{
        try 
        {
          xmldoc=new ActiveXObject("MSXML2.DOMDocument.3.0");
           xmldoc.async="true";
           xmldoc.loadXML(xmlString);
        }
       catch(e)
        {
        try 
         {
           parser=new DOMParser();
           xmldoc=parser.parseFromString(xmlString,"text/xml");
         }
         catch(e)
         {
          alert(e.message);
         return;
         }
       }
        if (window.ActiveXObject)
        {
            if (xmldoc !=null && xmldoc.documentElement.childNodes.length > 0)
            {
            var innHtm = '';

            for(var i =0; i < xmldoc.documentElement.childNodes.length; i++)
            { 
            innHtm = innHtm +  xmldoc.documentElement.childNodes[i].attributes[1].text;
            }
            }
            return innHtm;

        }
        else if (document.implementation && document.implementation.createDocument)
        {
                if (xmldoc !=null && xmldoc.documentElement.childNodes.length > 0)
                {
                var innHtm = '';
                for(var i=1; i <= xmldoc.documentElement.childNodes.length;)
                { 
                innHtm = innHtm + xmldoc.documentElement.childNodes[i].attributes[1].nodeValue;
                i=i+2;
                if((xmldoc.documentElement.childNodes.length == i) || (xmldoc.documentElement.childNodes.length <i))
                {
                   return innHtm;
                } 

                }
                
                }
         }

    
    
}
