﻿
var where = new Array(3);
  
function comefrom(loca,locacity) { 
	this.loca = loca; this.locacity = locacity; 
}
  
where[0]= new comefrom("",""); 
where[1] = new comefrom("Canada","|Alberta|British Columbia|Manitoba|New Brunswick|Newfoundland and Labrador|Nova Scotia|Ontario|Prince Edward Island|Québec|Saskatchewan|Northwest Territories|Nunavut|Yukon");  
where[2] = new comefrom("United States","|Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|District of Columbia|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming");  
where[3] = new comefrom("Australia","|Ashmore and Cartier Islands|Australian Antarctic Territory|Australian Capital Territory|Christmas Island|Cocos (Keeling) Islands|Coral Sea Islands Territory|Heard Island and McDonald Islands|Jervis Bay Territory|New South Wales|Norfolk Island|Northern Territory|Queensland|South Australia|Tasmania|Victoria|Western Australia");
where[4] = new comefrom("Italy","|Valle d'Aosta|Piemonte|Liguria|Lombardia|Trentino-Alto Adige|Veneto|Friuli-Venezia Giulia|Emilia-Romagna|Toscana|Umbria|Marche|Lazio|Abruzzo|Molise|Campania|Puglia|Basilicata|Calabria|Sicilia|Sardegna");  

function select() { 
	with(document.getElementById("COUNTRYMAP")) { var loca2 = options[selectedIndex].value; } 
	for(i = 0;i < where.length;i ++) { 
	if (where[i].loca == loca2) { 
	loca3 = (where[i].locacity).split("|"); 
	for(j = 0;j < loca3.length;j++) { with(document.getElementById("PROVINCEMAP")) { length = loca3.length; options[j].text = loca3[j]; options[j].value = loca3[j]; var loca4=options[selectedIndex].value;}} 
	break; 
	}} 
	document.creator.newlocation.value=loca2+loca4; 
} 

function initCountryProvinceMap() {
	if (document.getElementById("COUNTRYMAP").value == "") {
		with(document.getElementById("COUNTRYMAP")) { 
			length = where.length; 
			for(k=0;k<where.length;k++) { options[k].text = where[k].loca; options[k].value = where[k].loca; } 
			options[selectedIndex].text = where[0].loca; 
			options[selectedIndex].value = where[0].loca; 
		}
	}	
	if (document.getElementById("PROVINCEMAP").value == "") {
		with(document.getElementById("PROVINCEMAP")) { 
			loca3 = (where[0].locacity).split("|"); 
			length = loca3.length; 
			for(l=0;l<length;l++) { options[l].text = loca3[l]; options[l].value = loca3[l]; } 
			options[selectedIndex].text = loca3[0]; 
			options[selectedIndex].value = loca3[0]; 
		}
	}
} 

