<?php
/*
//http://www.genealogyintime.com/articles/country-guide-to-google-search-engines-page3.html
// engine sufix coresponding to country codes from
//   https://developers.google.com/custom-search/docs/xml_results_appendices#glsp
(function($) {
	var container 	= $('#mainContent2 > table > tbody'),
		rows 		= container.find('> tr');

	function init() {
		var loc = get_locations();
		print( loc );
	};
	init();

	function get_locations() {
		var ret = [];

		rows.each(function(i) {
			var $this = $(this),
				country = $this.find('> td:nth-child(1)').text(),
				engine 	= $this.find('> td:nth-child(2) a').text();

			country = $.trim( country );
			engine = $.trim( engine );
			engine = engine.replace('google.', '');

			if ( country == '' || engine == '' ) return true;

			var __ = {
				'country' 	: country,
				'engine' 	: engine
			};
			ret.push( __ );
		});
		return ret;
	};

	function print( loc ) {
		$.each(loc, function(ii, vv) {
			console.log( "'" + vv.engine + "' => '" + vv.country + "'," + "\n" );
		});
	};
})(jQuery);
*/

// com => us ; cat => doesn't exists!
$google_locations = array(
'com' => 'Google.com (default)',
'com.af' => 'Afghanistan',
'al' => 'Albania',
'dz' => 'Algeria',
'as' => 'American Samoa',
'ad' => 'Andorra',
'co.ao' => 'Angola',
'com.ai' => 'Anguilla',
//'aq' => 'Antarctica',
'com.ag' => 'Antigua and Barbuda',
'com.ar' => 'Argentina',
'am' => 'Armenia',
'ac' => 'Ascension Island',
//'aw' => 'Aruba',
'com.au' => 'Australia',
'at' => 'Austria',
'az' => 'Azerbaijan',
'bs' => 'Bahamas',
'com.bh' => 'Bahrain',
'com.bd' => 'Bangladesh',
//'bb' => 'Barbados',
'com.by' => 'Belarus',
'be' => 'Belgium',
'com.bz' => 'Belize',
'bj' => 'Benin',
//'bm' => 'Bermuda',
'bt' => 'Bhutan',
'com.bo' => 'Bolivia',
'ba' => 'Bosnia and Herzegovina',
'co.bw' => 'Botswana',
//'bv' => 'Bouvet Island',
'com.br' => 'Brazil',
//'io' => 'British Indian Ocean Territory',
'com.bn' => 'Brunei Darussalam',
'bg' => 'Bulgaria',
'bf' => 'Burkina Faso',
'bi' => 'Burundi',
'com.kh' => 'Cambodia',
'cm' => 'Cameroon',
'ca' => 'Canada',
'cv' => 'Cape Verde',
'cat' => 'Catalan Countries',
'ky' => 'Cayman Islands',
'cf' => 'Central African Republic',
'td' => 'Chad',
'cl' => 'Chile',
'cn' => 'China',
//'cx' => 'Christmas Island',
//'cc' => 'Cocos (Keeling) Islands',
'com.co' => 'Colombia',
//'km' => 'Comoros',
'cg' => 'Congo',
'cd' => 'Congo, the Democratic Republic of the',
'co.ck' => 'Cook Islands',
'co.cr' => 'Costa Rica',
'ci' => 'Cote D\'Ivoire',
'hr' => 'Croatia',
'com.cu' => 'Cuba',
'com.cy' => 'Cyprus',
'cz' => 'Czech Republic',
'dk' => 'Denmark',
'dj' => 'Djibouti',
'dm' => 'Dominica',
'com.do' => 'Dominican Republic',
'com.ec' => 'Ecuador',
'com.eg' => 'Egypt',
'com.sv' => 'El Salvador',
//'gq' => 'Equatorial Guinea',
//'er' => 'Eritrea',
'ee' => 'Estonia',
'com.et' => 'Ethiopia',
//'fk' => 'Falkland Islands (Malvinas)',
//'fo' => 'Faroe Islands',
'com.fj' => 'Fiji',
'fi' => 'Finland',
'fr' => 'France',
//'gf' => 'French Guiana',
//'pf' => 'French Polynesia',
//'tf' => 'French Southern Territories',
'ga' => 'Gabon',
'gm' => 'Gambia',
'ge' => 'Georgia',
'de' => 'Germany',
'com.gh' => 'Ghana',
'com.gi' => 'Gibraltar',
'gr' => 'Greece',
'gl' => 'Greenland',
//'gd' => 'Grenada',
'gp' => 'Guadeloupe',
//'gu' => 'Guam',
'com.gt' => 'Guatemala',
'gn' => 'Guinea',
'gg' => 'Guernsey',
//'gw' => 'Guinea-Bissau',
'gy' => 'Guyana',
'ht' => 'Haiti',
//'hm' => 'Heard Island and Mcdonald Islands',
//'va' => 'Holy See (Vatican City State)',
'hn' => 'Honduras',
'com.hk' => 'Hong Kong',
'hu' => 'Hungary',
'is' => 'Iceland',
'co.in' => 'India',
'co.id' => 'Indonesia',
//'ir' => 'Iran, Islamic Republic of',
'iq' => 'Iraq',
'ie' => 'Ireland',
'co.im' => 'Isle of Man',
'co.il' => 'Israel',
'it' => 'Italy',
//'ci' => 'Ivory Coast', //duplicate - see Côte d\'Ivoire
'com.jm' => 'Jamaica',
'co.jp' => 'Japan',
'co.je' => 'Jersey',
'jo' => 'Jordan',
'kz' => 'Kazakhstan',
'co.ke' => 'Kenya',
'ki' => 'Kiribati',
//'kp' => 'Korea, Democratic People\'s Republic of',
'co.kr' => 'Korea, Republic of',
'com.kw' => 'Kuwait',
'kg' => 'Kyrgyzstan',
'la' => 'Lao People\'s Democratic Republic',
'lv' => 'Latvia',
'com.lb' => 'Lebanon',
'co.ls' => 'Lesotho',
//'lr' => 'Liberia',
'com.ly' => 'Libyan Arab Jamahiriya',
'li' => 'Liechtenstein',
'lt' => 'Lithuania',
'lu' => 'Luxembourg',
//'mo' => 'Macao',
'mk' => 'Macedonia, the Former Yugosalv Republic of',
'mg' => 'Madagascar',
'mw' => 'Malawi',
'com.my' => 'Malaysia',
'mv' => 'Maldives',
'ml' => 'Mali',
'com.mt' => 'Malta',
//'mh' => 'Marshall Islands',
//'mq' => 'Martinique',
//'mr' => 'Mauritania',
'mu' => 'Mauritius',
//'yt' => 'Mayotte',
'com.mx' => 'Mexico',
'fm' => 'Micronesia, Federated States of',
'md' => 'Moldova, Republic of',
//'mc' => 'Monaco',
'mn' => 'Mongolia',
'me' => 'Montenegro',
'ms' => 'Montserrat',
'co.ma' => 'Morocco',
'co.mz' => 'Mozambique',
//'mm' => 'Myanmar',
'com.na' => 'Namibia',
'nr' => 'Nauru',
'com.np' => 'Nepal',
'nl' => 'Netherlands',
//'an' => 'Netherlands Antilles',
//'nc' => 'New Caledonia',
'co.nz' => 'New Zealand',
'com.ni' => 'Nicaragua',
'ne' => 'Niger',
'com.ng' => 'Nigeria',
'nu' => 'Niue',
'com.nf' => 'Norfolk Island',
//'mp' => 'Northern Mariana Islands',
'no' => 'Norway',
'com.om' => 'Oman',
'com.pk' => 'Pakistan',
//'pw' => 'Palau',
'ps' => 'Palestinian Territory, Occupied',
'com.pa' => 'Panama',
'com.pg' => 'Papua New Guinea',
'com.py' => 'Paraguay',
'com.pe' => 'Peru',
'com.ph' => 'Philippines',
'pn' => 'Pitcairn',
'pl' => 'Poland',
'pt' => 'Portugal',
'com.pr' => 'Puerto Rico',
'com.qa' => 'Qatar',
//'re' => 'Reunion',
'ro' => 'Romania',
'ru' => 'Russian Federation',
'rw' => 'Rwanda',
'sh' => 'Saint Helena',
//'kn' => 'Saint Kitts and Nevis',
//'lc' => 'Saint Lucia',
//'pm' => 'Saint Pierre and Miquelon',
'com.vc' => 'Saint Vincent and the Grenadines',
'ws' => 'Samoa',
'sm' => 'San Marino',
'st' => 'Sao Tome and Principe',
'com.sa' => 'Saudi Arabia',
'sn' => 'Senegal',
'rs' => 'Serbia',
'sc' => 'Seychelles',
'com.sl' => 'Sierra Leone',
'com.sg' => 'Singapore',
'sk' => 'Slovakia',
'si' => 'Slovenia',
'com.sb' => 'Solomon Islands',
'so' => 'Somalia',
'co.za' => 'South Africa',
//'gs' => 'South Georgia and the South Sandwich Islands',
'es' => 'Spain',
'lk' => 'Sri Lanka',
//'sd' => 'Sudan',
'sr' => 'Suriname',
//'sj' => 'Svalbard and Jan Mayen',
//'sz' => 'Swaziland',
'se' => 'Sweden',
'ch' => 'Switzerland',
//'sy' => 'Syrian Arab Republic',
'com.tw' => 'Taiwan, Province of China',
'com.tj' => 'Tajikistan',
'co.tz' => 'Tanzania, United Republic of',
'co.th' => 'Thailand',
'tl' => 'Timor-Leste',
'tg' => 'Togo',
'tk' => 'Tokelau',
'to' => 'Tonga',
'tt' => 'Trinidad and Tobago',
'tn' => 'Tunisia',
'com.tr' => 'Turkey',
'tm' => 'Turkmenistan',
//'tc' => 'Turks and Caicos Islands',
//'tv' => 'Tuvalu',
'co.ug' => 'Uganda',
'com.ua' => 'Ukraine',
'ae' => 'United Arab Emirates',
'co.uk' => 'United Kingdom',
//'us' => 'United States',
//'um' => 'United States Minor Outlying Islands',
'com.uy' => 'Uruguay',
'co.uz' => 'Uzbekistan',
'vu' => 'Vanuatu',
'co.ve' => 'Venezuela',
'com.vn' => 'Viet Nam',
'vg' => 'Virgin Islands, British',
'co.vi' => 'Virgin Islands, U.S.',
//'wf' => 'Wallis and Futuna',
//'eh' => 'Western Sahara',
//'ye' => 'Yemen',
'co.zm' => 'Zambia',
'co.zw' => 'Zimbabwe',
);
?>