var url

function changeciudad()
{

var loadialog = "cargando ciudades..."



document.getElementById('ciudades').innerHTML = loadialog;


 url="http://www.asnetservicios.com/cgi-bin/ditgestion/hoteles/rooms.exe/ajaxciudadespais?idpais="+document.getElementById('pais').value
 url=url+"&sid="+Math.random()

 new Ajax.Request(url, { method: 'get', asynchronous: true, 
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { document.getElementById('ciudades').innerHTML = e.responseText; }  
                 }
 });
 
} 



function formedades()
{




document.getElementById('edades').innerHTML = ""


cantidad = document.getElementById('cantidad').value;

hab = document.getElementById('h1').value;

var txt="";
var pos=1;

if (hab=="5") {

   for (i=1; i<=cantidad; i++) {
	txt=txt+'<div id="txtedad'+pos+'">Edad niņo '+i+':</div>';
	txt=txt+'<div id="edad'+pos+'"><select name="edad'+i+'" id="edad'+i+'" class="diass">';
        for (x=2; x<=15; x++) {
        			txt=txt+'<option value="'+x+'">'+x+'</option>';
				}
        txt=txt+'</select></div>';

	if (pos==1) {pos=2}
 	else {pos=1}
	}
   
  document.getElementById('edades').innerHTML = txt;	
     
   }

if (hab=="6") {

  for (i=1; i<=cantidad*2; i++) {
	txt=txt+'<div id="txtedad'+pos+'">Edad niņo '+i+':</div>';
	txt=txt+'<div id="edad'+pos+'"><select name="edad'+i+'" id="edad'+i+'" class="diass">';
        for (x=2; x<=15; x++) {
        			txt=txt+'<option value="'+x+'">'+x+'</option>';
				}
        txt=txt+'</select></div>';

	if (pos==1) {pos=2}
 	else {pos=1}
	}
   
  document.getElementById('edades').innerHTML = txt;	
     
     
   }

if (document.getElementById('edades').innerHTML=="") {document.getElementById('edades').style.display="none";};	
if (document.getElementById('edades').innerHTML!="") {document.getElementById('edades').style.display="block";};	

} 




function getvendedores(obj)
{

var loadialog = "cargando vendedores..."



document.getElementById('capavendedores').innerHTML = loadialog;


 url="http://www.asnetservicios.com/cgi-bin/ditgestion/frontend/frontend.exe/ajaxvendedores?iddelegacion="+obj.value
 url=url+"&sid="+Math.random()

 new Ajax.Request(url, { method: 'get', asynchronous: true, 
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { document.getElementById('capavendedores').innerHTML = e.responseText; }  
                 }
 });
 
} 

