<!--
var arrayURL = new Array();
arrayURL[0]	= '';
arrayURL[1]	= 'web/index.htm';
arrayURL[2]	= 'web/quienes_somos.htm';
arrayURL[3]	= 'web/servipagcom.htm';
arrayURL[4]	= 'web/beneficios.htm';
arrayURL[5]	= 'web/servicios0.htm&titulo=Servicios&bloque=Servicios';
arrayURL[6]	= 'web/pago_cuentas.htm&titulo=Pago+de+Cuentas&bloque=Pago+De+Cuentas';
arrayURL[7]	= 'web/servicios.htm&titulo=Pago+de+Imposiciones&bloque=Pago+de+Imposiciones';
arrayURL[8]	= 'web/servicios.htm&titulo=Pago+de+Impuestos&bloque=Pago+de+Impuestos';
arrayURL[9]	= 'web/servicios.htm&titulo=Entrega+de+Documentos&bloque=Entrega+de+Documentos';
arrayURL[10] = 'web/servicios.htm&titulo=Cambio+de+Cheques&bloque=Cambio+de+Cheques';
arrayURL[11] = 'web/servicios.htm&titulo=Recaudación+de+Depositos&bloque=Recaudacion+de+Depositos';
arrayURL[12] = 'web/servicios.htm&titulo=Giros+de+Dinero&bloque=Giros+de+Dinero';
arrayURL[13] = 'web/servicios.htm&titulo=Avance+en+Efectivo&bloque=Avance+en+Efectivo';
arrayURL[14] = 'web/servicios.htm&titulo=Pago+de+Permisos+de+circulación&bloque=Pago+de+Permisos+de+circulacion';
arrayURL[15] = 'web/servicios.htm&titulo=Recarga+Teléfonos+Celulares&bloque=Recarga+Telefonos+Celulares';
arrayURL[16] = 'web/servicios.htm&titulo=Pagos+de+Premios&bloque=Pagos+de+Premios';
arrayURL[17] = 'web/servicios.htm&titulo=Compra+de+Certificados+Registro+Civil&bloque=Compra+de+Certificados+Registro+Civil';
arrayURL[18] = 'web/servicios.htm&titulo=Compra+de+Certificados+Movilización+General&bloque=Compra+de+Certificados+Movilizacion+General';
arrayURL[19] = 'web/empresas_convenio.htm';
arrayURL[20] = 'web/seguimos_creciendo.htm';
arrayURL[21] = 'web/centros_atencion.htm';
arrayURL[22] = 'web/identidad_corporativa.htm';
arrayURL[23] = 'web/oportunidad_trabajo.htm';
arrayURL[24] = 'web/registro.htm';
arrayURL[25] = 'web/index_usuario.htm';
arrayURL[26] = 'web/index_usuario_registrado.htm';
arrayURL[27] = 'web/calendario_pagos.htm';
arrayURL[28] = 'web/informativo_servipag.htm';
arrayURL[29] = 'web/inscripcion_informativo.htm';
arrayURL[30] = 'web/desinscripcion_informativo.htm';
arrayURL[31] = 'web/cartola_pagos.htm';
arrayURL[32] = 'web/cambiar_clave.htm'; /*M002*/
arrayURL[33] = 'web/actualizacion_datos1.htm';
arrayURL[34] = 'web/actualizacion_datos2.htm&linkeado=1';
arrayURL[35] = 'web/actualizacion_datos3.htm&linkeado=1';
arrayURL[36] = 'web/desinscripcion_sitio.htm';
arrayURL[37] = 'web/ayuda.htm';
arrayURL[38] = 'web/buscador.htm';
arrayURL[39] = 'web/preguntas_frecuentes.htm';
arrayURL[40] = 'web/guias_pasoapaso.htm';
arrayURL[41] = 'web/pago.htm';/*M006*/
arrayURL[42] = 'web/concurso.htm';
arrayURL[43] = 'web/cambio_clave.htm';
arrayURL[44] = 'web/seguimos_creciendo_historicos.htm&Noticia=Servipag Express';
arrayURL[45] = 'web/seguimos_creciendo_historicos.htm&Noticia=natura25082006'; /*M001*/
arrayURL[46] = 'web/seguimos_creciendo_historicos.htm&Noticia=Essal092006'; /*M003*/
arrayURL[47] = 'web/actualizacion_datos_ingresar_cuentas.htm'; /*M004*/
arrayURL[48] = 'web/actualizacion_datos_mostrar_cuentas.htm';  /*M004*/
arrayURL[49] = 'web/cliente_total.htm';  /*M006*/ 
arrayURL[50] = 'web/envios_email.htm';  /*M006*/
arrayURL[51] = 'web/consulta_transaccionlog.htm';/*M006*/


/*Url Menu*/
function urlMenu(Tipo){
	if (arrayURL[Tipo] != ''){
		URL = '/browse.asp?pagina='+arrayURL[Tipo];
		location.replace(URL);
	}
}

function rut_menu(variable,digit){
	Sum = 0;
	digito = 0;
	factor = 2;
	largo = variable.length;
	while (largo !== 0){
		Sum = Sum + (variable.substring(largo, largo-1) * factor);
		if (factor == 7){
				factor = 2;
		}else{
			factor = factor + 1;
		}
		largo = largo - 1;
	}
	d = 11 - Sum % 11;
	if (d == "10"){
		digito = "K";
  }else {
		if (d == "11"){
			digito = 0;
		}else{
			digito = d;
		}
	}
	if (digito == digit){
		return true;
	}else{
		return false;
	}
}

function formatearRut_menu(psRut){
	var largoRut = psRut.length;
	var RutSalida = '';
	if (largoRut < 10){
		for(i=10;i>largoRut;i--){
			RutSalida += '0';
		}
		RutSalida += psRut;
	}else{
		RutSalida = psRut;
	}
	return RutSalida;
}

function trim_menu(variable){
	largo=variable.length;
	m=0;
	while (m<largo){
		caracter=variable.substring(m,m+1);
		if (caracter != " "){
			break;
		}
		m++;
	}
	if (m==largo){
		return "";
	}
	n=0;
	while (n<largo){
		caracter=variable.substring(largo-n-1,largo-n);
		if (caracter != " "){
			break;
		}
		n++;
	}
	variable=variable.substring(m,largo-n);
	return variable;
}

function formatear3_menu(forma){
	if (forma.rut_1.value != ""){
		valor=forma.rut_1.value;
		/*M007 inicio*/
		valor = valor.replace('.',''); 
		valor = valor.replace('.',''); 
		valor = valor.replace('.',''); 
		valor = valor.replace('-',''); 
		/*M007 fin*/
		forma.rut_2.value=valor;
		if (valor.length > 1){
			forma.rut_1.value=insertapuntos_menu(valor.substring(0,valor.length - 1)) + '-' + valor.substring(valor.length - 1,valor.length);
		}
	}
}

function formatear4_menu(forma){
	forma.rut_1.value=forma.rut_2.value;
}

/*M007 inicio*/
function solorut_menu(e){ 
	if(window.event) // IE 
	{
	if (((event.keyCode>47)&&(event.keyCode<58))||(event.keyCode==75)||(event.keyCode==107)){
		event.returnValue=true;
	}else{
		event.returnValue=false;
	}
}
	else if(e.which) // Netscape/Firefox/Opera 
	{ 
		keynum= e.which;
		
		if (((keynum>47)&&(keynum<58))||(keynum==75)||(keynum==107)||(keynum==8)){
			return true;

		}else{
			return false;

		}
	} 
}
/*M007 fin*/
function Right_menu(strvar,intcant){
	strtemp = "";
	intlargo = strvar.length -1;
	for(i = 1;i <= intcant; i++){
		strtemp = strtemp + strvar.charAt(intlargo);
		intlargo--;
	}
	strtmp2=""
	for(intlargo = strtemp.length -1; intlargo >=0; intlargo--){
		strtmp2 = strtmp2 + strtemp.charAt(intlargo);
	}
	return(strtmp2);
}

function insertapuntos_menu(strval){
	var A = new Array();
	var strtemp = strval;
	strtemp = new Number(strtemp);
	strtemp = new String(strtemp);
	if (strtemp.length > 3){
		for(var i = 0; strtemp.length > 3; i++){
			A[i] = Right_menu(strtemp,3);
			strtemp /= 1000;
			strtemp=new String(strtemp);
			if (strtemp.indexOf('.') != -1){
      	strtemp = strtemp.substr(0,strtemp.indexOf('.'));
      }
		}
		for(i-- ;i >= 0 ;i--){
			strtemp = strtemp + "." + A[i];
		}
	}
	return(strtemp);
}

function PressEnter_menu(){
	if (event.keyCode == 13) Enviar_menu();
}
 /*Inicio M008*/
function RecomendarSitio()
	{
		Options = "'resizable=no,menubar=no,location=no,toolbar=no,status=no,scrollbars=no,directories=no,width=500,height=360,left=0,top=0'";
		window.open('/browse.asp?pagina=web/recomienda_sitio.htm','RecomendarSitio',Options);
	}	
 /*Fin M008*/
function Enviar_menu(){
	var Rut = '';
	var Dig	= '';
	var LargoRut = document.formCliente.rut_2.value.length;
	//Pasa a Mayuscula si existiese k.
	document.formCliente.rut_2.value = document.formCliente.rut_2.value.toUpperCase( );
	if (trim_menu(document.formCliente.rut_1.value) == ''){
		alert('Ingrese su rut');
		document.formCliente.rut_1.focus();
		return;
	}
	Rut = document.formCliente.rut_2.value.substring(0,LargoRut-1);
	Dig = document.formCliente.rut_2.value.substring(LargoRut-1,LargoRut);
	if (!(rut_menu(Rut, Dig))){
		alert('Rut inválido \npor favor ingréselo nuevamente');
		document.formCliente.rut_2.value = '';
		document.formCliente.rut_1.value = '';
		document.formCliente.rut_1.focus();
		return;
	}
	if (trim_menu(document.formCliente.clave_1.value) == ''){
		alert('Ingrese su Clave');
		document.formCliente.clave_1.focus();
		return;
	}
	document.formCliente.prsn_id.value = formatearRut_menu(document.formCliente.rut_2.value);
	document.formCliente.accs_pin.value = document.formCliente.clave_1.value;
	document.formCliente.submit();
} 
	
//Inicio M009
document.write('<script type="text/javascript" src="NP/js/menu/dtree.js"></script>');

	var Usuario		= '';	
	var Huella		= new Array();	
	if(undefined != window.Huella_dll){
		Usuario = Huella_dll[1].replace('#USUARIO#ÿ','');
		Usuario = Usuario.replace('ÿ1ÿ','');
	}


if (sLogin){

	document.write('<table width="149" align="center"');
	document.write('<tr align="left">');
	document.write('<td width="20" class="titLogin_reg_home">Bienvenido</td>');
	document.write('</tr>');
	document.write('<tr align="left">');
	document.write('<td width="130" class="txt_nombre_home">'+Usuario+'</td><br>');
	document.write('</tr>');
  document.write('</table>');

	document.write('<table width="149" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr>');
	document.write('<td><div id="menu">');
	document.write('<script type="text/javascript" src="NP/js/menu/data_1.js"></script>');
	document.write('<script type="text/javascript" src="NP/js/menu/data_2.js"></script>');
	document.write('<script type="text/javascript" src="NP/js/menu/data_3.js"></script>');
	document.write('</div></td>');
	document.write('</tr>');
	document.write('</table>');
  

	document.write('<table width="149" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr>');
	document.write('<td><div id="otros">');
	document.write('<script type="text/javascript" src="NP/js/menu/contactenos.js"></script>');
	document.write('</div></td>');
	document.write('</tr>');
	document.write('</table>');


	
}else{


	document.write('<table width="149" border="0">');
  document.write('<form name="formCliente" method="post" action="/browse.asp">');
	document.write('<input type="hidden" name="accion" value="login">');
	document.write('<INPUT type=hidden name="pagina" value="web/check_login_user.htm">');
	document.write('<input type="hidden" name="prsn_id" value="">');
	document.write('<input type="hidden" name="accs_pin" value="">');
	document.write('<input type="hidden" name="rut_2" value="">');
  
  document.write('<tr align="left">');
  document.write('<td colspan="2" height="31" class="titLogin_home">Bienvenido</td>');
  document.write('</tr>');
  document.write('<tr align="left">');
  document.write('<td colspan="2" class="LoginSub_home">Ingresa a tu Cuenta</td>');
  document.write('</tr>');
  document.write('<tr align="left">');
  document.write('<td width="20" height="22" align="left" class="rut_home">Rut:</td>');
  document.write('<td width="82" valign="top"><div class="campo">');
  document.write('<input type="text" name="rut_1" tabindex="1" maxlength="12" class="textInput2_home" style="width:82" size="12" onBlur="formatear3_menu(this.form);" onfocus="formatear4_menu(this.form);" onkeypress="return solorut_menu(event);" value="">');
  document.write('</div></td>');
  document.write('</tr>');
  document.write('<tr align="left">');
  document.write('<td class="rut_home">Clave:</td>');
  document.write('<td valign="top"><div class="campo">');
  document.write('<input type="password" name="clave_1" tabindex="2" value="" class="textInput2_home" style="width:82" size="15" onkeypress="PressEnter_menu();">');
  document.write('</div></td>');
  document.write('</tr>');
  document.write('<tr align="left">');
  document.write('<td colspan="2" ><table border="0" cellspacing="0" cellpadding="0">');
  document.write('<tr>');
  document.write('<td width="123" class="olv_clave_home"><a href="/browse.asp?pagina=web/recuperacion_clave.htm" tabindex="4">¿Olvidaste tu Clave?</a></td>');
  document.write('<td><a href="javascript: Enviar_menu();"><img src="NP/images/btn_ir2.jpg" tabindex="3" width="25" height="25" border="0" /></td>');
  document.write('</form>');
  document.write('</tr>');
	document.write('</table>');
	
	
  document.write('</td>');
  document.write('</tr>');
  document.write('<tr align="left">');
  document.write('<td colspan="2" class="txt_dest1"><table border="0" cellspacing="0" cellpadding="0" width="130">');
  document.write('<tr>');
  document.write('<td align="center" class="registrate_home" width="124"><a href="/browse.asp?pagina=web/registro.htm">Registrate aquí&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;></a></td>');
  document.write('</tr>');
  document.write('</table></td>');
  document.write('</tr>');
  document.write('<tr align="left">');
  document.write('<td colspan="2" class="txt_dest1">Registrate es Totalmente Gratis</td>');
  document.write('</tr>');

  document.write('</table>');


	document.write('<table width="149" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr>');
	document.write('<td><div id="menu">');
	document.write('<script type="text/javascript" src="NP/js/menu/data_inicio1Ex.js"></script>');
	document.write('<script type="text/javascript" src="NP/js/menu/data_inicio2Ex.js"></script>');
	document.write('<script type="text/javascript" src="NP/js/menu/data_inicio3Ex.js"></script>');
	document.write('</div></td>');
	document.write('</tr>');
	document.write('</table>');

	document.write('<table width="84%" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr>');
	document.write('<td><div id="otros">');
	document.write('<script type="text/javascript" src="NP/js/menu/contactenos.js"></script>');
	document.write('</div></td>');
	document.write('</tr>');
	document.write('</table>');

}
//Fin M009

//-->


