var goSelect
function updateSelect(form, psCriteria,poSelect) {
  goSelect=poSelect
  var strCommaDelimList=getServerData(psCriteria);
  if(!strCommaDelimList)
    form.submit();
}
function getServerData(psCriteria) {
  goSelect.disabled=true;
  document.body.style.cursor='wait';
  goSelect.options[0]=new Option("Loading...","0");
  try{
    try{
      xmlhttp=new XMLHttpRequest();
    }
    catch(e) {
      var XMLHTTP_IDS=new Array(
      'MSXML2.XMLHTTP.5.0',
      'MSXML2.XMLHTTP.4.0',
      'MSXML2.XMLHTTP.3.0',
      'MSXML2.XMLHTTP',
      'Microsoft.XMLHTTP' );
      var success=false;
      for (var i=0;i < XMLHTTP_IDS.length && !success;i++) {
        try {
        xmlhttp=new ActiveXObject(XMLHTTP_IDS[i]);
        success=true;
        } catch (e) {}
      }
      if (!success) {
        try{
        xmlhttp=new HTML_AJAX_IframeXHR();
        } catch(e) {
          alert('Sorry. We are unable to load xml file. Please try again later.');
        }
      }
    }
    if(xmlhttp==null)
      return false;

    xmlhttp.open("GET", '/lib/ajax/country.php?country_id='+psCriteria,true);
    xmlhttp.onreadystatechange=function(){
      if(xmlhttp.readyState==4){
        var elName=xmlhttp.responseXML.getElementsByTagName('region');
        if (elName.length > 0 ) {
          goSelect.options.length=0;
          //goSelect.options[0]=new Option("Select City/State","");
          for(var i=0;elName[i];i++){
            var t=elName[i].getAttribute('text');
            var v=elName[i].getAttribute('value');
            goSelect.options.length++;
            goSelect.options[goSelect.options.length-1]=new Option(t,v);
          }
        }
        else{
          goSelect.options.length=0;
          goSelect.options[0]=new Option("State / Province / Region Not Found",0);
        }
        document.body.style.cursor='auto';
        goSelect.disabled=false;
        xmlhttp=null
      }
      else{
        goSelect.options.length=0
        goSelect.options[0]=new Option("Loading in progress...","0");
      }
    };
    xmlhttp.send('');
  }
  catch (e) {
    alert("Server is not available at this time to process your request.");
  }
  return true;
}