var countries = new Array (
	"Select country",
	"Afghanistan",
	"Albania",
	"Algeria",
	"American Samoa",
	"Andorra",
	"Angola",
	"Anguilla",
	"Antigua and Barbuda",
	"Argentina",
	"Armenia",
	"Aruba",
	"Australia",
	"Austria",
	"Azerbaijan",
	"Bahamas",
	"Bahrain",
	"Bangladesh",
	"Barbados",
	"Belarus",
	"Belgium",
	"Belize",
	"Benin",
	"Bermuda",
	"Bhutan",
	"Bolivia",
	"Bosnia and Herzegovina",
	"Botswana",
	"Bouvet Island",
	"Brazil",
	"British Indian Ocean Territory",
	"British Virgin Islands",
	"Brunei",
	"Bulgaria",
	"Burkina Faso",
	"Burundi",
	"Cambodia",
	"Cameroon",
	"Canada",
	"Cape Verde",
	"Cayman Islands",
	"Central African Republic",
	"Chad",
	"Chile",
	"China",
	"Christmas Island",
	"Cocos Islands",
	"Colombia",
	"Comoros",
	"Congo - Brazzaville",
	"Congo - Kinshasa",
	"Cook Islands",
	"Costa Rica",
	"Cote d'Ivoire",
	"Croatia",
	"Cuba",
	"Cyprus",
	"Czech Republic",
	"Denmark",
	"Djibouti",
	"Dominica",
	"Dominican Republic",
	"East Timor",
	"Easter Island",
	"Ecuador",
	"Egypt",
	"El Salvador",
	"Equatorial Guinea",
	"Eritrea",
	"Estonia",
	"Ethiopia",
	"Falkland Islands",
	"Faroe Islands",
	"Fiji",
	"Finland",
	"France",
	"French Antilles",
	"French Guiana",
	"French Polynesia",
	"French Southern Territories",
	"Gabon",
	"Gambia",
	"Georgia",
	"Germany",
	"Ghana",
	"Gibraltar",
	"Greece",
	"Greenland",
	"Grenada",
	"Guadeloupe",
	"Guam",
	"Guatemala",
	"Guernsey",
	"Guinea",
	"Guinea-Bissau",
	"Guyana",
	"Haiti",
	"Honduras",
	"Hong Kong",
	"Hungary",
	"Iceland",
	"India",
	"Indonesia",
	"Iran",
	"Iraq",
	"Ireland",
	"Isle of Man",
	"Israel",
	"Italy",
	"Ivory Coast",
	"Jamaica",
	"Japan",
	"Jersey",
	"Jordan",
	"Kazakhstan",
	"Kenya",
	"Kiribati",
	"Kuwait",
	"Kyrgyzstan",
	"Laos",
	"Latvia",
	"Lebanon",
	"Lesotho",
	"Liberia",
	"Libya",
	"Liechtenstein",
	"Lithuania",
	"Luxembourg",
	"Macau",
	"Macedonia",
	"Madagascar",
	"Malawi",
	"Malaysia",
	"Maldives",
	"Mali",
	"Malta",
	"Marshall Islands",
	"Martinique",
	"Mauritania",
	"Mauritius",
	"Mayotte",
	"Mexico",
	"Micronesia",
	"Moldova",
	"Monaco",
	"Mongolia",
	"Montenegro",
	"Montserrat",
	"Morocco",
	"Mozambique",
	"Myanmar",
	"Namibia",
	"Nauru",
	"Nepal",
	"Netherlands",
	"Netherlands Antilles",
	"Nevis",
	"New Caledonia",
	"New Zealand",
	"Nicaragua",
	"Niger",
	"Nigeria",
	"Niue",
	"Norfolk Island",
	"North Korea",
	"Northern Mariana Islands",
	"Norway",
	"Oman",
	"Pakistan",
	"Palau",
	"Palestinian Territory",
	"Panama",
	"Papua New Guinea",
	"Paraguay",
	"Peru",
	"Philippines",
	"Pitcairn",
	"Poland",
	"Portugal",
	"Puerto Rico",
	"Qatar",
	"Reunion",
	"Romania",
	"Russia",
	"Rwanda",
	"Saint Helena",
	"Saint Kitts and Nevis",
	"Saint Lucia",
	"Saint Martin",
	"Saint Pierre and Miquelon",
	"Saint Vincent and the Grenadines",
	"Samoa",
	"San Marino",
	"Sao Tome and Principe",
	"Saudi Arabia",
	"Senegal",
	"Serbia",
	"Seychelles",
	"Sierra Leone",
	"Singapore",
	"Slovakia",
	"Slovenia",
	"Solomon Islands",
	"Somalia",
	"South Africa",
	"South Korea",
	"Spain",
	"Sri Lanka",
	"Sudan",
	"Suriname",
	"Svalbard and Jan Mayen",
	"Swaziland",
	"Sweden",
	"Switzerland",
	"Syria",
	"Taiwan",
	"Tajikistan",
	"Tanzania",
	"Thailand",
	"Togo",
	"Tokelau",
	"Tonga",
	"Trinidad and Tobago",
	"Tunisia",
	"Turkey",
	"Turkmenistan",
	"Turks and Caicos Islands",
	"Tuvalu",
	"Uganda",
	"Ukraine",
	"United Arab Emirates",
	"United Kingdom",
	"United States",
	"Uruguay",
	"Uzbekistan",
	"Vanuatu",
	"Vatican",
	"Venezuela",
	"Vietnam",
	"Virgin Islands, British",
	"Virgin Islands, US",
	"Wake Island",
	"Wallis and Futuna",
	"Yemen",
	"Zambia",
	"Zanzibar",
	"Zimbabwe"
);

var country_codes = new Array();
country_codes["Select country"] = "";
country_codes["Afghanistan"] = "+93";
country_codes["Albania"] = "+355";
country_codes["Algeria"] = "+213";
country_codes["American Samoa"] = "+1684";
country_codes["Andorra"] = "+376";
country_codes["Angola"] = "+244";
country_codes["Anguilla"] = "+1264";
country_codes["Antigua and Barbuda"] = "+1268";
country_codes["Argentina"] = "+54";
country_codes["Armenia"] = "+374";
country_codes["Aruba"] = "+297";
country_codes["Australia"] = "+61";
country_codes["Austria"] = "+43";
country_codes["Azerbaijan"] = "+994";
country_codes["Bahamas"] = "+1242";
country_codes["Bahrain"] = "+973";
country_codes["Bangladesh"] = "+880";
country_codes["Barbados"] = "+1246";
country_codes["Belarus"] = "+375";
country_codes["Belgium"] = "+32";
country_codes["Belize"] = "+501";
country_codes["Benin"] = "+229";
country_codes["Bermuda"] = "+1441";
country_codes["Bhutan"] = "+975";
country_codes["Bolivia"] = "+591";
country_codes["Bosnia and Herzegovina"] = "+387";
country_codes["Botswana"] = "+267";
country_codes["Bouvet Island"] = "+47";
country_codes["Brazil"] = "+55";
country_codes["British Indian Ocean Territory"] = "+246";
country_codes["British Virgin Islands"] = "+1284";
country_codes["Brunei"] = "+673";
country_codes["Bulgaria"] = "+359";
country_codes["Burkina Faso"] = "+226";
country_codes["Burundi"] = "+257";
country_codes["Cambodia"] = "+855";
country_codes["Cameroon"] = "+237";
country_codes["Canada"] = "+1";
country_codes["Cape Verde"] = "+238";
country_codes["Cayman Islands"] = "+1345";
country_codes["Central African Republic"] = "+236";
country_codes["Chad"] = "+235";
country_codes["Chile"] = "+56";
country_codes["China"] = "+86";
country_codes["Christmas Island"] = "+61";
country_codes["Cocos Islands"] = "+61";
country_codes["Colombia"] = "+57";
country_codes["Comoros"] = "+269";
country_codes["Congo - Brazzaville"] = "+242";
country_codes["Congo - Kinshasa"] = "+243";
country_codes["Cook Islands"] = "+682";
country_codes["Costa Rica"] = "+506";
country_codes["Cote d'Ivoire"] = "+225";
country_codes["Croatia"] = "+385";
country_codes["Cuba"] = "+53";
country_codes["Cyprus"] = "+357";
country_codes["Czech Republic"] = "+420";
country_codes["Denmark"] = "+45";
country_codes["Djibouti"] = "+253";
country_codes["Dominica"] = "+1767";
country_codes["Dominican Republic"] = "+1809";
country_codes["East Timor"] = "+670";
country_codes["Easter Island"] = "+56";
country_codes["Ecuador"] = "+593";
country_codes["Egypt"] = "+20";
country_codes["El Salvador"] = "+503";
country_codes["Equatorial Guinea"] = "+240";
country_codes["Eritrea"] = "+291";
country_codes["Estonia"] = "+372";
country_codes["Ethiopia"] = "+251";
country_codes["Falkland Islands"] = "+500";
country_codes["Faroe Islands"] = "+298";
country_codes["Fiji"] = "+679";
country_codes["Finland"] = "+358";
country_codes["France"] = "+33";
country_codes["French Antilles"] = "+596";
country_codes["French Guiana"] = "+594";
country_codes["French Polynesia"] = "+689";
country_codes["French Southern Territories"] = "+596";
country_codes["Gabon"] = "+241";
country_codes["Gambia"] = "+220";
country_codes["Georgia"] = "+995";
country_codes["Germany"] = "+49";
country_codes["Ghana"] = "+233";
country_codes["Gibraltar"] = "+350";
country_codes["Greece"] = "+30";
country_codes["Greenland"] = "+299";
country_codes["Grenada"] = "+1473";
country_codes["Guadeloupe"] = "+590";
country_codes["Guam"] = "+1671";
country_codes["Guatemala"] = "+502";
country_codes["Guernsey"] = "+44";
country_codes["Guinea"] = "+224";
country_codes["Guinea-Bissau"] = "+245";
country_codes["Guyana"] = "+592";
country_codes["Haiti"] = "+509";
country_codes["Honduras"] = "+504";
country_codes["Hong Kong"] = "+852";
country_codes["Hungary"] = "+36";
country_codes["Iceland"] = "+354";
country_codes["India"] = "+91";
country_codes["Indonesia"] = "+62";
country_codes["Iran"] = "+98";
country_codes["Iraq"] = "+964";
country_codes["Ireland"] = "+353";
country_codes["Isle of Man"] = "+44";
country_codes["Israel"] = "+972";
country_codes["Italy"] = "+39";
country_codes["Ivory Coast"] = "+225";
country_codes["Jamaica"] = "+1876";
country_codes["Japan"] = "+81";
country_codes["Jersey"] = "+44";
country_codes["Jordan"] = "+962";
country_codes["Kazakhstan"] = "+7";
country_codes["Kenya"] = "+254";
country_codes["Kiribati"] = "+686";
country_codes["Kuwait"] = "+965";
country_codes["Kyrgyzstan"] = "+996";
country_codes["Laos"] = "+856";
country_codes["Latvia"] = "+371";
country_codes["Lebanon"] = "+961";
country_codes["Lesotho"] = "+266";
country_codes["Liberia"] = "+231";
country_codes["Libya"] = "+218";
country_codes["Liechtenstein"] = "+423";
country_codes["Lithuania"] = "+370";
country_codes["Luxembourg"] = "+352";
country_codes["Macau"] = "+853";
country_codes["Macedonia"] = "+389";
country_codes["Madagascar"] = "+261";
country_codes["Malawi"] = "+265";
country_codes["Malaysia"] = "+60";
country_codes["Maldives"] = "+960";
country_codes["Mali"] = "+223";
country_codes["Malta"] = "+356";
country_codes["Marshall Islands"] = "+692";
country_codes["Martinique"] = "+596";
country_codes["Mauritania"] = "+222";
country_codes["Mauritius"] = "+230";
country_codes["Mayotte"] = "+262";
country_codes["Mexico"] = "+52";
country_codes["Micronesia"] = "+691";
country_codes["Moldova"] = "+373";
country_codes["Monaco"] = "+377";
country_codes["Mongolia"] = "+976";
country_codes["Montenegro"] = "+382";
country_codes["Montserrat"] = "+1664";
country_codes["Morocco"] = "+212";
country_codes["Mozambique"] = "+258";
country_codes["Myanmar"] = "+95";
country_codes["Namibia"] = "+264";
country_codes["Nauru"] = "+674";
country_codes["Nepal"] = "+977";
country_codes["Netherlands"] = "+31";
country_codes["Netherlands Antilles"] = "+599";
country_codes["Nevis"] = "+1869";
country_codes["New Caledonia"] = "+687";
country_codes["New Zealand"] = "+64";
country_codes["Nicaragua"] = "+505";
country_codes["Niger"] = "+227";
country_codes["Nigeria"] = "+234";
country_codes["Niue"] = "+683";
country_codes["Norfolk Island"] = "+672";
country_codes["North Korea"] = "+850";
country_codes["Northern Mariana Islands"] = "+1670";
country_codes["Norway"] = "+47";
country_codes["Oman"] = "+968";
country_codes["Pakistan"] = "+92";
country_codes["Palau"] = "+680";
country_codes["Palestinian Territory"] = "+970";
country_codes["Panama"] = "+507";
country_codes["Papua New Guinea"] = "+675";
country_codes["Paraguay"] = "+595";
country_codes["Peru"] = "+51";
country_codes["Philippines"] = "+63";
country_codes["Pitcairn"] = "+872";
country_codes["Poland"] = "+48";
country_codes["Portugal"] = "+351";
country_codes["Puerto Rico"] = "+1787";
country_codes["Qatar"] = "+974";
country_codes["Reunion"] = " 262";
country_codes["Romania"] = "+40";
country_codes["Russia"] = "+7";
country_codes["Rwanda"] = "+250";
country_codes["Saint Helena"] = "+290";
country_codes["Saint Kitts and Nevis"] = "+1869";
country_codes["Saint Lucia"] = "+1758";
country_codes["Saint Martin"] = "+590";
country_codes["Saint Pierre and Miquelon"] = "+508";
country_codes["Saint Vincent and the Grenadines"] = "+1784";
country_codes["Samoa"] = "+685";
country_codes["San Marino"] = "+378";
country_codes["Sao Tome and Principe"] = "+239";
country_codes["Saudi Arabia"] = "+966";
country_codes["Senegal"] = "+221";
country_codes["Serbia"] = "+381";
country_codes["Seychelles"] = "+248";
country_codes["Sierra Leone"] = "+232";
country_codes["Singapore"] = "+65";
country_codes["Slovakia"] = "+421";
country_codes["Slovenia"] = "+386";
country_codes["Solomon Islands"] = "+677";
country_codes["Somalia"] = "+252";
country_codes["South Africa"] = "+27";
country_codes["South Korea"] = "+82";
country_codes["Spain"] = "+34";
country_codes["Sri Lanka"] = "+94";
country_codes["Sudan"] = "+249";
country_codes["Suriname"] = "+597";
country_codes["Svalbard and Jan Mayen"] = "+47";
country_codes["Swaziland"] = "+268";
country_codes["Sweden"] = "+46";
country_codes["Switzerland"] = "+41";
country_codes["Syria"] = "+963";
country_codes["Taiwan"] = "+886";
country_codes["Tajikistan"] = "+992";
country_codes["Tanzania"] = "+255";
country_codes["Thailand"] = "+66";
country_codes["Togo"] = "+228";
country_codes["Tokelau"] = "+690";
country_codes["Tonga"] = "+676";
country_codes["Trinidad and Tobago"] = "+1868";
country_codes["Tunisia"] = "+216";
country_codes["Turkey"] = "+90";
country_codes["Turkmenistan"] = "+993";
country_codes["Turks and Caicos Islands"] = "+1649";
country_codes["Tuvalu"] = "+688";
country_codes["Uganda"] = "+256";
country_codes["Ukraine"] = "+380";
country_codes["United Arab Emirates"] = "+971";
country_codes["United Kingdom"] = "+44";
country_codes["United States"] = "+1";
country_codes["Uruguay"] = "+598";
country_codes["Uzbekistan"] = "+998";
country_codes["Vanuatu"] = "+678";
country_codes["Vatican"] = "+379";
country_codes["Venezuela"] = "+58";
country_codes["Vietnam"] = "+84";
country_codes["Virgin Islands, British"] = "+1284";
country_codes["Virgin Islands, US"] = "+1340";
country_codes["Wake Island"] = "+1808";
country_codes["Wallis and Futuna"] = "+681";
country_codes["Yemen"] = "+967";
country_codes["Zambia"] = "+260";
country_codes["Zanzibar"] = "+255";
country_codes["Zimbabwe"] = "+263";

// print country list as options in select box
function print_country(country_id) {
	// given the id of the <select> tag as function argument, it inserts <option> tags
	var option_str = document.getElementById(country_id);
	var x, i=0;
	for(x in countries){
		option_str.options[i++] = new Option(countries[x],countries[x]);
	}
}

// print international dialing codes
function print_countrycode() {
	var countrycode_id = document.getElementsByName('country')[0].options[document.getElementsByName('country')[0].selectedIndex].value;
	document.getElementsByName('pcountrycode')[0].value = country_codes[countrycode_id];
	document.getElementsByName('mcountrycode')[0].value = country_codes[countrycode_id];
}

// print price
function print_price() {
	var price_str = document.getElementsByName('country')[0].options[document.getElementsByName('country')[0].selectedIndex].value;
	if (price_str == "Australia")
	{
		document.getElementsByName('price')[0].value = "Life License - A$904.55 excl. GST";
	}
	else
		{
			document.getElementsByName('price')[0].value = "Life License - A$995.00";
		}
}
