/*
Fecha y Hora By Chivi
*/
/* Coeminza el script del Reloj */
function cerrar(estilo,pag,pag2){
// if (estilo != 'LA'){
// if (estilo == 'MY'){
// window.open(pag2,"session","width=1,height=1,scroll=no,location=no")
// window.open('','_parent','');
//window.close();
// }else{
// if (estilo == 'LA'){
location.href=pag
// }
//}
}
function actualizaReloj(){
/* Capturamos la Hora, los minutos y los segundos */
marcacion = new Date()
/* Capturamos la Hora */
Hora = marcacion.getHours()
/* Capturamos los Minutos */
Minutos = marcacion.getMinutes()
/* Capturamos los Segundos */
Segundos = marcacion.getSeconds()
/* Si la Hora, los Minutos o los Segundos
Son Menores o igual a 9, le añadimos un 0 */
if (Hora<=9)
Hora = "0" + Hora
if (Minutos<=9)
Minutos = "0" + Minutos
if (Segundos<=9)
Segundos = "0" + Segundos
/* Termina el Script del Reloj */
/* Comienza el Script de la Fecha */
var Dia = new Array("Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo");
var Mes = new Array("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC");
var Hoy = new Date();
var Anio = Hoy.getYear();
var Amio = "" + Anio;
var hoy = "" + Hoy.getDate();
if(hoy.length==1){
hoy = "0" + hoy;
}
mes = Hoy.getMonth();
//mes = mes + 1;
var Fecha = hoy + Mes[mes] + Amio.substr(2,2) + " ";
/* Termina el script de la Fecha */
/* Creamos 4 variables para darle formato a nuestro Script */
var Inicio, Script, Final, Total
/*En Inicio le indicamos un color de fuente y un tamaño */
Inicio = ""
/* En Reloj le indicamos la Hora, los Minutos y los Segundos */
Script = Fecha + Hora + ":" + Minutos + ":" + Segundos
/* En final cerramos el tag de la fuente */
Final = ""
/* En total Finalizamos el Reloj uniendo las variables */
Total = Script
/* Capturamos una celda para mostrar el Reloj */
document.getElementById('Fecha_Reloj').innerHTML = Total
/* Indicamos que nos refresque el Reloj cada 1 segundo */
setTimeout("actualizaReloj()",1000)
}
es_par = false;
num = 0;
function crear(obj,tot,nomprex,nomaawb) {
num++;
if(num > tot) return;
if(es_par) bgcolor = '#FFFFFF';
else bgcolor = '#F3F3F3';
if((num % 2) == 0)
if(es_par) bgcolor = '#F3F3F3';
else bgcolor = '#FFFFFF';
fi = document.getElementById('fiel'); // 1
contenedor = document.createElement('tr'); // 2
contenedor.id = 'div'; // 3
fi.appendChild(contenedor); // 4
contenedor2 = document.createElement('
'); // 5
//contenedor2.setAttribute('bgcolor', '#F3F3F3');// = '#F3F3F3';
contenedor.appendChild(contenedor2); // 7
var validaBusquedaFn = '';
switch(obj){// EXTENSION_VARIABLE CHP 2008-0916
case "privado_awbTracking": validaBusquedaFn = 'validaBusquedaEnter(event, this, 1)'; break;
case "privado_awbNotifi": validaBusquedaFn = 'validaBusquedaEnter(event, this)'; break;
case "publico_awbTracking": validaBusquedaFn = "validaBusquedaEnter(event, this, \'uno\')";
}
ele = document.createElement(' '); // 5
ele.type = 'text'; // 6
ele.name = nomprex; // 6
//ele.size = 5;
//ele.setAttribute('Class', 'formulario1');
//ele.id = 'formulario2';
contenedor2.appendChild(ele); // 7
contenedor2.appendChild(document.createTextNode(' - '));
ele = document.createElement(' '); // 5
ele.type = 'text'; // 6
ele.name = nomaawb; // 6
contenedor2.appendChild(ele); // 7
/*if (bgcolor =='#FFFFFF'){
bgcolor = '#F3F3F3';
}else{
bgcolor = '#FFFFFF';
}*/
}
function versionie(element){
if (typeof document.body.style.maxHeight != "undefined") {
// IE 7, mozilla, safari, opera 9
checkUncheckAll(element);
} else {
// IE6, navegadores antiguos
check();
}
}
function getVersionie(){
if (typeof document.body.style.maxHeight != "undefined") {
// IE 7, mozilla, safari, opera 9
return("ie7");
} else {
// IE6, navegadores antiguos
return("ie6");
}
}
function checkUncheckAll(theElement) {
var theForm = theElement.form, z = 0;
for(z=0; z 1) {
sValue_1 = document.forms[0].elements[i].value.substring(0, document.forms[0].elements[i].value.length - 1);
sValue_2 = document.forms[0].elements[i].value.substring(document.forms[0].elements[i].value.length,document.forms[0].elements[i].value.length-1);
iValue_1 = sValue_1 - parseInt(sValue_1/7,0)*7;
if (sValue_2 != iValue_1) {
estado = false;
if (posicion_elemento == ''){
posicion_elemento = i;
}
if (array_awb == ''){
array_awb = document.forms[0].elements[i-1].value + '-' + document.forms[0].elements[i].value;
}else{
array_awb = array_awb + '\n' + document.forms[0].elements[i-1].value + '-' + document.forms[0].elements[i].value;
}
}
}else{
if (posicion_elemento == ''){
posicion_elemento = i
}
if (array_awb == ''){
array_awb = document.forms[0].elements[i].value;
}else{
array_awb = array_awb + '\n' + document.forms[0].elements[i].value;
}
estado = false;
}
if (document.forms[0].elements[i-1].value.length == 0){
mensaje_prefijo = "dos"
if (posicion_elemento_prefijo == ''){
posicion_elemento_prefijo = i-1;
}
estado = false;
}
}
}
}
if (!estado){
if (mensaje_prefijo != ''){
mensaje = mensaje_prefijo;
eval("document.forms[0].elements[" + posicion_elemento_prefijo + "].focus()");
eval("document.forms[0].elements[" + posicion_elemento_prefijo + "].select()");
}
if (array_awb != ''){
if (mensaje == ''){
mensaje = "cuatro";
eval("document.forms[0].elements[" + posicion_elemento + "].focus()");
eval("document.forms[0].elements[" + posicion_elemento + "].select()");
}else{
mensaje = mensaje + '//' + "cuatro";
}
}
if (mensaje_guia != ''){
if (mensaje == ''){
mensaje = mensaje_guia;
eval("document.forms[0].elements[" + posicion_elemento_guia + "].focus()");
eval("document.forms[0].elements[" + posicion_elemento_guia + "].select()");
}else{
mensaje = mensaje + '//'+ mensaje_guia;
}
}
}
}else{
estado = false;
mensaje="tres";
}
return estado + '|' + mensaje + '|' + array_awb;
}
//-------------------------------------------------------------------------//
//------------------------------------------------------------------------//
tipo = 0;
num = 0;
function crear_ori_des(obj, valor){
bgcolor = '#FFFFFF';
num++;
if(num > 7 ) return;
if((num % 2) == 0)
bgcolor = '#FFFFFF';
var fi = document.getElementById('fiel1'); // 1
var contenedor = document.createElement('tr'); // 2
contenedor.id = 'div'; // 3
fi.appendChild(contenedor); // 4
tipo = 1; //Origen
contenedor2 = document.createElement(''); // 5
//contenedor2.setAttribute('bgcolor', '#F3F3F3');// = '#F3F3F3';
contenedor.appendChild(contenedor2); // 7
ele = document.createElement(' ');
//if ((document.forms[0].p_origen.value != 'ALL') && (document.forms[0].p_destino.value == 'ALL'))
//{
//ele = document.createElement(' '); // 5
/*}else {
ele = document.createElement(' '); // 5
}*/
ele.type = 'text'; // 6
ele.name = 'origen'; // 6
//ele.size = 5;
//ele.setAttribute('Class', 'formulario1');
//ele.id = 'formulario2';
contenedor2.appendChild(ele); // 7
contenedor2.appendChild(document.createTextNode(' '));
tipo = 2; //Destino
ele = document.createElement(' ');
/* if ((document.forms[0].p_origen.value == 'ALL') && (document.forms[0].p_destino.value != 'ALL'))
{
ele = document.createElement(' '); // 5
}else{
ele = document.createElement(' '); // 5
}*/
ele.type = 'text'; // 6
ele.name = 'destino'; // 6
contenedor2.appendChild(ele); // 7
}
//--------------------------------------------------------------------------------------------------
function valida_Awb(valor, mensaje){
var estado = true;
valor.value = trimAll(eval("document.all." + valor.name + " .value")); //EXTENSION_VARIABLE CHP 2008-0339
sValue = eval("document.all." + valor.name + " .value");
if (sValue.length != 0) {
if (sValue.length > 1) {
sValue_1 = sValue.substring(0, sValue.length - 1);
sValue_2 = sValue.substring(sValue.length,sValue.length-1);
iValue_1 = sValue_1 - parseInt(sValue_1/7,0)*7;
if (sValue_2 != iValue_1) {
eval("document.all." + valor.name + ".focus()");
eval("document.all." +valor.name + ".select()");
estado = false;
}
}else{
eval("document.all." + valor.name + ".focus()");
eval("document.all." + valor.name + ".select()");
estado = false;
}
}
if (!estado){
if (mensaje != '' && mensaje.length >0) //EXTENSION_VARIABLE CHP 2008-0916
alert(mensaje);
}
return estado;
}
//------------------------------------------------------------------------
function fn(form,field)
{
var next=0, found=false
var f=form
if(event.keyCode!=13) return;
for(var i=0;i= 48 && key <= 57));
}
//--------------------------------------------------------------------------
// -------------------------- VALIDACION CORREO ---------------------------
function valida_mail(valor) {
var correo
var mensaje = "Por favor ingrese cuenta de correo valido";
estado =true;
sValue = eval("document.all." + valor.name + " .value");
// correo = eval("document.all." + valor.name + " .value");
sValue = sValue.replace(/ /g, '');
if (sValue.length != 0) {
if(sValue.search(/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/ig)){
eval("document.all." + valor.name + ".focus()");
eval("document.all." +valor.name + ".select()");
estado =false
}
if (!estado){
alert(mensaje)
}
}
return estado;
}
//-------------------------------------------------------------------------
function openModalGlosario(ruta)
{
var dwidth = 500;
var dheight = 450;
var wheight = screen.height;
var wwidth = screen.width;
var wtop = parseInt((wheight/2)-(dheight/2));
var wleft = parseInt((wwidth/2)-(dwidth/2));
var sSw;
showModalDialog(ruta,"",'resizable:no;help:no;status:no;scroll:no;dialogwidth:'+dwidth+'px;dialogheight:'+dheight+'px;dialogtop:'+wtop+'px;dialogleft:'+wleft+'px;unadorned:yes');
}
/* Inicio Requerimiento CU_10 - 02/05/2008
* Proyecto ETracking V2
* everis - Víctor Riquelme G.
* Descripción : se agrega la crecion de cookie y la extracion de ella
* para poder recordar al cliente los datos de busqueda ingresada anteriormente.
*/
function createdCookie(){
var dateCookie = new Date(2100,1,1);
var cookieName = "onBoarReport";
var origin = document.getElementById("ori1").value;
origin = origin + "_" + document.getElementById("ori2").value;
origin = origin + "_" + document.getElementById("ori3").value;
document.cookie = cookieName+'='+origin+'; expires='+dateCookie.toGMTString()+'; path=/';
}
function recuperaCookie(){
if (document.cookie!=null){
var inicio = document.cookie.indexOf("onBoarReport=");
if (inicio>0){
var cookie = document.cookie.substring(inicio+13);
var ori = cookie.split("_");
var ori1;
document.getElementById("ori1").value=ori[0];
document.getElementById("ori2").value=ori[1];
ori1 = ori[2].split(";")
document.getElementById("ori3").value=ori1[0];
}
}
}
/* Fin Requerimiento CU_10*/
/* Inicio Requerimiento CU_10 - 02/05/2008
* Proyecto ETracking V2
* everis - Víctor Riquelme G.
* Descripción : Se agrega funcion para chequear todos los check notificacion
*/
function check_todo(){
if (document.forms[0].checkAll.checked == true){
for (i=0;i 96 && event.keyCode<200){
if(event.keyCode < 97 || event.keyCode>122){
event.returnValue = false;
}
}else if(event.keyCode<91){
if((event.keyCode < 65 || event.keyCode>90)){
event.returnValue = false;
}
}else{
if((event.keyCode == 241 || event.keyCode==209)){
event.returnValue = true;
}
}
}
/* Fin Requerimiento CU_10*/
/* Inicio Requerimiento CU_10 - 05/05/2008
* Proyecto ETracking V2
* everis - Víctor Riquelme G.
* Descripción : se agrega esta funcion para visualizar el modal y exportar a excel
*/
function Excel_OnBoarReport(ruta)
{
var pag= ruta;
window.open(ruta,"wl");
// var Wnd = AbreVentana(loc,1024,768,80);
}
function AbreVentana(Archivo,width,height,left,top)
{
var param = "width="+ width +",height="+ height +",left="+ left +",top="+ top
w2 = window.open(Archivo,"w1",param);
return true;
}
/* Fin Requerimiento CU_10*/
//EXTENSION_VARIABLE CHP 2008-0339
function trimAll(cadena){
var stringToTrim = cadena;
var str = stringToTrim.replace(/^\s+|\s+$/g,"");
return str;
}
function trimObjectValue(obj){
obj.value = trimAll(obj.value);
}
//EXTENSION_VARIABLE CHP 2008-0916
function fnEnter(form,field)
{
var next=0, found=false;
var f=form;
if(event.keyCode!=13) return false;
for(var i=0;i 0) {
return true;
}
f.item(next).focus();
return false;
}else{
//if(next