function initLinkedSelect(from,to) {
	/* Array for storing option text/value pairs */
	var options = new Array();

	for (var i=0; i < to.options.length; i++) {
		/* Save text and value of original options */
		options[i] = new Array(to.options[i].text,to.options[i].value);
	}

	/* When the country selection changes... */
	from.onchange = function() {
		/* The code for the selected country */
		var fromCode = from.options[from.selectedIndex].value;
		var oldTo = new Array();

		/* Save, then remove current options */
		for (var i = 0; i < to.options.length; i++) {
			if (to.options[i].selected) {
				oldTo[oldTo.length] = to.options[i].value;
			}
		}
		to.options.length = 0;
		
		
		for (var j = 0; j < from.options.length; j++) {
			if (from.options[j].selected) {
				/* Run throught all options... */
				for (i = 0; i < options.length; i++) {
					/* If the option starts with the selected country code */
					if (options[i][1].indexOf(from.options[j].value) == 0) {
						/* Add the option to the town select */
						to.options[to.options.length] = new Option(options[i][0],options[i][1]);
						for (var k = 0; k < oldTo.length; k++) {
							if (oldTo[k] == options[i][1]) {
								to.options[((to.options.length)-1)].selected = true;
							}
						}
					}
				}
			}
		}
	
		/* Select the first of the new options */
		//to.options[0].selected = true;
	}

	/* Update the town select now */
	from.onchange();
} 
