
//FUNZIONE PER LE LOCALITA' DEL FORM
	/* 
     Script  tratto dal libro "JavaScript and DHTML Cookbook" - Capitolo 8-13
     Pubblicato da O'Reilly & Associates
     Copyright 2003 Danny Goodman
	  Riprodurre questa nota per qualunque riutilizzo del codice.
	*/
var regiondb = new Object()
regiondb["abruzzo"] = [{text:"L'Aquila"},
                      {text:"San Benedetto del Tronto"},
                      {text:"Pescara"},
                      {text:"Chieti"},
                      {text:"Teramo"}];
regiondb["basilicata"] = [{text:"Potenza"},
                      {text:"Matera"}];
regiondb["calabria"] = [{text:"Reggio Calabria"},
                    {text:"Catanzaro"},
                    {text:"Cosenza"},
                    {text:"Crotone"},
                    {text:"Vibo Valentia"}];
regiondb["campania"] = [{text:"Napoli"},
                    {text:"Naples"},
                    {text:"Amalfi Coast"},
                    {text:"Costiera Amalfitana"},
                    {text:"Capri"},
                    {text:"Avellino"},
                    {text:"Benevento"},
                    {text:"Caserta"},
                    {text:"Salerno"}];
regiondb["emilia"] = [{text:"Bologna"},
                    {text:"Bolonia"},
                    {text:"Modena"},
                    {text:"Maranello"},
                    {text:"Fiorano"},
                    {text:"Imola"},
					{text:"Sant'Agata Bolognese"},
                    {text:"Rimini"},
                    {text:"Ferrara"},
                    {text:"Forlì-Cesena"},
                    {text:"Parma"},
                    {text:"Piacenza"},
                    {text:"Ravenna"},
                    {text:"Reggio Emilia"}];
regiondb["friuli"] = [{text:"Udine"},
                       {text:"Trieste"},
                       {text:"Gorizia"},
                       {text:"Pordenone"}];
regiondb["lazio"] = [{text:"Roma"},
                      {text:"Rome"},
                      {text:"Civitavecchia"},
                      {text:"Orte"},
                      {text:"Ostia"},
                      {text:"Vallelunga"},
                      {text:"Viterbo"},
                      {text:"Frosinone"},
                      {text:"Latina"},
                      {text:"Rieti"}];
regiondb["liguria"] = [{text:"Genova"},
                      {text:"Genoa"},
                      {text:"Portofino"},
                      {text:"Sanremo"},
                      {text:"Imperia"},
                      {text:"La Spezia"},
                      {text:"Imperia"}];
regiondb["lombardia"] = [{text:"Milano"},
                      {text:"Milan"},
                      {text:"Lago di Como"},
                      {text:"Lake Como"},
                      {text:"Monza"},
                      {text:"Lago Maggiore"},
                      {text:"Lake Maggiore"},
                      {text:"Lago di Garda"},
                      {text:"Lake Garda"},
                      {text:"Sirmione"},
                      {text:"Brescia"},
                      {text:"Livigno"},
                      {text:"Bergamo"},
                      {text:"Como"},
                      {text:"Cremona"},
                      {text:"Lecco"},
                      {text:"Lodi"},
                      {text:"Mantova"},
                      {text:"Pavia"},
                      {text:"Sondrio"},
                      {text:"Varese"}];
regiondb["marche"] = [{text:"Ancona"},
                      {text:"Ascoli Piceno"},
                      {text:"Macerata"},
                      {text:"Pesaro"},
                      {text:"Urbino"},
                      {text:"Civitanova Marche"}];
regiondb["molise"] = [{text:"Campobasso"},
                      {text:"Isernia"}];
regiondb["piemonte"] = [{text:"Torino"},
                      {text:"Turin"},
                      {text:"Lago Maggiore"},
                      {text:"Lake Maggiore"},
                      {text:"Sestriere"},
                      {text:"Bardonecchia"},
					  {text:"Salice d'Ulzio"},
                      {text:"Sauze d'Oulx"},
                      {text:"Pragelato"},
                      {text:"Asti"},
                      {text:"Alessandria"},
                      {text:"Biella"},
                      {text:"Cuneo"},
                      {text:"Novara"},
                      {text:"Verbania"},
                      {text:"Vercelli"}];
regiondb["puglia"] = [{text:"Bari"},
                       {text:"Golfo del Gargano"},
                       {text:"Vieste"},
                       {text:"Brindisi"},
                       {text:"Foggia"},
                       {text:"Lecce"},
                       {text:"Taranto"}];
regiondb["sardegna"] = [{text:"Cagliari"},
                       {text:"Costa Smeralda"},
                       {text:"Emerald Coast"},
                       {text:"Porto Cervo"},
                       {text:"Santa Teresa di Gallura"},
                       {text:"Olbia"},
					   {text:"Stintino"},
   					   {text:"Caprera"},
   					   {text:"Castelsardo"},
					   {text:"Alghero"},
                       {text:"Nuoro"},
                       {text:"Oristano"},
                       {text:"Sassari"},
                       {text:"Ogliastra"}];
regiondb["sicilia"] = [{text:"Palermo"},
                       {text:"Catania"},
                       {text:"Taormina"},
                       {text:"Etna"},
                       {text:"Agrigento"},
                       {text:"Enna"},
                       {text:"Messina"},
                       {text:"Ragusa"},
                       {text:"Trapani"}];
regiondb["toscana"] = [{text:"Firenze"},
                       {text:"Florence"},
                       {text:"Chianti"},
                       {text:"Pisa"},
                       {text:"Siena"},
                       {text:"Forte dei Marmi"},
                       {text:"Viareggio"},
                       {text:"Versilia"},
                       {text:"Isola d'Elba"},
                       {text:"Elba Island"},
                       {text:"Mugello"},
                       {text:"Orbetello"},
                       {text:"Piombino"},
                       {text:"Poggibonsi"},
                       {text:"Argentario"},
                       {text:"Porto Ercole"},
                       {text:"Porto Santo Stefano"},
                       {text:"Montecatini Terme"},
                       {text:"Pienza"},
                       {text:"Montepulciano"},
                       {text:"Punta Ala"},
                       {text:"Empoli"},
                       {text:"Follonica"},
                       {text:"Arezzo"},
                       {text:"Grosseto"},
                       {text:"Livorno"},
                       {text:"Lucca"},
                       {text:"Massa"},
                       {text:"Pistoia"},
                       {text:"Prato"}];
regiondb["trentino"] = [{text:"Bolzano"},
                       {text:"Madonna di Campiglio"},
                       {text:"San Martino di Castrozza"},
                       {text:"Val di Non"},
                       {text:"Val Gardena"},
                       {text:"Trento"},
                       {text:"Brindisi"},
                       {text:"Foggia"},
                       {text:"Lecce"},
                       {text:"Taranto"}];
regiondb["umbria"] = [{text:"Perugia"},
                       {text:"Terni"},
                       {text:"Orvieto"}];
regiondb["aosta"] = [{text:"Aosta"},
                       {text:"Aoste"},
                       {text:"Courmayeur"},
                       {text:"Gressoney"},
					   {text:"La Thuile"},
                       {text:"Valtournenche"}];
regiondb["veneto"] = [{text:"Venezia"},
                       {text:"Venice"},
                       {text:"Lago di Garda"},
                       {text:"Lake Garda"},
                       {text:"Verona"},
                       {text:"Cortina d’Ampezzo"},
                       {text:"Marmolada"},
                       {text:"Asiago"},
					   {text:"Padova"},
                       {text:"Padua"},
                       {text:"Belluno"},
                       {text:"Rovigo"},
                       {text:"Treviso"},
                       {text:"Vicenza"}];
regiondb["francia"] = [{text:"Costa Azzurra"},
                       {text:"French Riviera"},
                       {text:"Monte-Carlo"},
                       {text:"Monaco"},
                       {text:"Nizza"},
                       {text:"Nice"},
                       {text:"St Tropez"}];
regiondb["svizzera"] = [{text:"Lugano"},
                       {text:"St Moritz"},
                       {text:"Ginevra"},
                       {text:"Geneva"},
                       {text:"Losanna"},
					   {text:"Lausanne"},
                       {text:"Zurigo"},
                       {text:"Zurich"},
                       {text:"Basilea"},
                       {text:"Basel"},
                       {text:"Berna"},
                       {text:"Berne"},
                       {text:"Lucerna"},
                       {text:"Lucerne"},
					   {text:"Interlaken"},
					   {text:"Thun"},
					   {text:"Locarno"}];

function setCities(chooser) {
    var newElem;
    var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
    var cityChooser = chooser.form.elements["città"];
    while (cityChooser.options.length) {
        cityChooser.remove(0);
    }
    var choice = chooser.options[chooser.selectedIndex].value;
    var db = regiondb[choice];
    newElem = document.createElement("option");
//    newElem.text = "";
    newElem.value = "";
    cityChooser.add(newElem, where);
    if (choice != "") {
        for (var i = 0; i < db.length; i++) {
            newElem = document.createElement("option");
            newElem.text = db[i].text;
            newElem.value = db[i].value;
            cityChooser.add(newElem, where);
        }
    }
}
