  var x;
   var http_country_request = false;
   function makeCountryRequest(url,strCountry, strType) {
      http_country_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_country_request = new XMLHttpRequest();
         if (http_country_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            http_country_request.overrideMimeType('text/xml');
            //http_country_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_country_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_country_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_country_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
var Parameters = '&country=' + strCountry + '&inputtype=' + strType;
setDropDownValue('inpCountry', strCountry );
setDropDownValue('inpRepresentCountry', strCountry );
      http_country_request.onreadystatechange = RetreiveCountryInfo;
      http_country_request.open('GET', url + Parameters, true);
      http_country_request.send(null);
   }
  function RetreiveCountryInfo() 
{
    if (http_country_request.readyState == 4) {
        if (http_country_request.status == 200) {
      response  = http_country_request.responseXML.documentElement;
var strType = response.getElementsByTagName('inputtype')[0].firstChild.data;
if(strType == 'Country')
{
setDropDownValue('inpPhoneCountry', response.getElementsByTagName('phonecountry')[0].firstChild.data );
setDropDownValue('inpFaxCountry', response.getElementsByTagName('phonecountry')[0].firstChild.data );
setDropDownValue('inpContactPhoneCountry', response.getElementsByTagName('phonecountry')[0].firstChild.data );
//document.getElementById('inpPhoneCountry').value = response.getElementsByTagName('phonecountry')[0].firstChild.data;
//document.getElementById('inpFaxCountry').text = response.getElementsByTagName('phonecountry')[0].firstChild.data;
//document.getElementById('inpContactPhoneCountry').text = response.getElementsByTagName('phonecountry')[0].firstChild.data;
}
if(strType == 'Phone')
{
document.getElementById('inpCountry').text = response.getElementsByTagName('country')[0].firstChild.data;
document.getElementById('inpPhoneCountry').text = response.getElementsByTagName('phonecountry')[0].firstChild.data;
document.getElementById('inpFaxCountry').text = response.getElementsByTagName('phonecountry')[0].firstChild.data;
document.getElementById('inpContactPhoneCountry').text = response.getElementsByTagName('phonecountry')[0].firstChild.data;
}
   }
 }
}
