
function mostrar_menu_idiomas(estado)
{
	if(estado==1) //desplegado
	{
		document.getElementById("idioma_seleccionado").style.display = "none";
		document.getElementById("lista_idiomas").style.display = "block";
	}
	else
	{
		document.getElementById("idioma_seleccionado").style.display = "block";
		document.getElementById("lista_idiomas").style.display = "none";
	}
}

function buscar()
{
	var res = validarForm("fBuscador"
		,"BUS_fecha_salida","F.Salida","D",""
		,"BUS_fecha_fin","F.Llegada","D",""
		,"precio_desde","Precio","N",""
		,"num_cabinas","NºCabinas","N",""
		);	
	if (res)	
		document.fBuscador.submit();
}

function enviar()
{
	var res = validarForm("fEnviar"
		,"nombre","Nombre","T","R"
		,"mail","Mail","E","R"
		,"fecha_salida","Fecha de salida","DP",""
		,"fecha_fin","Fecha finalización alquiler","DP","fecha_salida"
		,"security_code","Imagen de seguridad","T","R"
		);	
	return res;
}
function actualizarPais()
{
	var pai_id = "";
	var pos;

	pos = document.fEnviar.pai_id.selectedIndex;
	if(pos>0)
		pai_id = document.fEnviar.pai_id.options[pos].value;
	else return;
		
	var aux = "/reg_act.php?loc_field_name=loc_id&reg_id="+pai_id;

	
	advAJAX.get({
	  url: aux,
  	onSuccess : function(obj) { document.getElementById('div_localizacion').innerHTML = obj.responseText; },
  	onError : function(obj) { alert("Error: " + obj.status); }
	});
}	

function ordenar(pOrden, pDireccion)
{
	document.fLista.orden.value = pOrden;
	document.fLista.action = "lista.php";
	document.fLista.submit();
}

function irPag(pPag)
{
	document.fLista.pag.value = pPag;
	document.fLista.action = "lista.php";
	document.fLista.submit();
}

function opcion(pOpcion)
{
	if(pOpcion=='0')
	{
		document.getElementById("content_introduccion").style.display = "block";
		document.getElementById("content_equipamiento").style.display = "none";
		document.getElementById("content_precios").style.display = "none";
	}
	if(pOpcion=='1')
	{
		document.getElementById("content_introduccion").style.display = "none";
		document.getElementById("content_equipamiento").style.display = "block";
		document.getElementById("content_precios").style.display = "none";
	}
	if(pOpcion=='2')
	{
		document.getElementById("content_introduccion").style.display = "none";
		document.getElementById("content_equipamiento").style.display = "none";
		document.getElementById("content_precios").style.display = "block";
	}
}