function initCalendarAjax()
{
        //function to create and return a XMPHTTP object
        var ajaxCalendarRequest;
        ajaxCalendarRequest = false;
        try
        {
                // create Opera 8.0+/Firefox/Safari XMPHTTP object
                ajaxCalendarRequest = new XMLHttpRequest();
                return ajaxCalendarRequest;
        }
        catch (e)
        {
                // try creating IE object if above fails
                try
                {
                        ajaxCalendarRequest = new ActiveXObject("Msxml2.XMLHTTP");
                        return ajaxCalendarRequest;
                }
                catch (e)
                {

                        try
                        {
                                ajaxCalendarRequest = new ActiveXObject("Microsoft.XMLHTTP");
                        }
                        catch (e)
                        {
                                //browser doesn't support ajax
                                return false;
                        }
                }
        }
        return;
}

function populateCityDropdown(divToUpdate, country, page, city) {

  var url = "/travel-store/citydropdown.php?country="+country+"&page="+page+"&city="+city;
  var conn = initCalendarAjax();
 
  if(!conn) {
    return false;
  }

  conn.onreadystatechange = function() 
  {
    if(conn.readyState == 4)
    {
      if ( conn.responseText != "" )
      {
        document.getElementById(divToUpdate).innerHTML= conn.responseText;
      }
      else
      {
      }
    }
    else
    {
    }
  }

  conn.open("GET", url, true);
  conn.send(null);
}

