 var whitespace = " \t\n\r";

 var validateError_fname   = "You must supply a First name";
 var validateError_lname   = "You must supply a Last name";
 var validateError_company = "You must supply a Company";
 var validateError_phone   = "You must supply a Phone number";
 var validateError_email   = "You must supply an Email Address";

 function isEmpty(s)
 { return ((s == null) || (s.length == 0)) }
 
 function isWhitespace (s)
 {
  var i;
  if (isEmpty(s)) return true;
  for (i = 0; i < s.length; i++)
  {
   var c = s.charAt(i);
   if (whitespace.indexOf(c) == -1) return false;
  }
  return true;
 } 

 function ForceValidEmail(val, str) {
  var strInput = new String(val.value);
  if (isWhitespace(strInput)) {
   alert(str);
   return false;
  } else
  return true;
 }


 function ForceEntry(val, str) {
  var strInput = new String(val.value);
  if (isWhitespace(strInput)) {
   alert(str);
   return false;
  } else
  return true;
 }

/* 
  Accepts the ISO 3166 2 lettter country code and returns a Country Short name, 
   in English, as defined by the ISO-3166 standard 
   http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm
*/ 
 function getcountryShortName(val) {
  var countrycode = new String(val.value);
  if (isWhitespace(countrycode)) { return ""; }

  var countryShortName = new Object();
  countryShortName["AF"] = "AFGHANISTAN";
  countryShortName["AX"] = "ÅLAND ISLANDS";
  countryShortName["AL"] = "ALBANIA";
  countryShortName["DZ"] = "ALGERIA";
  countryShortName["AS"] = "AMERICAN SAMOA";
  countryShortName["AD"] = "ANDORRA";
  countryShortName["AO"] = "ANGOLA";
  countryShortName["AI"] = "ANGUILLA";
  countryShortName["AQ"] = "ANTARCTICA";
  countryShortName["AG"] = "ANTIGUA AND BARBUDA";
  countryShortName["AR"] = "ARGENTINA";
  countryShortName["AM"] = "ARMENIA";
  countryShortName["AW"] = "ARUBA";
  countryShortName["AU"] = "AUSTRALIA";
  countryShortName["AT"] = "AUSTRIA";
  countryShortName["AZ"] = "AZERBAIJAN";
  countryShortName["BS"] = "BAHAMAS";
  countryShortName["BH"] = "BAHRAIN";
  countryShortName["BD"] = "BANGLADESH";
  countryShortName["BB"] = "BARBADOS";
  countryShortName["BY"] = "BELARUS";
  countryShortName["BE"] = "BELGIUM";
  countryShortName["BZ"] = "BELIZE";
  countryShortName["BJ"] = "BENIN";
  countryShortName["BM"] = "BERMUDA";
  countryShortName["BT"] = "BHUTAN";
  countryShortName["BO"] = "BOLIVIA";
  countryShortName["BA"] = "BOSNIA AND HERZEGOVINA";
  countryShortName["BW"] = "BOTSWANA";
  countryShortName["BV"] = "BOUVET ISLAND";
  countryShortName["BR"] = "BRAZIL";
  countryShortName["IO"] = "BRITISH INDIAN OCEAN TERRITORY";
  countryShortName["BN"] = "BRUNEI DARUSSALAM";
  countryShortName["BG"] = "BULGARIA";
  countryShortName["BF"] = "BURKINA FASO";
  countryShortName["BI"] = "BURUNDI";
  countryShortName["KH"] = "CAMBODIA";
  countryShortName["CM"] = "CAMEROON";
  countryShortName["CA"] = "CANADA";
  countryShortName["CV"] = "CAPE VERDE";
  countryShortName["KY"] = "CAYMAN ISLANDS";
  countryShortName["CF"] = "CENTRAL AFRICAN REPUBLIC";
  countryShortName["TD"] = "CHAD";
  countryShortName["CL"] = "CHILE";
  countryShortName["CN"] = "CHINA";
  countryShortName["CX"] = "CHRISTMAS ISLAND";
  countryShortName["CC"] = "COCOS (KEELING) ISLANDS";
  countryShortName["CO"] = "COLOMBIA";
  countryShortName["KM"] = "COMOROS";
  countryShortName["CG"] = "CONGO";
  countryShortName["CD"] = "CONGO, THE DEMOCRATIC REPUBLIC OF THE";
  countryShortName["CK"] = "COOK ISLANDS";
  countryShortName["CR"] = "COSTA RICA";
  countryShortName["CI"] = "CÔTE D'IVOIRE";
  countryShortName["HR"] = "CROATIA";
  countryShortName["CU"] = "CUBA";
  countryShortName["CY"] = "CYPRUS";
  countryShortName["CZ"] = "CZECH REPUBLIC";
  countryShortName["DK"] = "DENMARK";
  countryShortName["DJ"] = "DJIBOUTI";
  countryShortName["DM"] = "DOMINICA";
  countryShortName["DO"] = "DOMINICAN REPUBLIC";
  countryShortName["EC"] = "ECUADOR";
  countryShortName["EG"] = "EGYPT";
  countryShortName["SV"] = "EL SALVADOR";
  countryShortName["GQ"] = "EQUATORIAL GUINEA";
  countryShortName["ER"] = "ERITREA";
  countryShortName["EE"] = "ESTONIA";
  countryShortName["ET"] = "ETHIOPIA";
  countryShortName["FK"] = "FALKLAND ISLANDS (MALVINAS)";
  countryShortName["FO"] = "FAROE ISLANDS";
  countryShortName["FJ"] = "FIJI";
  countryShortName["FI"] = "FINLAND";
  countryShortName["FR"] = "FRANCE";
  countryShortName["GF"] = "FRENCH GUIANA";
  countryShortName["PF"] = "FRENCH POLYNESIA";
  countryShortName["TF"] = "FRENCH SOUTHERN TERRITORIES";
  countryShortName["GA"] = "GABON";
  countryShortName["GM"] = "GAMBIA";
  countryShortName["GE"] = "GEORGIA";
  countryShortName["DE"] = "GERMANY";
  countryShortName["GH"] = "GHANA";
  countryShortName["GI"] = "GIBRALTAR";
  countryShortName["GR"] = "GREECE";
  countryShortName["GL"] = "GREENLAND";
  countryShortName["GD"] = "GRENADA";
  countryShortName["GP"] = "GUADELOUPE";
  countryShortName["GU"] = "GUAM";
  countryShortName["GT"] = "GUATEMALA";
  countryShortName["GG"] = "GUERNSEY";
  countryShortName["GN"] = "GUINEA";
  countryShortName["GW"] = "GUINEA-BISSAU";
  countryShortName["GY"] = "GUYANA";
  countryShortName["HT"] = "HAITI";
  countryShortName["HM"] = "HEARD ISLAND AND MCDONALD ISLANDS";
  countryShortName["VA"] = "HOLY SEE (VATICAN CITY STATE)";
  countryShortName["HN"] = "HONDURAS";
  countryShortName["HK"] = "HONG KONG";
  countryShortName["HU"] = "HUNGARY";
  countryShortName["IS"] = "ICELAND";
  countryShortName["IN"] = "INDIA";
  countryShortName["ID"] = "INDONESIA";
  countryShortName["IR"] = "IRAN, ISLAMIC REPUBLIC OF";
  countryShortName["IQ"] = "IRAQ";
  countryShortName["IE"] = "IRELAND";
  countryShortName["IM"] = "ISLE OF MAN";
  countryShortName["IL"] = "ISRAEL";
  countryShortName["IT"] = "ITALY";
  countryShortName["JM"] = "JAMAICA";
  countryShortName["JP"] = "JAPAN";
  countryShortName["JE"] = "JERSEY";
  countryShortName["JO"] = "JORDAN";
  countryShortName["KZ"] = "KAZAKHSTAN";
  countryShortName["KE"] = "KENYA";
  countryShortName["KI"] = "KIRIBATI";
  countryShortName["KP"] = "KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF";
  countryShortName["KR"] = "KOREA, REPUBLIC OF";
  countryShortName["KW"] = "KUWAIT";
  countryShortName["KG"] = "KYRGYZSTAN";
  countryShortName["LA"] = "LAO PEOPLE'S DEMOCRATIC REPUBLIC";
  countryShortName["LV"] = "LATVIA";
  countryShortName["LB"] = "LEBANON";
  countryShortName["LS"] = "LESOTHO";
  countryShortName["LR"] = "LIBERIA";
  countryShortName["LY"] = "LIBYAN ARAB JAMAHIRIYA";
  countryShortName["LI"] = "LIECHTENSTEIN";
  countryShortName["LT"] = "LITHUANIA";
  countryShortName["LU"] = "LUXEMBOURG";
  countryShortName["MO"] = "MACAO";
  countryShortName["MK"] = "MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF";
  countryShortName["MG"] = "MADAGASCAR";
  countryShortName["MW"] = "MALAWI";
  countryShortName["MY"] = "MALAYSIA";
  countryShortName["MV"] = "MALDIVES";
  countryShortName["ML"] = "MALI";
  countryShortName["MT"] = "MALTA";
  countryShortName["MH"] = "MARSHALL ISLANDS";
  countryShortName["MQ"] = "MARTINIQUE";
  countryShortName["MR"] = "MAURITANIA";
  countryShortName["MU"] = "MAURITIUS";
  countryShortName["YT"] = "MAYOTTE";
  countryShortName["MX"] = "MEXICO";
  countryShortName["FM"] = "MICRONESIA, FEDERATED STATES OF";
  countryShortName["MD"] = "MOLDOVA, REPUBLIC OF";
  countryShortName["MC"] = "MONACO";
  countryShortName["MN"] = "MONGOLIA";
  countryShortName["ME"] = "MONTENEGRO";
  countryShortName["MS"] = "MONTSERRAT";
  countryShortName["MA"] = "MOROCCO";
  countryShortName["MZ"] = "MOZAMBIQUE";
  countryShortName["MM"] = "MYANMAR";
  countryShortName["NA"] = "NAMIBIA";
  countryShortName["NR"] = "NAURU";
  countryShortName["NP"] = "NEPAL";
  countryShortName["NL"] = "NETHERLANDS";
  countryShortName["AN"] = "NETHERLANDS ANTILLES";
  countryShortName["NC"] = "NEW CALEDONIA";
  countryShortName["NZ"] = "NEW ZEALAND";
  countryShortName["NI"] = "NICARAGUA";
  countryShortName["NE"] = "NIGER";
  countryShortName["NG"] = "NIGERIA";
  countryShortName["NU"] = "NIUE";
  countryShortName["NF"] = "NORFOLK ISLAND";
  countryShortName["MP"] = "NORTHERN MARIANA ISLANDS";
  countryShortName["NO"] = "NORWAY";
  countryShortName["OM"] = "OMAN";
  countryShortName["PK"] = "PAKISTAN";
  countryShortName["PW"] = "PALAU";
  countryShortName["PS"] = "PALESTINIAN TERRITORY, OCCUPIED";
  countryShortName["PA"] = "PANAMA";
  countryShortName["PG"] = "PAPUA NEW GUINEA";
  countryShortName["PY"] = "PARAGUAY";
  countryShortName["PE"] = "PERU";
  countryShortName["PH"] = "PHILIPPINES";
  countryShortName["PN"] = "PITCAIRN";
  countryShortName["PL"] = "POLAND";
  countryShortName["PT"] = "PORTUGAL";
  countryShortName["PR"] = "PUERTO RICO";
  countryShortName["QA"] = "QATAR";
  countryShortName["RE"] = "REUNION";
  countryShortName["RO"] = "ROMANIA";
  countryShortName["RU"] = "RUSSIAN FEDERATION";
  countryShortName["RW"] = "RWANDA";
  countryShortName["BL"] = "SAINT BARTHÉLEMY";
  countryShortName["SH"] = "SAINT HELENA";
  countryShortName["KN"] = "SAINT KITTS AND NEVIS";
  countryShortName["LC"] = "SAINT LUCIA";
  countryShortName["MF"] = "SAINT MARTIN";
  countryShortName["PM"] = "SAINT PIERRE AND MIQUELON";
  countryShortName["VC"] = "SAINT VINCENT AND THE GRENADINES";
  countryShortName["WS"] = "SAMOA";
  countryShortName["SM"] = "SAN MARINO";
  countryShortName["ST"] = "SAO TOME AND PRINCIPE";
  countryShortName["SA"] = "SAUDI ARABIA";
  countryShortName["SN"] = "SENEGAL";
  countryShortName["RS"] = "SERBIA";
  countryShortName["SC"] = "SEYCHELLES";
  countryShortName["SL"] = "SIERRA LEONE";
  countryShortName["SG"] = "SINGAPORE";
  countryShortName["SK"] = "SLOVAKIA";
  countryShortName["SI"] = "SLOVENIA";
  countryShortName["SB"] = "SOLOMON ISLANDS";
  countryShortName["SO"] = "SOMALIA";
  countryShortName["ZA"] = "SOUTH AFRICA";
  countryShortName["GS"] = "SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS";
  countryShortName["ES"] = "SPAIN";
  countryShortName["LK"] = "SRI LANKA";
  countryShortName["SD"] = "SUDAN";
  countryShortName["SR"] = "SURINAME";
  countryShortName["SJ"] = "SVALBARD AND JAN MAYEN";
  countryShortName["SZ"] = "SWAZILAND";
  countryShortName["SE"] = "SWEDEN";
  countryShortName["CH"] = "SWITZERLAND";
  countryShortName["SY"] = "SYRIAN ARAB REPUBLIC";
  countryShortName["TW"] = "TAIWAN, PROVINCE OF CHINA";
  countryShortName["TJ"] = "TAJIKISTAN";
  countryShortName["TZ"] = "TANZANIA, UNITED REPUBLIC OF";
  countryShortName["TH"] = "THAILAND";
  countryShortName["TL"] = "TIMOR-LESTE";
  countryShortName["TG"] = "TOGO";
  countryShortName["TK"] = "TOKELAU";
  countryShortName["TO"] = "TONGA";
  countryShortName["TT"] = "TRINIDAD AND TOBAGO";
  countryShortName["TN"] = "TUNISIA";
  countryShortName["TR"] = "TURKEY";
  countryShortName["TM"] = "TURKMENISTAN";
  countryShortName["TC"] = "TURKS AND CAICOS ISLANDS";
  countryShortName["TV"] = "TUVALU";
  countryShortName["UG"] = "UGANDA";
  countryShortName["UA"] = "UKRAINE";
  countryShortName["AE"] = "UNITED ARAB EMIRATES";
  countryShortName["GB"] = "UNITED KINGDOM";
  countryShortName["US"] = "UNITED STATES";
  countryShortName["UM"] = "UNITED STATES MINOR OUTLYING ISLANDS";
  countryShortName["UY"] = "URUGUAY";
  countryShortName["UZ"] = "UZBEKISTAN";
  countryShortName["VU"] = "VANUATU";
  countryShortName["VE"] = "VENEZUELA";
  countryShortName["VN"] = "VIET NAM";
  countryShortName["VG"] = "VIRGIN ISLANDS, BRITISH";
  countryShortName["VI"] = "VIRGIN ISLANDS, U.S.";
  countryShortName["WF"] = "WALLIS AND FUTUNA";
  countryShortName["EH"] = "WESTERN SAHARA";
  countryShortName["YE"] = "YEMEN";
  countryShortName["ZM"] = "ZAMBIA";
  countryShortName["ZW"] = "ZIMBABWE";

  if (countryShortName[countrycode]) {
   return countryShortName[countrycode]
  } else
  return "";
 }
 
/* 
  Accepts the ISO 3166 2 lettter country code and returns a region, 
  as defined by the TZ value in the TZDIR/zone.tab file from Linux   
   http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm
   
   Valid regions: 
   "Africa","America", "Antarctic", "Arctic", "Asia", 
   "Atlantic", "Australia", "Europe", "Indian", "Mideast", "Pacific"

*/ 
 function getRegion(val) {
  var countrycode = new String(val.value);
  if (isWhitespace(countrycode)) { return "America"; } 
  if (countrycode == "US") { return "America"; }
   
  var countryRegion = new Object();
  countryRegion["AD"] = "Europe";
  countryRegion["AE"] = "Mideast";
  countryRegion["AF"] = "Asia";
  countryRegion["AG"] = "America";
  countryRegion["AI"] = "America";
  countryRegion["AL"] = "Europe";
  countryRegion["AM"] = "Asia";
  countryRegion["AN"] = "America";
  countryRegion["AO"] = "Africa";
  countryRegion["AR"] = "America";
  countryRegion["AS"] = "Pacific";
  countryRegion["AT"] = "Europe";
  countryRegion["AU"] = "Australia";
  countryRegion["AW"] = "America";
  countryRegion["AX"] = "Europe";
  countryRegion["AZ"] = "Asia";
  countryRegion["BA"] = "Europe";
  countryRegion["BB"] = "America";
  countryRegion["BD"] = "Asia";
  countryRegion["BE"] = "Europe";
  countryRegion["BF"] = "Africa";
  countryRegion["BG"] = "Europe";
  countryRegion["BH"] = "Mideast";
  countryRegion["BI"] = "Africa";
  countryRegion["BJ"] = "Africa";
  countryRegion["BL"] = "America";
  countryRegion["BM"] = "Atlantic";
  countryRegion["BN"] = "Asia";
  countryRegion["BO"] = "America";
  countryRegion["BR"] = "America";
  countryRegion["BS"] = "America";
  countryRegion["BT"] = "Asia";
  countryRegion["BW"] = "Africa";
  countryRegion["BY"] = "Europe";
  countryRegion["BZ"] = "America";
  countryRegion["CA"] = "America";
  countryRegion["CC"] = "Indian";
  countryRegion["CD"] = "Africa";
  countryRegion["CF"] = "Africa";
  countryRegion["CG"] = "Africa";
  countryRegion["CH"] = "Europe";
  countryRegion["CI"] = "Africa";
  countryRegion["CK"] = "Pacific";
  countryRegion["CL"] = "America";
  countryRegion["CL"] = "Pacific";
  countryRegion["CM"] = "Africa";
  countryRegion["CN"] = "Asia";
  countryRegion["CO"] = "America";
  countryRegion["CR"] = "America";
  countryRegion["CU"] = "America";
  countryRegion["CV"] = "Atlantic";
  countryRegion["CX"] = "Indian";
  countryRegion["CY"] = "Mideast";
  countryRegion["CZ"] = "Europe";
  countryRegion["DE"] = "Europe";
  countryRegion["DJ"] = "Africa";
  countryRegion["DK"] = "Europe";
  countryRegion["DM"] = "America";
  countryRegion["DO"] = "America";
  countryRegion["DZ"] = "Africa";
  countryRegion["EC"] = "America";
  countryRegion["EC"] = "Pacific";
  countryRegion["EE"] = "Europe";
  countryRegion["EG"] = "Africa";
  countryRegion["EH"] = "Africa";
  countryRegion["ER"] = "Africa";
  countryRegion["ES"] = "Europe";
  countryRegion["ET"] = "Africa";
  countryRegion["FI"] = "Europe";
  countryRegion["FJ"] = "Pacific";
  countryRegion["FK"] = "Atlantic";
  countryRegion["FM"] = "Pacific";
  countryRegion["FO"] = "Atlantic";
  countryRegion["FR"] = "Europe";
  countryRegion["GA"] = "Africa";
  countryRegion["GB"] = "Europe";
  countryRegion["GD"] = "America";
  countryRegion["GE"] = "Asia";
  countryRegion["GF"] = "America";
  countryRegion["GG"] = "Europe";
  countryRegion["GH"] = "Africa";
  countryRegion["GI"] = "Europe";
  countryRegion["GL"] = "America";
  countryRegion["GM"] = "Africa";
  countryRegion["GN"] = "Africa";
  countryRegion["GP"] = "America";
  countryRegion["GQ"] = "Africa";
  countryRegion["GR"] = "Europe";
  countryRegion["GS"] = "Atlantic";
  countryRegion["GT"] = "America";
  countryRegion["GU"] = "Pacific";
  countryRegion["GW"] = "Africa";
  countryRegion["GY"] = "America";
  countryRegion["HK"] = "Asia";
  countryRegion["HN"] = "America";
  countryRegion["HR"] = "Europe";
  countryRegion["HT"] = "America";
  countryRegion["HU"] = "Europe";
  countryRegion["ID"] = "Asia";
  countryRegion["IE"] = "Europe";
  countryRegion["IL"] = "Mideast";
  countryRegion["IM"] = "Europe";
  countryRegion["IN"] = "Asia";
  countryRegion["IO"] = "Indian";
  countryRegion["IQ"] = "Mideast";
  countryRegion["IR"] = "Mideast";
  countryRegion["IS"] = "Atlantic";
  countryRegion["IT"] = "Europe";
  countryRegion["JE"] = "Europe";
  countryRegion["JM"] = "America";
  countryRegion["JO"] = "Mideast";
  countryRegion["JP"] = "Asia";
  countryRegion["KE"] = "Africa";
  countryRegion["KG"] = "Asia";
  countryRegion["KH"] = "Asia";
  countryRegion["KI"] = "Pacific";
  countryRegion["KM"] = "Indian";
  countryRegion["KN"] = "America";
  countryRegion["KP"] = "Asia";
  countryRegion["KR"] = "Asia";
  countryRegion["KW"] = "Mideast";
  countryRegion["KY"] = "America";
  countryRegion["KZ"] = "Asia";
  countryRegion["LA"] = "Asia";
  countryRegion["LB"] = "Mideast";
  countryRegion["LC"] = "America";
  countryRegion["LI"] = "Europe";
  countryRegion["LK"] = "Asia";
  countryRegion["LR"] = "Africa";
  countryRegion["LS"] = "Africa";
  countryRegion["LT"] = "Europe";
  countryRegion["LU"] = "Europe";
  countryRegion["LV"] = "Europe";
  countryRegion["LY"] = "Africa";
  countryRegion["MA"] = "Africa";
  countryRegion["MC"] = "Europe";
  countryRegion["MD"] = "Europe";
  countryRegion["ME"] = "Europe";
  countryRegion["MF"] = "America";
  countryRegion["MG"] = "Indian";
  countryRegion["MH"] = "Pacific";
  countryRegion["MK"] = "Europe";
  countryRegion["ML"] = "Africa";
  countryRegion["MM"] = "Asia";
  countryRegion["MN"] = "Asia";
  countryRegion["MO"] = "Asia";
  countryRegion["MP"] = "Pacific";
  countryRegion["MQ"] = "America";
  countryRegion["MR"] = "Africa";
  countryRegion["MS"] = "America";
  countryRegion["MT"] = "Europe";
  countryRegion["MU"] = "Indian";
  countryRegion["MV"] = "Indian";
  countryRegion["MW"] = "Africa";
  countryRegion["MX"] = "America";
  countryRegion["MY"] = "Asia";
  countryRegion["MZ"] = "Africa";
  countryRegion["NA"] = "Africa";
  countryRegion["NC"] = "Pacific";
  countryRegion["NE"] = "Africa";
  countryRegion["NF"] = "Pacific";
  countryRegion["NG"] = "Africa";
  countryRegion["NI"] = "America";
  countryRegion["NL"] = "Europe";
  countryRegion["NO"] = "Europe";
  countryRegion["NP"] = "Asia";
  countryRegion["NR"] = "Pacific";
  countryRegion["NU"] = "Pacific";
  countryRegion["NZ"] = "Pacific";
  countryRegion["OM"] = "Mideast";
  countryRegion["PA"] = "America";
  countryRegion["PE"] = "America";
  countryRegion["PF"] = "Pacific";
  countryRegion["PG"] = "Pacific";
  countryRegion["PH"] = "Asia";
  countryRegion["PK"] = "Asia";
  countryRegion["PL"] = "Europe";
  countryRegion["PM"] = "America";
  countryRegion["PN"] = "Pacific";
  countryRegion["PR"] = "America";
  countryRegion["PS"] = "Mideast";
  countryRegion["PT"] = "Europe";
  countryRegion["PW"] = "Pacific";
  countryRegion["PY"] = "America";
  countryRegion["QA"] = "Mideast";
  countryRegion["RE"] = "Indian";
  countryRegion["RO"] = "Europe";
  countryRegion["RS"] = "Europe";
  countryRegion["RU"] = "Europe";
  countryRegion["RW"] = "Africa";
  countryRegion["SA"] = "Mideast";
  countryRegion["SB"] = "Pacific";
  countryRegion["SC"] = "Indian";
  countryRegion["SD"] = "Africa";
  countryRegion["SE"] = "Europe";
  countryRegion["SG"] = "Asia";
  countryRegion["SH"] = "Atlantic";
  countryRegion["SI"] = "Europe";
  countryRegion["SJ"] = "Arctic";
  countryRegion["SK"] = "Europe";
  countryRegion["SL"] = "Africa";
  countryRegion["SM"] = "Europe";
  countryRegion["SN"] = "Africa";
  countryRegion["SO"] = "Africa";
  countryRegion["SR"] = "America";
  countryRegion["ST"] = "Africa";
  countryRegion["SV"] = "America";
  countryRegion["SY"] = "Mideast";
  countryRegion["SZ"] = "Africa";
  countryRegion["TC"] = "America";
  countryRegion["TD"] = "Africa";
  countryRegion["TF"] = "Indian";
  countryRegion["TG"] = "Africa";
  countryRegion["TH"] = "Asia";
  countryRegion["TJ"] = "Asia";
  countryRegion["TK"] = "Pacific";
  countryRegion["TL"] = "Asia";
  countryRegion["TM"] = "Asia";
  countryRegion["TN"] = "Africa";
  countryRegion["TO"] = "Pacific";
  countryRegion["TR"] = "Europe";
  countryRegion["TT"] = "America";
  countryRegion["TV"] = "Pacific";
  countryRegion["TW"] = "Asia";
  countryRegion["TZ"] = "Africa";
  countryRegion["UA"] = "Europe";
  countryRegion["UG"] = "Africa";
  countryRegion["UM"] = "Pacific";
  countryRegion["US"] = "America";
  countryRegion["UY"] = "America";
  countryRegion["UZ"] = "Asia";
  countryRegion["VA"] = "Europe";
  countryRegion["VC"] = "America";
  countryRegion["VE"] = "America";
  countryRegion["VG"] = "America";
  countryRegion["VI"] = "America";
  countryRegion["VN"] = "Asia";
  countryRegion["VU"] = "Pacific";
  countryRegion["WF"] = "Pacific";
  countryRegion["WS"] = "Pacific";
  countryRegion["YE"] = "Mideast";
  countryRegion["YT"] = "Indian";
  countryRegion["ZA"] = "Africa";
  countryRegion["ZM"] = "Africa";
  countryRegion["ZW"] = "Africa";

  if (countryRegion[countrycode]) {
   return countryRegion[countrycode]
  } else
  return "America";
 }



