  function XmlHTTP() {
 
    var obj = null;
 
 
    try {
 
      obj = new ActiveXObject("Msxml2.XMLHTTP");
 
    } catch(e) {
 
      try {
 
        obj = new ActiveXObject("Microsoft.XMLHTTP");
 
      } catch(oc){
 
        obj = null;
 
      }
 
    }
 
    if(!obj&&typeof XMLHttpRequest!= "undefined") {
 
      obj = new XMLHttpRequest();
 
    } 
 
    return obj;    
 
  }
 

 

function ClearDropdown(sForm, sElement) {
 
  var deleteIndex;
 
  while (document.forms['' + sForm + ''].elements['' + sElement + ''].options.length > 0) {
 
     deleteIndex=document.forms['' + sForm + ''].elements['' + sElement + ''].options.length - 1;
 
     document.forms['' + sForm + ''].elements['' + sElement + ''].options[deleteIndex] = null;
 
  }                    
 
}
 

       

function LoadDropdown(sForm, sElement, sData) {
 
  var myOption, iLoop, insertIndex, sPair, myOptions;      
 
  myOptions = sData.split("||");
 
  for (iLoop = 0; iLoop < myOptions.length; iLoop++) {
 
    sPair = myOptions[iLoop].split("|");
 
    myOption=new Option();
 
    myOption.text= sPair[1];
 
    myOption.value= sPair[0];
 
    if (document.forms['' + sForm + ''].elements['' + sElement + ''].selectedIndex > 0) {
 
       insertIndex = document.forms['' + sForm + ''].elements['' + sElement + ''].selectedIndex;
 
    } else {
 
       insertIndex = document.forms['' + sForm + ''].elements['' + sElement + ''].options.length;
 
    }
 
           
 
    document.forms['' + sForm + ''].elements['' + sElement + ''].options[insertIndex] = myOption;    
 
  }
 
}
 

