function changeCiudadA(index)
{
	document.frmtriplejs.DireccionA.value="";
	document.frmtriplejs.TelefonosA.value=""; 
          
// Coloca en Blanco las Agencias
	document.frmtriplejs.DireccionA.value="";
	document.frmtriplejs.TelefonosA.value=""; 
	len2=document.frmtriplejs.lstagencia.length;
       
        for (Col=len2;Col>0;Col--)
        {
   	    document.frmtriplejs.lstagencia.options[Col-1]=null;
        } 
         document.frmtriplejs.lstagencia.length=0;
         document.frmtriplejs.lstagencia.options[0]=new Option("---------------------");
         document.frmtriplejs.lstagencia.selectedIndex=0;
// FIN 

	  if (index == 0){
              document.frmtriplejs.lstciudad.length=0;    
              document.frmtriplejs.lstciudad.options[0]=new Option("---------------------");
              document.frmtriplejs.lstciudad.selectedIndex=0;
              return;
            }
            
              len=document.frmtriplejs.lstciudad.length;
              for (Col=len;Col>0;Col--)
              {
   	          document.frmtriplejs.lstciudad.options[Col-1]=null;
              } 
              
          len=ArrProd[index-1].length;        
          document.frmtriplejs.lstciudad.length=0;
          document.frmtriplejs.lstciudad.options[0]=new Option("---------------------");
          document.frmtriplejs.lstciudad.selectedIndex=0;

        
        var firstSubscript = document.frmtriplejs.lstestado.selectedIndex - 1;
        for(Col=1;Col<len;Col++)
         {
          document.frmtriplejs.lstciudad.options[Col]=new Option(ArrProd[firstSubscript][Col][0],ArrProd[firstSubscript][Col][0]);      	
          document.frmtriplejs.lstciudad.selectedIndex = (ArrProd[firstSubscript][Col][0] == "<%=strCiudad%>") ? Col : document.frmtriplejs.lstciudad.selectedIndex
         }       
      }
    
function changeAgencia(index)
{
    index++
       len=document.frmtriplejs.lstagencia.length;
       
        for (Col=len;Col>0;Col--)
        {
   	    document.frmtriplejs.lstagencia.options[Col-1]=null;
        } 
         
	 document.frmtriplejs.DireccionA.value="";
	 document.frmtriplejs.TelefonosA.value="";
	 len=ArrProd[document.frmtriplejs.lstestado.selectedIndex - 1][index].length;
         document.frmtriplejs.lstagencia.length=0;
         document.frmtriplejs.lstagencia.options[0]=new Option("---------------------");
         document.frmtriplejs.lstagencia.selectedIndex=0;
       k=0; 
       for(Col=1;Col<len;Col++)
         {
        	document.frmtriplejs.lstagencia.options[Col]= new Option(ArrProd[document.frmtriplejs.lstestado.selectedIndex - 1][index][Col][0]);
	      document.frmtriplejs.lstagencia.selectedIndex = (ArrProd[document.frmtriplejs.lstestado.selectedIndex - 1][index][Col][0] == "<%=strAgencia%>") ? Col : document.frmtriplejs.lstagencia.selectedIndex
         }       
       }

      	function mostrardir_y_tel(index,index2)
	{
		if (index2==0) {
			document.frmtriplejs.DireccionA.value="";
			document.frmtriplejs.TelefonosA.value="";
			return
		}
		document.frmtriplejs.DireccionA.value = ArrProd[document.frmtriplejs.lstestado.selectedIndex-1][index][index2][1];
		document.frmtriplejs.TelefonosA.value = ArrProd[document.frmtriplejs.lstestado.selectedIndex-1][index][index2][2];
	}


function enviar()
	{
	 document.frmtriplejs.ButtonEnviar.value="Enviar";
	 if (Verifica())
	    document.frmtriplejs.submit();
	}
	
function changeCiudad(index,combociudad,comboestado)
      {
        
  	if (index == 0){
  	          eval("document.frmtriplejs."+combociudad+".length=0");    
              eval("document.frmtriplejs."+combociudad+".options[0]=new Option('---------------------')");
              eval("document.frmtriplejs."+combociudad+".selectedIndex=0");
            }
     else{
        
    
		eval("len=document.frmtriplejs."+combociudad+".length");
     
		
		for (Col=len;Col>0;Col--)
		{
   		eval("document.frmtriplejs."+combociudad+".options[Col-1]=null");
		} 

		len2=ArrProd[index-1].length;        
		//ArrProdCodigo
		
		
		//eval("document.frmtriplejs."+combociudad+".length=0");
		eval("document.frmtriplejs."+combociudad+".options[0]=new Option('---------------------')");
		eval("document.frmtriplejs."+combociudad+".selectedIndex=0");
	        
		eval("firstSubscript = document.frmtriplejs."+comboestado+".selectedIndex - 1");
		for(Col=1;Col<len2;Col++)
			{
			eval("document.frmtriplejs."+combociudad+".options[Col]=new Option(ArrProd[firstSubscript][Col],ArrProdCodigo[firstSubscript][Col])");      	
			}       
		}
      }

function changeCiudadBanco(index,combociudad,comboestado)
      {
        
  	if (index == 0){
  	          eval("document.frmtriplejs."+combociudad+".length=0");    
              eval("document.frmtriplejs."+combociudad+".options[0]=new Option('---------------------')");
              eval("document.frmtriplejs."+combociudad+".selectedIndex=0");
            }
     else{
        
    
		eval("len=document.frmtriplejs."+combociudad+".length");
     
		
		for (Col=len;Col>0;Col--)
		{
   		eval("document.frmtriplejs."+combociudad+".options[Col-1]=null");
		} 

		len2=ArrProd[index-1].length;        
		//ArrProdCodigo
		
		
		//eval("document.frmtriplejs."+combociudad+".length=0");
		eval("document.frmtriplejs."+combociudad+".options[0]=new Option('---------------------')");
		eval("document.frmtriplejs."+combociudad+".selectedIndex=0");
	        
		eval("firstSubscript = document.frmtriplejs."+comboestado+".selectedIndex - 1");
		for(Col=1;Col<len2;Col++)
			{
			eval("document.frmtriplejs."+combociudad+".options[Col]=new Option(ArrProd[firstSubscript][Col],ArrProdCodigo[firstSubscript][Col])");      	
			}       
		}
      }


