// JavaScript Document
function validaform(form)
{
 if(form.frm_txttasa.value == "")
  {
	 alert("Debe ingresar la tasa de interes, Por favor");
	 form.frm_txttasa.focus();
	 return false;
  }else{
	 if(form.frm_txttasa.value > 100 ) 
	 {
	  alert("La tasa no puede ser mayor de 100 por ciento");  
	  form.frm_txttasa.focus();
	  return false;
	 }
  }
if(form.frm_cmbcredito.value == 0 )
{
 alert("Debe Seleccionar un tipo de Credito");
 form.frm_cmbcredito.focus();
 return false;
}else{
if( form.frm_cmbcredito.value == 1 || form.frm_cmbcredito.value == 2)
{
    if(form.frm_txtperiodo.value == "")
      {
        alert("Debe ingresar la cantidad de meses, Por favor");
        form.frm_txtperiodo.focus();
        return false;
      }else{
            if(form.frm_txtperiodo.value > 240 && form.frm_cmbcredito.value == 1)
            {
             alert("La cantidad de meses no debe puede ser mayor de 240");
	         form.frm_txtperiodo.focus();
	         return false;   
            }else{ 
                 if(form.frm_txtperiodo.value < 6 )
	             {
                  alert("La cantidad de meses no debe puede ser menor de 6");
	              form.frm_txtperiodo.focus();
	              return false;   	  
	             }else{
		              if(form.frm_txtperiodo.value > 72 && form.frm_cmbcredito.value == 2)
			          {
                       alert("La cantidad de meses no debe puede ser mayor de 72");
	                   form.frm_txtperiodo.focus();
	                   return false;   	  			 
			          }else{
                           if(form.frm_txtimporte.value == "")
	                       {
	                        alert ("Debe ingresar el monto del préstamo");
	                        form.frm_txtimporte.focus();
	                        return false;
	                       }
			         }
		        }
           } 
    }
}else{
   if(form.frm_cmbcredito.value == 3 )
   {
     if(form.frm_txtperiodo.value == "" && form.frm_cmbtipomoneda.value == 2)
     {
       alert("Debe ingresar la cantidad de meses, Por favor");
       form.frm_txtperiodo.focus();
       return false;
     }else{
	    if(form.frm_txtperiodo.value < 0 )
		{
		  alert("El periodo debe ser mayor a 12 meses");
		  form.frm_txtperiodo.focus();
		  return false;
		}else{
		     if(form.frm_txtperiodo.value > 300 )
			 {
		       alert("El periodo debe ser menor a  25 años");
		       form.frm_txtperiodo.focus();
		       return false;			 
			 }else{
				if(form.frm_txtimporte.value == "")
	            {
	             alert ("Debe ingresar el monto del préstamo");
	             form.frm_txtimporte.focus();
	             return false;
	            }else{
		            if(form.frm_intcantidad.value == "")
				    {
				     alert("Debe ingresar el Valor de la Vienda a adquirir");
				     form.frm_intcantidad.focus();
				     return false;
				   }
		      } 
	       }
       }
   }
   }//final if
   else{
   if(form.frm_cmbcredito.value == 4 )
   {
     if(form.frm_txtperiodo.value == "")
     {
       alert("Debe ingresar la cantidad de meses, Por favor");
       form.frm_txtperiodo.focus();
       return false;
     }else{
	      if(form.frm_txtperiodo.value < 6  )
		  {
		    alert("El Periodo debe ser mayor pruebas");
			form.frm_txtperiodo.focus();
			return false;
		  }else{
		       if(form.frm_txtperiodo.value > 60 )
			   {
			     alert("El Periodo debe ser menor de 60 meses");   
				 form.frm_txtperiodo.focus();
				 return false;
			   }else{
		            if(form.frm_txtimporte.value == "")
	                {
	                  alert ("Debe ingresar el monto del préstamo");
	                  form.frm_txtimporte.focus();
	                  return false;
	                }else{
		                  if(form.frm_intcantidad.value == "")
				          {
				           alert("Debe ingresar el Valor de el Vehiculo a adquirir");
				           form.frm_intcantidad.focus();
				           return false;
				          }
		            } 
               }
          }
	    }
    }else{
	     if(form.frm_cmbcredito.value == 5 )
		 {  
		     if(form.frm_txtimporte.value == "")
	                {
	                  alert ("Debe ingresar el monto del préstamo");
	                  form.frm_txtimporte.focus();
	                  return false;
	                }else{
		                  if(form.frm_intcantidad.value == "")
				          {
				           alert("Debe ingresar el Valor de la Vivienda a adquirir");
				           form.frm_intcantidad.focus();
				           return false;
				          }
		            } 
		 }else{
			    /////////aca codigo para restricciones
				if( form.frm_cmbcredito.value == 6 )
				{
				  if(form.frm_txttasa.value == "" )
				  {
				    alert("Debe ingresar la tasa para el prestamo");
					form.frm_txttasa.focus();
					return false;
				  }else{
				    if( form.frm_txtperiodo.value == "")
					{
					  alert("Debe ingresar el periodo para el prestamo");
					  form.frm_txtperiodo.focus();
					  return false;
					}else{
				  	 if( form.frm_txtimporte.value == "" )
					 {
						alert("Debe ingresar el monto del préstamo");
						form.frm_txtimporte.focus();
						return false;
					 }//finde importe
					 else{
						
						if(form.frm_txttasa.value == "" )
						{
							alert("debe ingresar la tasa para el préstamo");
							form.frm_txttasa.focus();
							return false;
						}//fin de if de  tasa
						else{
						  if( form.frm_txtperiodo.value < 12 )
						  {
							  alert("El periodo para este préstamo no puede ser menor de 12 meses");
							  form.frm_txtperiodo.focus();
							  return false;
						  }//fin de periodo
						  else{
							   if( form.frm_txtperiodo.value > 300 )
							   {
								  alert("El periodo para este préstamo no puede ser mayor de 300 meses"); 
								  form.frm_txtperiodo.focus();
								  return false;
							   }//fin if de periodo 300
							   else{
								   if( parseInt(form.frm_txtimporte.value) < 70000 )   
								   {
									   alert("El monto debe ser mayor de 70 000  nuevos soles");
									   form.frm_txtimporte.focus();
									   return false;
								   }//fin de if importe 70,000
								   else{
									    if( form.frm_cmbtipomoneda.value == 2 )
										{
										  alert("El tipo de moneda para este préstamo debe ser soles");	
										  form.frm_cmbtipomoneda.value=2;
										  return false;
										}// fin de if de moneda solo soles
										else{
											 if( form.frm_intcantidad.value=="")
											 {
												 alert("Por favor ingrese el importe de la vivienda a adquirir");
												 form.frm_intcantidad.focus();
												 return false;
											 }//fin de cantidad
											 else{
											     if( parseInt(form.frm_intcantidad.value) <  parseInt(form.frm_txtimporte.value) )
												 { 
												   
												   alert("El importe a financiar debe ser menor que el costo del inmueble"+form.frm_intcantidad.value);
												   form.frm_txtimporte.focus();
												   return false;
												 }
											 }//fin de else de cantidad
									 }//fin de else de tipo de moneda
								   }//fin de else de importe
								  }//fin de else de periodo
								 }//fin de else de tasa
							   }
						  }//fin de else de periodo < 120					
						}//fin de else de tasa no vacia
					}//fin de else
				}//fin de if frm_cmbcredito = 6
			     else{
				      if( form.frm_cmbcredito.value == 7 ){
					   if(form.frm_txttasa.value == "" )
					   {
					     alert("Debe ingresar la Tasa para el prestamo");
						 form.frm_txttasa.focus();
						 return false;
					   }else{
			  		      	if( form.frm_txtimporte.value == "" )
					     	{
						   	alert("Debe ingresar el monto del préstamo");
						   	form.frm_txtimporte.focus();
						   	return false;
					      	}//finde importe
							else{
							   if( form.frm_intcantidad.value == ""  )
							   {
							     alert("Debe ingresar el monto del inmueble");
								 form.frm_intcantidad.focus();
								 return false;
							   }///fin de cantidad
							   else{
							      if( (form.frm_intcantidad.value*0.91) <= form.frm_txtimporte.value )
								  { 
									alert(" el importe a financiar debe ser menor o igual al 90% del costo del inmueble");
									form.frm_txtimporte.focus();
									return false;
								  }
							   }//fin de else de cantidad   
							}//fion de else de importe
							<!-- para ingresar lo demas del prestamo-->					     
					    }//fin de else de tasa		
					  }//fin de if credito 7				 
				 }//fin de else credito 6
		 }///fin de else de valor 5
	}   
  }
 }
}
 return true;
}

function cambiar()
{
var index=document.forms.formulario.frm_cmbcredito.selectedIndex;

formulario.frm_cmbtipogarantia.length=0;
if(index==1) tipo_4();
if(index==2) tipo_4();
if(index==3) tipo_1();
if(index==4) tipo_2();
if(index==5) tipo_1();
if(index==6) 
{
document.formulario.frm_cmbtipomoneda.length=0;
tipo_1();
tipo_5();
}
if(index==7){
document.formulario.frm_cmbtipomoneda.length = 0;
tipo_1();
tipo_3();
}else{
    if(index != 6)
	{
	 tipo_4();
	}
}

}
function tipo_1()
{
opcion0=new Option("Casa - Habitacion","1","defauldSelected");
document.forms.formulario.frm_txtseguro1.value = 1;
document.forms.formulario.frm_txtseguro.value = 'Inmueble';
document.forms.formulario.frm_cmbtipogarantia.options[0]=opcion0;
}

function tipo_2()
{
opcion0=new Option("Autos - Camionetas","1","defauldSelected");
document.forms.formulario.frm_txtseguro1.value = 2;
document.forms.formulario.frm_txtseguro.value = 'Vehicular';
document.forms.formulario.frm_cmbtipogarantia.options[0]=opcion0;
}
function tipo_3()
{
opcion0=new Option("Vac","1","defauldSelected");
opcion1=new Option("Dólares","2","defauldSelected");
document.forms.formulario.frm_txtseguro1.value = 1;
document.forms.formulario.frm_txtseguro.value='Inmueble';
document.forms.formulario.frm_cmbtipomoneda.options[0]=opcion0;
document.forms.formulario.frm_cmbtipomoneda.options[1]=opcion1;
//document.forms.formulario.frm_cmbgracia.disabled=true;
}

function tipo_4()
{
opcion0=new Option("Soles","1","defauldSelected");
opcion1=new Option("Dólares","2","defauldSelected");
//document.forms.formulario.frm_txtseguro1.value = 1;
//document.forms.formulario.frm_txtseguro.value='Inmueble';
document.forms.formulario.frm_cmbtipomoneda.options[0]=opcion0;
document.forms.formulario.frm_cmbtipomoneda.options[1]=opcion1;
//document.forms.formulario.frm_cmbgracia.disabled=true;
}
function tipo_5()
{
document.forms.formulario.frm_cmbtipomoneda.length = 0;
opcion0=new Option("Soles","1","defauldSelected");
document.forms.formulario.frm_cmbtipomoneda.options[0]=opcion0;
}
function verificar_numero(numero,formulario)
	{
		if (numero.value=='')
		{
		}
		var noes=0;
		var str = numero.value;
		for (var i = 0; i < str.length; i++)        
		{	var ch = str.substring(i, i + 1)
		        if ((ch < "0" || "9" < ch) && ch != '.') 
			{  numero.value=''
		           numero.focus()
		           numero.select()
			   noes=1
			}               
		}	  
		if (noes==1)
		{ alert('El valor introducido "' + str + '" no es un número.')
		  return 1
		}
		return 0;
	}
function cambia_bandera(numero)
{   
	document.formulario.bandera.value=numero;
	if(numero == 1 || numero == 2 )
	{   
		document.formulario.frm_txtseguro.disabled=true;
		document.formulario.frm_cmbtipogarantia.disabled=true;
		document.formulario.frm_intcantidad.disabled=true;
		if(numero == 1 && document.formulario.frm_cmbtipomoneda.value == 1 )
		{
		  document.formulario.frm_txttasa.value = 30 ;
		}else{
		    if(numero == 1 && document.formulario.frm_cmbtipomoneda.value == 2 )
			{
			   document.formulario.frm_txttasa.value = 23 ;
			}
		}
		if(numero == 2 && document.formulario.frm_cmbtipomoneda.value == 1)
		{
		  document.formulario.frm_txttasa.value = 13;
	  	}else{
		     if(numero == 2 && document.formulario.frm_cmbtipomoneda.value == 2)
			 {
			     document.formulario.frm_txttasa.value = 13.5;
		 	 }		
		}
	}
	else
	{
		document.formulario.frm_txtseguro.disabled=false;
		document.formulario.frm_cmbtipogarantia.disabled=false;
		document.formulario.frm_intcantidad.disabled=false;
	}
	if( numero == 3 )
	{
	 if(document.formulario.frm_cmbtipomoneda.value == 1)
	 {
	     document.formulario.frm_txttasa.value = 16.9;
	 }else{
		  if(document.formulario.frm_cmbtipomoneda.value == 2)
	      {
	        document.formulario.frm_txttasa.value = 12.75;
	      } 
	 }
     	
	}else{
	 
	}
	if( numero == 4 )
	{
	  
	  if(document.formulario.frm_cmbtipomoneda.value == 1 )
	  {
	    document.formulario.frm_txttasa.value = 19.9 ;
 	    
	  }else{
		   if( document.formulario.frm_cmbtipomoneda.value == 2)  
		   {
	        document.formulario.frm_txttasa.value = 16 ;
		   }
 	    
	  }
}
	
	
	if(numero == 5 )
	{
	 
	 document.formulario.frm_txttasa.value = 12.9;
	}else{
			if(numero == 6 )
			{
			 document.formulario.frm_txttasa.value = 11.9;	
			}//fin de numero
			else{
	              if( numero == 7 && document.formulario.frm_cmbtipomoneda.value == 1 )
				  {
				   document.formulario.frm_txttasa.value = 10;
				  }else{
					  if( numero == 7 && document.formulario.frm_cmbtipomoneda.value == 2 )
					  {
						  document.formulario.frm_txttasa.value = 11.5;
					  }
				  }
				  
  			}
	}
	
	return;
}

function complemento(number)
{
 document.formulario.bandera1.value =number;
 if( number == 2 && document.formulario.frm_cmbcredito.value == 5 )
 {
   document.formulario.frm_txtperiodo.disabled = false;
   document.formulario.frm_cmbperiodohipoteca.disabled = true;
 }else{
   if( number == 1 && document.formulario.frm_cmbcredito.value == 5 )
   {
   document.formulario.frm_txtperiodo.disabled = true;
   document.formulario.frm_cmbperiodohipoteca.disabled = false; 
   }
 }
}
///////////////////////////////////////////////////////////////////////////////////////
function escribeCapa(capa,formulario){ 
   var numero = formulario.frm_cmbcredito.value;
   var textos = new Array() 
   textos[0] = "<br>AQUI ENCONTRARAS DETALLES SOBRE CADA UNO DE NUESTROS PRËSTAMOS." 
   textos[1] = "<br><strong>CRÉDITO CONSUMO</strong><br>IMPORTE MÍNIMO DE FINANCIAMINETO $ 300 O S/.1,000 SEGURO DESGRAVAMEN (SALDO INSOLUTO - INDIVIDUAL) 0.03530% , HASTA 48 MESES PARA PAGAR,LA TASA ES REFERENCIAL 30% TEA SOLES Y 23% TEA DOLARES, COMISION DE ADMINISTRACIÓN 0.25% MINIMO S/. 120 O $ 45, . COMISION DE COBRANZA: ANTES DE LOS 30 DÍAS DE VENCIDO S/. 10 ó $ 3, DESPUES DE LOS 30 DÍAS DE VENCIDO 5% SOBRE EL CAPITAL PENDIENTE DE PAGO, MÍNIMO S/. 35 ó $ 10. INTERES MORATORIO 15% TEA ,COMISIÓN POR COBRANZA 5% MINIMO S/. 35 O $ 10, INTERES MORATORIO 15% TEA SOLES Ó 10% TEA DOLARES.<br>SUJETO A VARIACIÓN.TEA= 360 DÍAS.<br><br><br>" 
   textos[2] = "<br><strong>CRÉDITO ESTUDIANTE</strong><br>IMPORTE MÍNIMO DE FINANCIAMIENTO $ 1,000 O S/. 3,500 SEGURO DESGRAVAMEN (SALDO INSOLUTO - INDIVIDUAL) 0.03530% , PERIODO DEGRACIA DE HASTA 24 MESES, HASTA 72 MESES PARA PAGAR INCLUIDO PERIODO DE GRACIA, LA TASA ES REFERENCIAL 13% TEA SOLES Y 13.5% TEA DOLARES, COMISION DE ADMINISTRACIÓN 0.25% MINIMO S/. 120 O $ 45. COMISION DE COBRANZA: ANTES DE LOS 30 DÍAS DE VENCIDO S/.10 ó $ 3, DESPUES DE LOS 30 DÍAS DE VENCIDO 5% SOBRE EL CAPITAL PENDIENTE DE PAGO, MÍNIMO S/. 35 ó $ 10. INTERES MORATORIO 15% TEA SOLES Ó 10% TEA DOLARES.<br/>SUJETO A VARIACIÓN.TEA= 360 DÍAS.<br><br><br>" 
   textos[3] = "<br><strong>CRÉDITO HIPOTECARIO</strong><br>IMPORTE MÍNIMO DE FINANCIAMIENTO $ 5,000 ó S/. 17,500, SEGURO DESGRAVAMEN (SALDO INSOLUTO INDIVIDUAL) 0.028%.<br>FINANCIAMOS HASTA EL 80% DEL VALOR DE INMUEBLE, HASTA 20 AÑOS PARA PAGAR, LA TASA QUE SE INDICA ES REFERENCIAL 16.9% TEA SOLES Y 12.5% TEA DOLARES, COMISION DE ADMINISTRACIÓN 0.25% MÍNIMO S/. 120 ó $45. COMISIÓN DE COBRANZA: ANTES DE LOS 30 DÍAS DE VENCIDO S/.10 ó $ 3, DESPUÉS DE LOS 30 DÍAS DE VENCIDO 5% SOBRE EL CAPITAL PENDIENTE DE PAGO, MÍNIMO S/. 35 ó $ 10. INTERES MORATORIO 15% TEA SOLES ó 10% TEA DOLARES.<br> SUJETO A VARIACIÓN.TEA = 360 DÍAS<br><br><br>" 
   textos[4] = "<br><strong>CRÉDITO VEHICULAR</strong><br>IMPORTE MÍNIMO DE FINANCIAMIENTO $ 1,000 O S/. 3,500 SEGURO DESGRAVAMEN (SALDO INSOLUTO - INDIVIDUAL) 0.027%,SEGURO VEHICULAR 3.31% TEA, HASTA 60 MESES PARA PAGAR, LA TASA ES REFERENCIAL 19.90% TEA SOLES Y 16% TEA DOLARES, COMISION DE ADMINISTRACIÓN 0.25% MINIMO S/. 120 O $ 45. COMISION DE COBRANZA: ANTES DE LOS 30 DÍAS DE VENCIDO S/. 10 ó $ 3, DESPUES DE LOS 30 DÍAS DE VENCIDO 5% SOBRE EL CAPITAL PENDIENTE DE PAGO, MÍNIMO S/. 35 ó $ 10. INTERES MORATORIO 15% TEA SOLES Ó 10% TEA DOLARES. PRENDA VEHICULAR $ 150.<br>SUJETO A VARIACIÓN.TEA= 360 DÍAS.<br><br><br>"
   textos[5] = "<br><strong>PRESTAMO MI VIVIENDA (Recursos Propios):</strong><br>IMPORTE MÍNIMO DE FINANCIAMIENTO $ 5,000 ó S/. 17,500, SEGURO DESGRAVAMEN (SALDO INSOLUTO INDIVIDUAL) 0.028%. FINANCIAMOS HASTA EL 90% DEL VALOR DE INMUEBLE, BONO DEL BUEN PAGADOR 15% DEL VALOR FINANCIADO HASTA UN TOPE MÁXIMO DE S/. 15,000, PLAZO MÍNIMO PARA ACCEDER AL ESQUEMA DE FINANCIAMIENTO CON EL PREMIO AL BUEN PAGADOR SERÁ 10 AÑOS, HASTA 20 AÑOS PARA PAGAR, TASA 12.90% TEA SOLES ó DOLARES, COMISION POR ADMINISTRACIÓN 0.25% MÍNIMO S/. 120 ó $45.COMISIÓN DE COBRANZA: ANTES DE LOS 30 DÍAS DE VENCIDO S/.10 ó $ 3, DESPUÉS DE LOS 30 DÍAS DE VENCIDO 5% SOBRE EL CAPITAL PENDIENTE DE PAGO, MÍNIMO S/. 35 ó $ 10. INTERES MORATORIO 15% TEA SOLES ó 10% TEA DOLARES.<br>SUJETO A VARIACIÓN.TEA = 360 DÍAS";   
   textos[6] = "<br><strong>CASA 120%</strong><br><br><strong>Préstamo Hipotecario :</strong><br>importe mínimo de financiamiento S/.70,000, seguro desgravamen (saldo insoluto individual), 0.028% financiamos hasta el 100% del valor comercial del informe de tasación, plazo máximo de financiamiento 25 años, para financiamientos hasta el 100% tasa 12.50% TEA y para financiamientos al 80%  tasa 11.90% TEA.<br>Seguro desgravamen (saldo insoluto individual) 0.035%.<br><br><strong>Préstamos de Consumo :</strong><br> Para importes : Desde S/. 7,000 hasta S/.100,000 plazo máximo 5 años, tasa 14% TEA, Desde S/. 18,000 hasta S/. 100,000, plazo máximo 10 años, tasa 15% TEA.<br>Para ambos préstamos : TEA base 360 días, para obtener las condiciones preferenciales del préstamo de consumo, deberá contratarse ambos productos a la vez. El plazo del consumo no deberá exceder el del préstamo hipotecario.<br>Comisión por administración 0.25% mínimo S/. 120,<br/> comisión de cobranza : antes de los 30 días de vencido S/. 10, despues de los 30 días de vencido : 5% sobre el capital pendiente de pago mínimo S/. 35. Interés moratorio 15% TEA soles.El desembolso del préstamo esta sujeto a la evaluación crediticia respectiva.<br/><br/><br/>";
   textos[7] = "<br><strong>PRESTAMO MI VIVIENDA ANTIGUO (Recursos Cofide):</strong><br>IMPORTE MÍNIMO DE FINANCIAMIENTO $ 5,000 ó S/. 17,500, SEGURO DESGRAVAMEN (SALDO INSOLUTO INDIVIDUAL) 0.030%.FINANCIAMOS HASTA EL 90% DEL VALOR DE INMUEBLE, BONO DEL BUEN PAGADOR 20% DEL VALOR FINANCIADO PLAZO MÍNIMO PARA ACCEDER AL ESQUEMA DE  FINANCIAMIENTO CON EL PREMIO AL BUEN PAGADOR SERÁ 10 AÑOS, HASTA 20 AÑOS PARA PAGAR, TASA 10% + VAC TEA SOLES ó 11.50% DOLARES, COMISION POR ADMINISTRACIÓN 0.50% MÍNIMO  13 VAC SOLES Ó $ 3 DOLARES. COMISIÓN DE COBRANZA: ANTES DE LOS 30 DÍAS DE VENCIDO 1.5 VAC ó $ 3, DESPUÉS DE LOS 30 DÍAS DE VENCIDO 5% SOBRE EL CAPITAL PENDIENTE DE PAGO, MÍNIMO 7 VAC ó $ 10. INTERES MORATORIO 15% TEA SOLES ó 10% VAC : VALOR ADQUISITIVO CONSTANTE, FACTOR DE INDEXACIÓN EN FUNCIÓN A LA DEVALUACIÓN DEL SOL.<br>TEA DOLARES.<br>SUJETO A VARIACIÓN.TEA = 360 DÍAS<br><strong>NOTA:</strong>EL PRODUCTO MI VIVIENDA (RECURSOS DE COFIDE) ESTUVO VIGENTE HASTA EL 31.03.2006.";
document.getElementById(capa).innerHTML=textos[numero]; 
} 
////////////////////////////////////////////////////////////////////////////////////////
function nuevo_validador(numero)
{
	
	if( numero == 1 && document.formulario.frm_cmbcredito.value == 1 )
	{
		 document.formulario.frm_txttasa.value = 30;
	}
	if(numero == 2 &&  document.formulario.frm_cmbcredito.value == 1 )
	{
		 document.formulario.frm_txttasa.value = 23;
	}
    if(numero == 1 &&  document.formulario.frm_cmbcredito.value == 2 )
	{
		document.formulario.frm_txttasa.value = 13;
	}
	if(numero == 2 &&  document.formulario.frm_cmbcredito.value == 2 )
	{
		document.formulario.frm_txttasa.value = 13.5;
	}
	if(numero == 1 &&  document.formulario.frm_cmbcredito.value == 3 )
	{
		document.formulario.frm_txttasa.value = 16.9;
	}
	if(numero == 2 &&  document.formulario.frm_cmbcredito.value == 3 )
	{
		document.formulario.frm_txttasa.value = 12.5;
	}
	if(numero == 1 &&  document.formulario.frm_cmbcredito.value == 4 )
	{
		document.formulario.frm_txttasa.value = 19.9;
	}
	if(numero == 2 &&  document.formulario.frm_cmbcredito.value == 4 )
	{
		document.formulario.frm_txttasa.value = 16;
	}
	if(numero == 1 && document.formulario.frm_cmbcredito.value == 7)
	{
	   document.formulario.frm_txttasa.value = 10;
	}
	if(numero == 2 && document.formulario.frm_cmbcredito.value == 7 )
	{
	  document.formulario.frm_txttasa.value = 11.5;
	}
}

function nueva_moneda()
{ 
if(document.formulario.frm_cmbtipomoneda.value == 1 && document.formulario.frm_cmbcredito.value == 7)
{

 document.formulario.frm_txtmoneda.value = "VAC";
}else{
	 if(document.formulario.frm_cmbtipomoneda.value == 2 && document.formulario.frm_cmbcredito.value == 7)
	 {
	 
	 document.formulario.frm_txtmoneda.value = "Dólares";
	 }else{
	     if(document.formulario.frm_cmbtipomoneda.value == 1 && document.formulario.frm_cmbcredito.value == 6)
		 {
		  document.formulario.frm_txtmoneda.value = "Soles";
		 }else{
		      if(document.formulario.frm_cmbtipomoneda.value == 2 && document.formulario.frm_cmbcredito.value == 6)
			  {
			    document.formulario.frm_txtmoneda.value = "Dólares";
			  }else{
		  	 	 document.formulario.frm_txtmoneda.value = "Dólares";
				 }
		  }
	 }
}
}
function muestra_capa(nombre_capa)
{ document.getElementById(nombre_capa).style.visibility='visible'; }

//funcion para ocultar la capa q se pase por parametro
function oculta_capa(nombre_capa)
{ document.getElementById(nombre_capa).style.visibility='hidden'; }


function escribeCapa1(capa,formulario){ 
   var numero = formulario.frm_cmbcredito.value;
   var inputs = new Array() 
   inputs[0] = "<table width='450' height='30' border='0' cellpadding='0' cellspacing='0'><tr><td width='150'>&nbsp;Periodicidad de pago</td><td width='109'><input type='text' name='frm_txtperiodo' class='input' value=''></td><td width='191'>MESES</td></tr></table>"
   inputs[1] = "<table width='450' height='30' border='0' cellpadding='0' cellspacing='0'><tr><td width='155'>&nbsp;Periodicidad en años</td><td width='95'>&nbsp;<select name='frm_cmbperiodohipoteca' class='Tazulnegr' ><option value='120'>120 meses</option><option value='126'>126 meses</option><option value='132'>132 meses</option><option value='138'>138 meses</option><option value='144'>144 meses</option><option value='150'>150 meses</option><option value='156'>156 meses</option><option value='162'>162 meses</option><option value='168'>168 meses</option><option value='174'>174 meses</option><option value='180'>180 meses</option><option value='186'>186 meses</option><option value='192'>192 meses</option><option value='198'>198 meses</option><option value='204'>204 meses</option><option value='210'>210 meses</option><option value='216'>216 meses</option><option value='222'>222 meses</option><option value='228'>228 meses</option><option value='234'>234 meses</option><option value='240'>240 meses</option></select></td><td width='200'>&nbsp;</td></tr></table>"
   if( numero == 5 )
   {
   document.getElementById(capa).innerHTML=inputs[1]; 
   document.formulario.frm_cmbgracia.disabled = true;
   }else{
    
   if( numero == 7 )
   {
   document.getElementById(capa).innerHTML=inputs[1]; 
//   document.formulario.frm_cuotadoble.disabled = true;
   document.formulario.frm_cmbgracia.disabled = true;
   document.formulario.frm_txttasa.readOnly  = true;
   }else{
       document.getElementById(capa).innerHTML=inputs[0]; 
       document.formulario.frm_cuotadoble.disabled = false;
       document.formulario.frm_cmbgracia.disabled = false;
      
   }
   }
   if(numero != 7)
   {
	    document.formulario.frm_txttasa.readOnly  = false;
   }
} 

function habilita_garantia()
{
if( document.formulario.frm_cmbcredito.value == 1 || document.formulario.frm_cmbcredito.value == 2 ){
	document.formulario.frm_txtgarantia.disabled=false;
//	document.formulario.rdogarantia.disabled = false;
   
}else{
	document.formulario.frm_txtgarantia.disabled=true;
//	document.formulario.rdogarantia.disabled = true;
 	
}

if( document.formulario.frm_cmbcredito.value == 4){
	
   	document.formulario.rdogarantia.disabled = false;
	document.formulario.rdogarantia1.disabled = true;
	
}else{
	if( document.formulario.frm_cmbcredito.value == 3 )
	{
   	document.formulario.rdogarantia.disabled = true;
	document.formulario.rdogarantia1.disabled = false;
	  	
	}else{
   	document.formulario.rdogarantia.disabled = false;
	document.formulario.rdogarantia1.disabled = false;
	}
}

}