// JavaScript Document
	function nuevoAjax(){
		var xmlhttp=false;
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				xmlhttp = false;
			}
		}
	
		if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
			xmlhttp = new XMLHttpRequest();
		}
		return xmlhttp;
	}
	
	function cargarCamarotes(){
		var numcamarotes, camarotes;
		camarotes = document.getElementById('camarotes');
		numcamarotes = document.getElementById('numcamarotes').value;
		capcamarote = document.getElementById('capcamarote').value;
		iditinerario = document.getElementById('iditinerario').value;
		ajax=nuevoAjax();
		ajax.open("GET", "includes/generar-camarotes.php?numcamarotes="+numcamarotes+'&capcamarote='+capcamarote+'&iditinerario='+iditinerario,true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
			camarotes.innerHTML = ajax.responseText
			}
		}
		ajax.send(null)
	}
	
// Mostrar y ocultar edades
function mostrar(num, contador){
  for (i=1;i<6;i++)
    document.getElementById('capa' + i + contador).style.visibility = (i>num) ? 'hidden': 'visible';
}

//Código de Area Intenacional
    function cambiarCodigoInternacional(index) {
      if ( document.getElementById('prefijodomicilio') && codigos ) {
        document.getElementById('prefijodomicilio').value  = codigos[index];
      }
      if ( document.getElementById('prefijodomiciliovisto') && codigos ) {
        document.getElementById('prefijodomiciliovisto').value  = codigos[index];
      }
      if ( document.getElementById('prefijomovil') && codigos ) {
        document.getElementById('prefijomovil').value  = codigos[index];
      }
      if ( document.getElementById('prefijomovilvisto') && codigos ) {
        document.getElementById('prefijomovilvisto').value  = codigos[index];
      }
    }