function changemap(input) {
	i_seleccionado = input.selectedIndex
	/* alert(i_seleccionado) */
	t_seleccionado = input.options[i_seleccionado].value
	/* alert(t_seleccionado) */

	Destins =  new Array(9)
	Destins[1] = "Girona Airport"
    Destins[2] = "Tossa de Mar"
    Destins[3] = "Lloret de Mar"
    Destins[4] = "Blanes"
    Destins[5] = "Malgrat de Mar"
    Destins[6] = "Santa Susanna"
	Destins[7] = "Pineda de Mar"
	Destins[8] = "Calella"

	/* alert(Destins[t_seleccionado]) */

	city = '&daddr=' + Destins[t_seleccionado] + ',+Spain'
	url = 'http://maps.google.com/maps?f=d&hl=en&saddr=Aeropuerto+de+Girona,+Spain&ie=UTF8&ll=41.819943,2.795677&spn=0.356156,0.63858&om=1'
	
	/* alert(city) */
	document.getElementById('map').href = url + city ;
	document.getElementById('map').innerHTML = "Map of " + Destins[t_seleccionado]
}

function conditionalsubmit(origen,input) {
	i_seleccionado = input.selectedIndex
	t_seleccionado = input.options[i_seleccionado].value

	/* alert(t_seleccionado) */
	
	if (t_seleccionado > 1) {
		if (origen == 1) {
			actionsubmit('origen')
		} else {
			changemap(input)
		}
	} else {
		actionsubmit('origen')
	}
}

/*function actionsubmit(input) {
	document.getElementById('transform').action = "index.asp" + "?reload=" + input + "#" + input;
	document.getElementById('transform').submit();
}*/

function actionsubmit(input) {
	document.getElementById('transform').action = "?reload=" + input + "#" + input;
	document.getElementById('transform').submit();
}