/* --- more intelligent object construct --- */
var CountryData = {DZ: ["Algeria","25,888,000"],
AO: ["Angola","10,609,000"],
BJ: ["Benin",""],
BW: ["Botswana","1,570,000"],
BF: ["Burkina Faso",""],
BI: ["Burundi","5,600,000"],
CM: ["Cameroon",""],
CV: ["Cape Verde Islands",""],
CF: ["Central African Republic",""],
TD: ["Chad",""],
KM: ["Comoros Islands",""],
CG1: ["Congo (1)",""],
CG2: ["Congo (2)",""],
CI: ["Côte d'Ivoire",""],
DJ: ["Djibouti","565,000 "],
EG: ["Egypt","57,110,000"],
GQ: ["Equatorial Guinea",""],
ER: ["Eritrea",""],
ET: ["Ethiopia","51,830,000"],
GA: ["Gabon",""],
GM: ["Gambia","1,033,000"],
GH: ["Ghana","15,635,000"],
GN: ["Guinea",""],
GW: ["Guinea-Bissau",""],
KE: ["Kenya","24,032,000"],
LS: ["Lesotho","1,903,000"],
LR: ["Liberia","2,884,000"],
LY: ["Libya","4,573,000"],
MG: ["Madagascar",""],
MW: ["Malawi","10,580,000"],
ML: ["Mali",""],
MR: ["Mauritania",""],
MU: ["Mauritius",""],
MA: ["Morocco","26,494,000"],
MZ: ["Mozambique",""],
NA: ["Namibia","1,781,000"],
NE: ["Niger",""],
NG: ["Nigeria","88,514,000"],
RE: ["Réunion Island",""],
RW: ["Rwanda","7,491,000"],
ST: ["São Tomé and Príncipe",""],
SC: ["Seychelle","71,000"],
SN: ["Senegal",""],
SL: ["Sierra Leone","4,491,000"],
SO: ["Somalia","8,050,000"],
ZA: ["South Africa","40,716,000"],
SD: ["Sudan","25,000,000"],
SZ: ["Swaziland","814,000"],
TZ: ["Tanzania",""],
TG: ["Togo",""],
TN: ["Tunisia","8,530,000"],
UG: ["Uganda","16,583,000"],
EH: ["Western Sahara",""],
ZM: ["Zambia","7,818,000"],
ZW: ["Zimbabwe","10,687,000"]
};
var isDOM = 0;
var myobj;

function InitSki() {
  if(document.getElementById) {
    myobj = document.getElementById("cntryData");
    isDOM = 1;
  }
  return 1;
}

function Report(cIDs) {
  var fObj = document.noform.mouseovercountry;
  var test = "";
  var linkStr = "";

  // compile report
  test = cIDs.join(', ');
  for (var i=0;i<cIDs.length;i++) {
    var countryCode = cIDs[i];
    if (CountryData[countryCode] != null) {
      var CountryName = CountryData[countryCode][0];
      var CountryEnc = escape(CountryName);
      linkStr += "<br/><a href=\"http://www.google.co.uk/search?q=" + CountryEnc + "\">" + CountryName + "</a>";
    }
  }

  // print out.
  if (isDOM == 1) {
    var htmlStr = "<b>Click on a link to Google for the country:</b><br/>";
    htmlStr += linkStr
    myobj.innerHTML = htmlStr;
  }
  fObj.value = test;
}

function Choose(country) {
  var fObj = document.noform;
  var test;
  if (CountryData[country] != null) {
    fObj.selcountry.value = CountryData[country][0];
    fObj.selcountrypop.value = CountryData[country][1];
    return true;
  }
  return false;
}
