function setCountry() {
  var country = window.localStorage.getItem('country');

  // If country is not found in localstorage or default value is selected in
  // drop down menu.
  if ((!country) || country == 'noCountry') {
    // XMLHttpRequest object that tries to load the feed for the purpose of
    // retrieving the country value out of feed.
    var req = new XMLHttpRequest();
    req.onload = handleResponse;
    req.onerror = handleError;
    req.open('GET', DEFAULT_NEWS_URL, true);
    req.send(null);

    // Sets country to default Country in dropdown menu.
    function handleError() {
      $('countryList').value = 'noCountry';
    };

    // Handles parsing the feed data got back from XMLHttpRequest.
    function handleResponse() {
      // Feed document retrieved from URL.
      var doc = req.responseXML;
      if (!doc) {
        handleError();
        return;
      }
      var imageLink = doc.querySelector('image link');
      if (imageLink) {
          // Stores link to set value of country.
          var newsUrl = imageLink.textContent;
      }

      // Stores country value
      $('countryList').value = newsUrl.substring(newsUrl.indexOf('&ned=') + 5,
          newsUrl.indexOf('&hl='));
    };
  } else {
    $('countryList').value = country;
  }
}
Retrieves and sets last saved country from local storage(if found),
else sets country retrieved from feed.