// JavaScript Document
<!--

/******* estos son para la seccion links de interes*/
<!--
function Agranda() 
{ 
var tma; 
var tma1; 
var tma2;
var tma3;
var tma4;
var tma5;
var tma6;
var tma7;
var tma8; 
var tma9; 
var tma10; 

var obj =  document.getElementById("cuerpo");
var obj1 =  document.getElementById("cuerpo1");
var obj2 =  document.getElementById("cuerpo2");
var obj3 =  document.getElementById("cuerpo3");
var obj4 =  document.getElementById("cuerpo4");
var obj5=  document.getElementById("cuerpo5");
var obj6=  document.getElementById("cuerpo6");
var obj7=  document.getElementById("cuerpo7");
var obj8 =  document.getElementById("cuerpo8");
var obj9 =  document.getElementById("cuerpo9");
var obj10 =  document.getElementById("cuerpo10");
tma = parseInt(obj.style.fontSize);
tma1 = parseInt(obj1.style.fontSize);
tma2 = parseInt(obj2.style.fontSize);
tma3 = parseInt(obj3.style.fontSize);
tma4 = parseInt(obj4.style.fontSize);
tma5 = parseInt(obj5.style.fontSize);
tma6 = parseInt(obj6.style.fontSize);
tma7 = parseInt(obj7.style.fontSize);
tma8 = parseInt(obj8.style.fontSize);
tma9 = parseInt(obj9.style.fontSize);
tma10 = parseInt(obj10.style.fontSize);

if (tma > 20)
	{alert ("No se puede Agrandar más la letra");}
else
    {obj.style.fontSize = tma + 5;
	obj1.style.fontSize = tma1 + 5;
	obj2.style.fontSize = tma2 + 5;
	obj3.style.fontSize = tma3 + 5;
	obj4.style.fontSize = tma4 + 5;
	obj5.style.fontSize = tma5 + 5;
	obj6.style.fontSize = tma6 + 5;
	obj7.style.fontSize = tma7 + 5;
	obj8.style.fontSize = tma8 + 5;
	obj9.style.fontSize = tma9 + 5;
	obj10.style.fontSize = tma10 + 5;
	} 
} 

function Achica() 
{ 
var tma; 
var tma1; 
var tma2; 
var tma3; 
var tma4;
 var tma5; 
  var tma6; 
    var tma7;
var tma8; 
var tma9; 
var tma10; 
	 

var obj =  document.getElementById("cuerpo");
var obj1 =  document.getElementById("cuerpo1");
var obj2 =  document.getElementById("cuerpo2");
var obj3 =  document.getElementById("cuerpo3");
var obj4 =  document.getElementById("cuerpo4");
var obj5 =  document.getElementById("cuerpo5");
var obj6 =  document.getElementById("cuerpo6");
var obj7 =  document.getElementById("cuerpo7");
var obj8 =  document.getElementById("cuerpo8");
var obj9 =  document.getElementById("cuerpo9");
var obj10 =  document.getElementById("cuerpo10");
tma = parseInt(obj.style.fontSize);
tma1 = parseInt(obj1.style.fontSize);
tma2 = parseInt(obj2.style.fontSize);
tma3 = parseInt(obj3.style.fontSize);
tma4 = parseInt(obj4.style.fontSize);
tma5 = parseInt(obj5.style.fontSize);
tma6 = parseInt(obj6.style.fontSize);
tma7 = parseInt(obj7.style.fontSize);
tma8 = parseInt(obj8.style.fontSize);
tma9 = parseInt(obj9.style.fontSize);
tma10 = parseInt(obj10.style.fontSize);
if (tma < 15)
	{alert ("No se puede Achicar más la letra");}
else
    {obj.style.fontSize = tma - 5;
	obj1.style.fontSize = tma1 - 5;
	obj2.style.fontSize = tma2 - 5;
	obj3.style.fontSize = tma3 - 5;
	obj4.style.fontSize = tma4 - 5;
	obj5.style.fontSize = tma5 - 5;
	obj6.style.fontSize = tma6 - 5;
	obj7.style.fontSize = tma7 - 5;
	obj8.style.fontSize = tma8 - 5;
	obj9.style.fontSize = tma9 - 5;
	obj10.style.fontSize = tma10 - 5;
	} 
}
/*********  aca termina este para link          **/
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

function agrandaTexto() {
	var obj =  document.getElementById("cuerpo");
	var tma = parseInt(obj.style.fontSize);
	if (tma > 30) {
		alert ("No se puede Agrandar más la letra");
	}else{
		obj.style.fontSize = tma + 5;
	} 
	var obj2 =  document.getElementById("cuerpo2");
	if(obj2) {
		var tma2 = parseInt(obj2.style.fontSize);
		if (tma2 > 30) {
			alert ("No se puede Agrandar más la letra");
		}else{
			obj2.style.fontSize = tma2 + 5;
		} 
	}
} 
function enviar(url) {
	document.form1.action = url;
	document.form1.submit();
}
function achicaTexto() {
	var obj =  document.getElementById("cuerpo");
	var tma = parseInt(obj.style.fontSize);
	if (tma < 13) {
		alert ("No se puede Achicar más la letra");
	}else{
		obj.style.fontSize = tma - 5;
	} 
	var obj2 =  document.getElementById("cuerpo2");
	if(obj2) {	
		var tma2 = parseInt(obj2.style.fontSize);
		if (tma2 < 13) {
			alert ("No se puede Achicar más la letra");
		}else{
			obj2.style.fontSize = tma2 - 5;
		} 
	}
} 
function ventanaSecundaria (URL,W,H){ 
   window.open(URL,"ventana1","width="+W+",height="+H+",scrollbars=YES,rezisable=YES") 
} 
function validarFianza()	{
	if(document.fianza.monto.value=="" || isNaN(document.fianza.monto.value)) {
		alert("Debe ingresar un monto válido");
		document.fianza.monto.focus();
		return false;
	}
	return true;
}
function actTipoFianza(tipo) {
	document.location.href = "seccion.php?sec=cot_fianza&tipo="+tipo;
}
function actSubTipoFianza(tipo,subtipo) {
	document.location.href = "seccion.php?sec=cot_fianza&tipo="+tipo+"&subtipo="+subtipo;
}
function actTipoSeguro(tipo) {
	document.location.href = "seccion.php?sec=cot_seguro"+tipo;
}
function actTipoSeguros(tipo) {
if(tipo=="2")	
	{document.location.href = "cotz_seguro2.php";}
	if(tipo=="1")	
	{document.location.href = "seccion.php?sec=cot_seguro1";}
		if(tipo=="3")	
	{document.location.href = "seccion.php?sec=gmedicos";}
		if(tipo=="5")	
	{document.location.href = "seccion.php?sec=empresa";}
			if(tipo=="4")	
	{document.location.href = "seccion.php?sec=hogar";}

}
function validarInformes()	{
	if(document.informes.txtnombre.value=="")
		{
		alert("Debe escribir su nombre");
		document.informes.txtnombre.focus();
		return false;
		}
	if(document.informes.txttelefono.value=="")
		{
		alert("Debe escribir un telefono");
		document.informes.txttelefono.focus();
		return false;
		}
	if(!Validar_email(document.informes.txtemail))
		{
		alert("Ingrese una dirección de correo válida");
		document.informes.txtemail.focus();
		return false;
		}
	if(document.informes.txtmensaje.value=="")
		{
		alert("Debe escribir su mensaje");
		document.informes.txtmensaje.focus();
		return false;
		}
	return true;
}
function validarVida()	{
	if(document.informes.txtnombre.value=="")
		{
		alert("Debe escribir su nombre");
		document.informes.txtnombre.focus();
		return false;
		}
		/* apellido*/
	if(document.informes.apellido.value=="")
		{
		alert("Debe escribir un apellido");
		document.informes.apellido.focus();
		return false;
		}
		/*  tipo edio contacto*/
		if(document.informes.medioContacto.value=="")
		{
		alert("Debe seleccionar algun medio de contacto");
		document.informes.medioContacto.focus();
		return false;
		}
		/*   medio contacto*/
		if(document.informes.txtMedioContacto.value=="")
		{
		alert("Debe escribir el medio de contacto seleccionado");
		document.informes.txtMedioContacto.focus();
		return false;
		}
		/*pregunto si eligio el medio de contacto mail-->entonces lo valido  */
		if(document.informes.medioContacto.value=="Correo electrónico"){
	if(!Validar_email(document.informes.txtMedioContacto))
		{
		alert("Ingrese una dirección de correo válida");
		document.informes.txtMedioContacto.focus();
		return false;
		}
		}
		/* termino de validar mail*/
		
		
	
		/* sexo */
		
		/*if((document.informes.sexo.value =="femenino")||(document.informes.sexo.value!="masculino"))*/
			if(document.informes.sexo.value=="")
		{
		alert("Debe escribir el sexo");
		/*document.informes.sexo.focus();*/
		return false;
		}
		
			/* estado civil */
		if(document.informes.estadoCivil.value=="")
		{
		alert("Debe escribir su Estado Civil");
		document.informes.estadoCivil.focus();
		return false;
		}
		
		
		/* edad */
		
		if(document.informes.edad.value=="")
		{
		alert("Debe escribir su edad");
		document.informes.edad.focus();
		return false;
		}
		
		
		/* edad */
		
		if(document.informes.moneda.value=="")
		{
		alert("Debe escribir moneda deseada");
		document.informes.moneda.focus();
		return false;
		}
		
		/* presupuesto */
		
		if(document.informes.presupuestoanual.value=="")
		{
		alert("Debe escribir presupuesto anual");
		document.informes.presupuestoanual.focus();
		return false;
		}
		/* falleciemiento*/
		
		
		if((document.informes.fallecimiento1.value=="")||(document.informes.fallecimiento2.value=="")||(document.informes.fallecimiento3.value==""))
		{
		alert("Debe aclarar necesidad principal ");
		document.informes.fallecimiento1.focus();
		return false;
		}
		
		/* efumador */
		
		if(document.informes.fumador.value=="")
		{
		alert("Debe aclarar si es fumador ");
		document.informes.fumador.focus();
		return false;
		}
		
		
	return true;
}
/* validar gastos medicos  ********************** */
function validarGastosMedicos()	{
	
	
	if(document.informes.txtnombre.value=="")
		{
		alert("Debe escribir su nombre");
		document.informes.txtnombre.focus();
		return false;
		}
	if(document.informes.apellido.value=="")
		{
		alert("Debe escribir su apellido");
		document.informes.apellido.focus();
		return false;
		}
	if(document.informes.edad.value=="")
		{
		alert("Debe especificar su edad");
		document.informes.edad.focus();
		return false;
		}
		/* */
		if(document.informes.medioContacto.value=="")
		{
		alert("Debe especificar medio de contacto");
		document.informes.medioContacto.focus();
		return false;
		}
		/*  */
			if(document.informes.txtMedioContacto.value=="")
		{
		alert("Debe especificar medio de contacto");
		document.informes.txtMedioContacto.focus();
		return false;
		}
		
			/*pregunto si eligio el medio de contacto mail-->entonces lo valido  */
		if(document.informes.medioContacto.value=="Correo electrónico"){
	if(!Validar_email(document.informes.txtMedioContacto))
		{
		alert("Ingrese una dirección de correo válida");
		document.informes.txtMedioContacto.focus();
		return false;
		}
		}
	
		/* suma aseguradora' */
			if(document.informes.aseguradora.value=="")
		{
		alert("Debe especificar Suma Aseguradora");
		document.informes.aseguradora.focus();
		return false;
		}
		
			/* coaseguro */
			if(document.informes.coasegurodeseado.value=="")
		{
		alert("Debe especificar coaseguro deseado");
		document.informes.coasegurodeseado.focus();
		return false;
		}
		/**/
		
		/* coaseguro */
			if(document.informes.deducibledeseado.value=="")
		{
		alert("Debe especificar deducible deseado");
		document.informes.deducibledeseado.focus();
		return false;
		}
		/**/
	
	return true;
}
/**  */
/* Validar Hogar ********************** */
function validarHogar()	{
	
	
	if(document.informes.txtnombre.value=="")
		{
		alert("Debe escribir su nombre");
		document.informes.txtnombre.focus();
		return false;
		}
	if(document.informes.apellido.value=="")
		{
		alert("Debe escribir su apellido");
		document.informes.apellido.focus();
		return false;
		}
	
		/* */
		if(document.informes.medioContacto.value=="")
		{
		alert("Debe especificar medio de contacto");
		document.informes.medioContacto.focus();
		return false;
		}
		/*  */
			if(document.informes.txtMedioContacto.value=="")
		{
		alert("Debe especificar medio de contacto");
		document.informes.txtMedioContacto.focus();
		return false;
		}
		
			/*pregunto si eligio el medio de contacto mail-->entonces lo valido  */
		if(document.informes.medioContacto.value=="Correo electrónico"){
	if(!Validar_email(document.informes.txtMedioContacto))
		{
		alert("Ingrese una dirección de correo válida");
		document.informes.txtMedioContacto.focus();
		return false;
		}
		}
	
	
		
		/* pisos */
			if(document.informes.pisos.value=="")
		{
		alert("Debe especificar cantidad de pisos");
		document.informes.pisos.focus();
		return false;
		}
	
		/* tipo propiedad */
			if(document.informes.tipopropiedad.value=="")
		{
		alert("Debe especificar tipo propiedad");
		document.informes.tipopropiedad.focus();
		return false;
		}
	
		/* construccion */
			if(document.informes.construccion.value=="")
		{
		alert("Debe especificar tipo construccion");
		document.informes.construccion.focus();
		return false;
		}
	
		
		/* coaseguro */
			if(document.informes.moneda.value=="")
		{
		alert("Debe especificar moneda deseada");
		document.informes.moneda.focus();
		return false;
		}
		/**/
	
	return true;
}
/**  */
function validarAuto()	{
	if(document.informes.nombre.value=="")
		{
		alert("Debe escribir su nombre");
		document.informes.nombre.focus();
		return false;
		}
		/* apellido*/
	if(document.informes.apellido.value=="")
		{
		alert("Debe escribir un apellido");
		document.informes.apellido.focus();
		return false;
		}
		/*  tipo edio contacto*/
		if(document.informes.medioContacto.value=="")
		{
		alert("Debe seleccionar algun medio de contacto");
		document.informes.medioContacto.focus();
		return false;
		}
		/*   medio contacto*/
		if(document.informes.txtMedioContacto.value=="")
		{
		alert("Debe escribir el medio de contacto seleccionado");
		document.informes.txtMedioContacto.focus();
		return false;
		}
		/*pregunto si eligio el medio de contacto mail-->entonces lo valido  */
		if(document.informes.medioContacto.value=="Correo electrónico"){
	if(!Validar_email(document.informes.txtMedioContacto))
		{
		alert("Ingrese una dirección de correo válida");
		document.informes.txtMedioContacto.focus();
		return false;
		}
		}
		/* termino de validar mail*/
			/* estado civil */
		if(document.informes.estadoCivil.value=="")
		{
		alert("Debe escribir su Estado Civil");
		document.informes.estadoCivil.focus();
		return false;
		}
		/*codigo postal */
		
		if(document.informes.codigoPostal.value=="")
		{
		alert("Debe elegir Código Postal");
		document.informes.codigoPostal.focus();
		return false;
		}
			/* marca */
		if(document.informes.idmarca.value=="")
		{
		alert("Debe elegir marca");
		document.informes.idmarca.focus();
		return false;
		}
		/* sub marca */
		if(document.informes.idsubmarca.value=="")
		{
		alert("Debe elegir Submarca");
		document.informes.idsubmarca.focus();
		return false;
		}
		/* transmision */
		if(document.informes.transmision.value=="")
		{
		alert("Debe elegir transmision");
		document.informes.transmision.focus();
		return false;
		}
		/* modelo */
		if(document.informes.modelo.value=="")
		{
		alert("Debe elegir modelo");
		document.informes.modelo.focus();
		return false;
		}
		
	return true;
}

/*  */


function Validar_email(theElement)	{
	var s = theElement.value;
	var filter=/^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
	if (s.length == 0 )
		{
		return false;
		}
	if (filter.test(s))
	return true;
	else
		return false;
}
function validarRecomendar()	{
	if(document.frmRec.txtnombre.value=="")
		{
		alert("Debe escribir su nombre.");
		document.frmRec.txtnombre.focus();
		return false;
		}
	if(document.frmRec.txtdestino.value=="")
		{
		alert("Debe escribir el nombre de la persona destino.");
		document.frmRec.txtdestino.focus();
		return false;
		}
	if(!Validar_email(document.frmRec.txtemail))
		{
		alert("Debe escribir un email valido.");
		document.frmRec.txtemail.focus();
		return false;
		}
	if(!Validar_email(document.frmRec.txtemaildestino))
		{
		alert("Debe escribir un email valido como destino.");
		document.frmRec.txtemaildestino.focus();
		return false;
		}
	return true;
}
function validarSeguro2() {
	var formu;
	formu = document.cot_seguros;
	if(document.cot_seguros.nombre.value=="")	{
		alert("Debe escribir su nombre");
		formu.nombre.focus();
		return false;
	}
	if(formu.apellido.value=="")	{
		alert("Debe escribir su apellido paterno");
		formu.apellido.focus();
		return false;
	}
	if(formu.txtMedioContacto.value=="")	{
		alert("Debe escribir su "+formu.medioContacto.value);
		formu.txtMedioContacto.focus();
		return false;
	}
	if(formu.medioContacto.value=="Correo electrónico")	{
		if(!Validar_email(formu.txtMedioContacto))	{
			alert("Ingrese una dirección de correo válida");
			formu.txtMedioContacto.focus();
			return false;
		}
	}else{
		if(isNaN(formu.txtMedioContacto.value)) {
			alert("Ingrese un número de "+formu.medioContacto.value+" válido");
			formu.txtMedioContacto.focus();
			return false;
		}
	}
	var postal = formu.codigoPostal.value;
	if(isNaN(postal) || (postal.length != 5))	{
		alert("Debe escribir el código postal");
		formu.codigoPostal.focus();
		return false;
	}
	return true;
}


<!-- Begin
function commaSplit(srcNumber) {
var txtNumber = '' + srcNumber;
if (isNaN(txtNumber) || txtNumber == "") {
alert("Eso no parece ser un número válido. Por favor, prueba de nuevo.");
fieldName.select();
fieldName.focus();
}
else {
var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
var arrNumber = txtNumber.split('.');
arrNumber[0] += '.';
do {
arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
} while (rxSplit.test(arrNumber[0]));
if (arrNumber.length > 1) {
return arrNumber.join('');
}
else {
return arrNumber[0].split('.')[0];
      }
   }
}
//  End -->


