// JavaScript Document


var regiondb = new Object()
regiondb["abruzzo"] = [{value:"chieti.html", text:"Chieti"},
                      {value:"aquila.html", text:"Aquila"},
                      {value:"pescara.html", text:"Pescara"},
                      {value:"teramo.html", text:"Teramo"}];
regiondb["basilicata"] = [{value:"matera.html", text:"Matera"},
                    {value:"potenza.html", text:"Potenza"}];
regiondb["calabria"] = [{value:"catanzaro.html", text:"Catanzaro"},
						   {value:"cosenza.html", text:"Cosenza"},
						   {value:"crotone.html", text:"Crotone"},
						   {value:"regcalabria.html", text:"Reggio Calabria"},
                          {value:"valentia.html", text:"Vibo valentia"}];
regiondb["campania"] = [{value:"avellino.html", text:"Avellino"},
                      {value:"benevento.html", text:"Benevento"},
                      {value:"caserta.html", text:"Caserta"},
                      {value:"napoli.html", text:"Napoli"},
                      {value:"salerno.html", text:"Salerno"}];
regiondb["emilia"] = [{value:"bologna.html", text:"Bologna"},
                      {value:"ferrara.html", text:"Ferrara"},
                      {value:"forli.html", text:"Forli"},
					  {value:"modena.html", text:"Modena"},
					  {value:"parma.html", text:"Parma"},
					  {value:"piacenza.html", text:"Piacenza"},
					  {value:"ravenna.html", text:"Ravenna"},
					  {value:"regemilia.html", text:"Reggio Emilia"},
					  {value:"rimini.html", text:"Rimini"}];
					  
regiondb["friuli"] = [{value:"gorizia.html", text:"Gorizia"},
                      {value:"pordenone.html", text:"Pordenone"},
					  {value:"trieste.html", text:"Trieste"},
					  {value:"udine.html", text:"Udine"}];
					  
regiondb["lazio"] = [{value:"frosinone.html", text:"Frosinone"},
                      {value:"latina.html", text:"Latina"},
					  {value:"rieti.html", text:"Rieti"},
					  {value:"roma.html", text:"Roma"},
					  {value:"viterbo.html", text:"Viterbo"}];
					  
regiondb["liguria"] = [{value:"genova.html", text:"Genova"},
                      {value:"imperia.html", text:"Imperia"},
					  {value:"spezia.html", text:"La Spezia"},
					  {value:"savona.html", text:"Savona"}];
					  
regiondb["lombardia"] = [{value:"bergamo.html", text:"Bergamo"},
                      {value:"brescia.html", text:"Brescia"},
					  {value:"como.html", text:"Como"},
					  {value:"cremona.html", text:"Cremona"},
					  {value:"lecco.html", text:"Lecco"},
					  {value:"lodi.html", text:"Lodi"},
					  {value:"mantova.html", text:"Mantova"},
					  {value:"milano.html", text:"Milano"},
					  {value:"monza.html", text:"Monza-Brianza"},
					  {value:"pavia.html", text:"Pavia"},
					  {value:"sondrio.html", text:"Sondrio"},
					  {value:"varese.html", text:"Varese"}];
				
regiondb["marche"] = [{value:"ancona.html", text:"Ancona"},
                      {value:"ascoli.html", text:"Ascoli"},
					  {value:"macerata.html", text:"Macerata"},
					  {value:"pesaro.html", text:"Pesaro"}];
					  
regiondb["molise"] = [{value:"campobasso.html", text:"Campobasso"},
                      {value:"isernia.html", text:"Isernia"}];
					  
regiondb["piemonte"] = [{value:"alessandria.html", text:"Alessandria"},
                      {value:"asti.html", text:"Asti"},
					  {value:"biella.html", text:"Biella"},
					  {value:"cuneo.html", text:"Cuneo"},
					  {value:"novara.html", text:"Novara"},
					  {value:"torino.html", text:"Torino"},
					  {value:"verbania.html", text:"Verbania"},
					  {value:"vercelli.html", text:"Vercelli"}];
					  
regiondb["puglia"] = [{value:"bari.html", text:"Bari"},
					{value:"barletta.html", text:"Barletta-Andria-Trani"},
					  {value:"brindisi.html", text:"Brindisi"},
					  {value:"foggia.html", text:"Foggia"},
					  {value:"lecce.html", text:"Lecce"},
					  {value:"taranto.html", text:"Taranto"}];
					  
					  
regiondb["sardegna"] = [{value:"cagliari.html", text:"Cagliari"},
                      {value:"nuoro.html", text:"Nuoro"},
					  {value:"oristano.html", text:"Oristano"},
					  {value:"sassari.html", text:"Sassari"}];
					  
					  
					  
regiondb["sicilia"] = [{value:"agrigento.html", text:"Agrigento"},
                      {value:"caltanisetta.html", text:"Caltanisetta"},
					  {value:"catania.html", text:"Catania"},
					  {value:"enna.html", text:"Enna"},
					  {value:"messina.html", text:"Messina"},
					  {value:"palermo.html", text:"Palermo"},
					  {value:"ragusa.html", text:"Ragusa"},
					  {value:"siracusa.html", text:"Siracusa"},
					  {value:"trapani.html", text:"Trapni"}];
					  
					  
regiondb["toscana"] = [{value:"arezzo.html", text:"Arezzo"},
                      {value:"firenze.html", text:"Firenze"},
					  {value:"grosseto.html", text:"Grosseto"},
					  {value:"livorno.html", text:"Livorno"},
					  {value:"lucca.html", text:"Lucca"},
					  {value:"massa.html", text:"Massa Carrara"},
					  {value:"pisa.html", text:"Pisa"},
					  {value:"pistoia.html", text:"Pistoia"},
					  {value:"prato.html", text:"Prato"},
					  {value:"siena.html", text:"Siena"}];
					  
					  
					  
					  
regiondb["trentino"] = [{value:"bolzano.html", text:"Bolzano"},
                      {value:"trento.html", text:"Trento"}];
					  
					  
regiondb["umbria"] = [{value:"perugia.html", text:"Perugia"},
                      {value:"terni.html", text:"Terni"}];
					  
regiondb["aosta"] = [{value:"aosta.html", text:"Aosta"}];


regiondb["veneto"] = [{value:"belluno.html", text:"Belluno"},
                      {value:"padova.html", text:"Padova"},
					  {value:"rovigo.html", text:"Rovigo"},
					  {value:"treviso.html", text:"Treviso"},
					  {value:"venezia.html", text:"Venezia"},
					  {value:"verona.html", text:"Verona"},
					  {value:"vicenza.html", text:"Vicenza"}];
					  
					  
					  					  
					  
function setCities(chooser) {
    var newElem;
    var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
    var cityChooser = chooser.form.elements["citta"];
    while (cityChooser.options.length) {
        cityChooser.remove(0);
    }
    var choice = chooser.options[chooser.selectedIndex].value;
    var db = regiondb[choice];
    newElem = document.createElement("option");
    newElem.text = "Seleziona una provincia:";
    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);
        }
    }
}




