  
  ////////////////////////////////////////////////////////
  //
  //	Title:    countryflags.js
  //	Project:  EMEA intranet
  //	Description: Code to get the appropriate flag name for countries
  //	Created:  05.06.2007
  //	Author:   Tony Ajoje
  //	Company:  Grey Global Group
  //	Language: JavaScript
  //
  ////////////////////////////////////////////////////////
  
  <!--
  

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

    return code;
  }
  
 
 // add character length

  function formatFlag(flagValue){
	  
  var tmp1 = getFlag(flagValue);
 // var ss = '<img src="images/flags/' + tmp1.toLowerCase +'.gif"' + ' alt="'+ flagValue +'" width="20" height="12">';
 
 var ss = '<img src="images/flags/'+ tmp1.toLowerCase() +'.gif" alt="'+ flagValue.toLowerCase() +'" width="48" height="42" border="0" style="margin-bottom:5px;clear:both;">';

 if(flagValue.toUpperCase()=="EMEA"){
	 ss = '<img src="images/flags/'+ tmp1.toLowerCase() +'.gif" alt="'+ flagValue.toLowerCase() +'" width="90" height="43" border="0" style="margin-bottom:5px;clear:both;">';
 }
 return ss;
  }
  
  //-->