var expdate = new Date(); var sTienda; var sSession; var sUsrID; // ------------ COOKIES -------------------------- var expdate = new Date(); expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); FixCookieDate(expdate); // Agrega a mi carrito function AddCarS(iId_prod,cad) { var TipCar; var cadena=cad; if (AddCarS.arguments.length==3){ //alert("AddCarS:"+AddCarS.arguments[1]) TipCar=AddCarS.arguments[2] PopupWinS(iId_prod,cadena,TipCar) } else{ var sCant,sDescr,sSerial,sUMed,iIdUMed, sTienda, sTipCar; sTienda = GetCookie("sa_tienda"); sDescr = ""; sObser=cadena; sUnimed=""; sSerial=""; if (sTienda != "" && sTienda != null) { if (AddCarS.arguments.length>2) sCant=AddCarS.arguments[2]; else { sCant=""; PopupWinS(iId_prod,sObser); return ; } if (AddCarS.arguments.length > 1) sObser = FilterComent(AddCarS.arguments[1]); if (AddCarS.arguments.length > 4) iIdUMed=AddCarS.arguments[4]; if (AddCarS.arguments.length > 5) sUMed=AddCarS.arguments[5]; if (AddCarS.arguments.length > 6) sSerial=AddCarS.arguments[6]; if (AddCarS.arguments.length > 7) sDescr = AddCarS.arguments[7]; sTipCar = AddCarS.arguments[8]; //alert("##"+sTipCar) if (sCant!="" && sCant!="0") { alert("entrando aL ScANT!"); if (!isNaN(sCant)) { SrvClrParms(); sSrvIdProd = iId_prod; sSrvCant = sCant; sUsrID = GetCookie("sa_usrid"); if(sUsrID != "" && sUsrID != null) sSrvUser = sUsrID; sSrvObser = sObser; alert("sSrvObser"+sSrvObser); sSrvDescr = sDescr; sSrvIdUMed = iIdUMed sSrvUmed = sUMed; sSrvSerial = sSerial; sSrvTipCar = sTipCar; sTienda = GetCookie("sa_tienda"); if(sTienda != "" && sTienda != null) sSrvTienda = sTienda; else alert("Por favor ingrese su telefono nuevamente, por su seguridad su session ha sido cancelada."); sSession = GetCookie("sa_session"); if(sSession == "" || sSession == null) alert("No se puede agregar al carrito, sesión no valida"); else{ sSrvSession = sSession; if(sSrvSession == null) sSrvSession = ""; sSrvFcode = "upd_car"; SrvSubmit(); setTimeout('RefCarritoWin()',3000); } } } } else { if(sUsrID == null) sUsrID = ""; top.frames['f_top'].window.frames['f_centro3'].location.href ="reg_passwd.asp?usrid=" + sUsrID + "&tienda=" + sTienda; } //fin de Carro especial. } } function AddLisS(iIdProd,cad) { var sCant,sObser,sSerial,sUMed,iIdUMed,sDescr; sObser=cad; sSerial=""; sUMed=""; iIdUMed=""; sDescr="" sUsrID = GetCookie("sa_usrid"); if( sUsrID != "" && sUsrID != null) { if (AddLisS.arguments.length>=3) sCant=AddLisS.arguments[2]; else { sCant=""; PopupWinLS(iIdProd,sObser); return ; } if (AddLisS.arguments.length > 2) sObser=FilterComent(AddLisS.arguments[2]); if (AddLisS.arguments.length > 3) iIdUMed = AddLisS.arguments[3]; if (AddLisS.arguments.length > 4) sUMed = AddLisS.arguments[4]; if (AddLisS.arguments.length > 5) sSerial=AddLisS.arguments[5]; if (AddLisS.arguments.length > 6) sDescr = AddLisS.arguments[6]; if (sCant!="" && sCant!="0") { if (!isNaN(sCant)) { SrvClrParms(); sSrvIdProd = iIdProd; sSrvCant = sCant; sUsrID = GetCookie("sa_usrid"); if(sUsrID != "" && sUsrID != null) sSrvUser = sUsrID; else alert("Por favor ingrese su telefono nuevamente, por su seguridad su session ha sido cancelada."); sSrvObser = sObser; sSrvDescr = sDescr; sSrvIdUMed = iIdUMed sSrvUmed = sUMed; sSrvSerial = sSerial; sTienda = GetCookie("sa_tienda"); if(sTienda != "" && sTienda != null) sSrvTienda = sTienda; else alert("Por favor ingrese su telefono nuevamente, por su seguridad su session ha sido cancelada."); sSrvFcode = "upd_lista"; ListID = GetCookie("sa_listid"); if(ListID != "" && ListID != null) sSrvListID = ListID; else alert("Por favor ingrese su telefono nuevamente, por su seguridad su session ha sido cancelada."); SrvSubmit(); if(sSerial.length > 0 || sSerial > 0) alert("El artículo ha sido modificado."); } } } else { alert("Antes de agregar a Mi Lista, por favor identifiquese como usuario."); GotoRegistro(0); } } function PopupWinS(id_prod,cad,TipCar) { TipCar1=typeof(TipCar) sTienda = GetCookie("sa_tienda"); sCadena=cad; if(TipCar1=="undefined"){ window.open('popupCant.asp?tip_car='+TipCar+'&id_prod='+id_prod+'&sCadena='+sCadena+'&sTienda='+sTienda,'winPUP','width=400,height=200,scrollbars=no,toolbar=no,statusbar=no,left=165,top=180') }else{ window.open('../popupCant.asp?tip_car=' +TipCar+ '&id_prod='+id_prod+'&sTienda='+sTienda,'winPUP','width=400,height=200,scrollbars=no,toolbar=no,statusbar=no,left=165,top=180') } } function PopupWinLS(id_prod,cad) { sCadena=cad; sTienda = GetCookie("sa_tienda"); window.open('popupCantL.asp?id_prod='+id_prod+'&sCadena='+sCadena+'&sTienda='+sTienda,'winPUP','width=400,height=200,scrollbars=no,toolbar=no,statusbar=no,left=165,top=180') } function DeleteCookie(name) { var date_exp = new Date(1,1,1); SetCookie(name, "", date_exp); } function GetCookieValueEnd(pStartStr) { var pEndStr = document.cookie.indexOf(";", pStartStr) if( pEndStr == -1 )pEndStr = document.cookie.length; return pEndStr; } function FixCookieDate(date1) { var today = new Date(0); var mseconds = today.getTime(); if( mseconds > 0 ) date1.setTime( date1.getTime()-mseconds); } // name, value, expires, path, domain, secure function SetCookie(name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (2 < argc) ? argv[2] : null; var path = (3 < argc) ? argv[3] : null; var domain = (4 < argc) ? argv[4] : null; var secure = (5 < argc) ? argv[5] : false; var sCookie = name + "=" + escape (value) + ((expires == null) ? "; expires=" + expdate.toGMTString() : ("; expires=" + expires.toGMTString() )) + ((path == null) ? "/" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); document.cookie = sCookie; } function getCookieVal(offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie(name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } // ------------ END COOKIES -------------------------- function GotoRegistro(bInComp) { var sError, sHRef,sSecure, sTime; var sUsrID, sTienda, sSession, sColID; var today = new Date(); var sTime = today.getTime(); sTime = "&t=" + sTime; sUsrID = GetCookie("sa_usrid"); sTienda = GetCookie("sa_tienda"); sSession = GetCookie("sa_session"); sColID = GetCookie("sa_colid"); if (GotoRegistro.arguments.length > 1) { sError="&error=" + GotoRegistro.arguments[1]; } else { sError = ""; } if(bInComp==11) { top.frames['f_top'].window.frames['f_centro2'].location = "hom_login.asp"; top.frames['f_top'].window.frames['f_centro3'].location.href = "hombody.asp"; } else { sURL = "reg001.asp?usrid=" + sUsrID + "&tienda=" + sTienda + "&session=" + sSession + "&colid=" + sColID + sTime; sURL = BuildURL(sURL); top.frames['f_top'].window.frames['f_centro3'].location.href = sURL; } } function PopupSelTienda() { if(navigator.appName.substring(0,1)=='M') window.open ("popup_seltie.html","winPUP","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=410,height=160,left=165,top=180"); else window.open ("popup_seltie.html","winPUP","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=410,height=180,left=165,top=180"); } if(top == self && document.location.pathname.indexOf("popup") < 0 && document.location.pathname.indexOf("dir001") < 0) top.location.href = "default.html"; function GoHome() { bUsrChanging = 0; sURL = BuildURL("hombody.asp"); top.frames['f_top'].window.frames['f_centro3'].document.location=sURL; } function GotoPromociones() { sTienda = GetCookie("sa_tienda"); sURL = "ofertas.asp?idTienda=" + sTienda; top.frames['f_top'].window.frames['f_centro3'].location = sURL; } function AddCar(iId_prod) { var TipCar; if (AddCar.arguments.length==2){ //alert("AddCar:"+AddCar.arguments[1]) TipCar=AddCar.arguments[1] PopupWin(iId_prod,TipCar) }else{ var sCant,sDescr,sObser,sSerial,sUMed,iIdUMed, sTienda, sTipCar; sTienda = GetCookie("sa_tienda"); sDescr = ""; sObser=""; sUnimed=""; sSerial=""; if (sTienda != "" && sTienda != null) { if (AddCar.arguments.length>1) sCant=AddCar.arguments[1]; else { sCant=""; PopupWin(iId_prod); return ; } if (AddCar.arguments.length > 2) sObser = FilterComent(AddCar.arguments[2]); if (AddCar.arguments.length > 3) iIdUMed=AddCar.arguments[3]; if (AddCar.arguments.length > 4) sUMed=AddCar.arguments[4]; if (AddCar.arguments.length > 5) sSerial=AddCar.arguments[5]; if (AddCar.arguments.length > 6) sDescr = AddCar.arguments[6]; sTipCar = AddCar.arguments[7]; //alert("##"+sTipCar) if (sCant!="" && sCant!="0") { if (!isNaN(sCant)) { SrvClrParms(); sSrvIdProd = iId_prod; sSrvCant = sCant; sUsrID = GetCookie("sa_usrid"); if(sUsrID != "" && sUsrID != null) sSrvUser = sUsrID; sSrvObser = sObser; sSrvDescr = sDescr; sSrvIdUMed = iIdUMed sSrvUmed = sUMed; sSrvSerial = sSerial; sSrvTipCar = sTipCar; sTienda = GetCookie("sa_tienda"); if(sTienda != "" && sTienda != null) sSrvTienda = sTienda; else alert("Por favor ingrese su telefono nuevamente, por su seguridad su session ha sido cancelada."); sSession = GetCookie("sa_session"); if(sSession == "" || sSession == null) alert("No se puede agregar al carrito, sesión no valida"); else{ sSrvSession = sSession; if(sSrvSession == null) sSrvSession = ""; sSrvFcode = "upd_car"; SrvSubmit(); setTimeout('RefCarritoWin()',3000); } } } } else { if(sUsrID == null || sUsrID == "undefined") sUsrID = ""; sref= "hombody.asp"; top.frames['f_top'].window.frames['f_centro3'].location.href ="reg_passwd.asp?usrid=" + sUsrID + "&tienda=" + sTienda+ "&ref=" + sref; } //fin de Carro especial. } } //Agrega a Mi Lista function AddLis(iIdProd) { var sCant,sObser,sSerial,sUMed,iIdUMed,sDescr; sObser=""; sSerial=""; sUMed=""; iIdUMed=""; sDescr="" sUsrID = GetCookie("sa_usrid"); if( sUsrID != "" && sUsrID != null) { if (AddLis.arguments.length>=2) sCant=AddLis.arguments[1]; else { sCant=""; PopupWinL(iIdProd); return ; } if (AddLis.arguments.length > 2) sObser=FilterComent(AddLis.arguments[2]); if (AddLis.arguments.length > 3) iIdUMed = AddLis.arguments[3]; if (AddLis.arguments.length > 4) sUMed = AddLis.arguments[4]; if (AddLis.arguments.length > 5) sSerial=AddLis.arguments[5]; if (AddLis.arguments.length > 6) sDescr = AddLis.arguments[6]; if (sCant!="" && sCant!="0") { if (!isNaN(sCant)) { SrvClrParms(); sSrvIdProd = iIdProd; sSrvCant = sCant; sUsrID = GetCookie("sa_usrid"); if(sUsrID != "" && sUsrID != null) sSrvUser = sUsrID; else alert("Por favor ingrese su telefono nuevamente, por su seguridad su session ha sido cancelada."); sSrvObser = sObser; sSrvDescr = sDescr; sSrvIdUMed = iIdUMed sSrvUmed = sUMed; sSrvSerial = sSerial; sTienda = GetCookie("sa_tienda"); if(sTienda != "" && sTienda != null) sSrvTienda = sTienda; else alert("Por favor ingrese su telefono nuevamente, por su seguridad su session ha sido cancelada."); sSrvFcode = "upd_lista"; ListID = GetCookie("sa_listid"); if(ListID != "" && ListID != null) sSrvListID = ListID; else alert("Por favor ingrese su telefono nuevamente, por su seguridad su session ha sido cancelada."); SrvSubmit(); if(sSerial.length > 0 || sSerial > 0) alert("El artículo ha sido modificado."); } } } else { alert("Antes de agregar a Mi Lista, por favor identifiquese como usuario."); GotoRegistro(0); } } function SrvClrParms() { sSrvIdProd = ""; sSrvCant = ""; sSrvUser = ""; sSrvOlduser = ""; sSrvIdUMed = 0; sSrvUmed = ""; sSrvDescr = ""; sSrvObser = ""; sSrvTienda = ""; sSrvColid = ""; sSrvSerial = ""; sSrvFcode = ""; sSrvSession = ""; sSrvListID = ""; sSrvTipCar = ""; } var iSubmit = 0; function SrvSubmit() { var frm; if(IsDefined("top.frames['f_lista'].document.frm_f")) { bServerDone = 0; iSubmit = 0; frm = top.frames['f_lista'].document.frm_f; frm.id_prod.value = sSrvIdProd; frm.cant.value = sSrvCant; frm.user.value = sSrvUser; frm.olduser.value = sSrvOlduser; frm.idumed.value = sSrvIdUMed; frm.umed.value = sSrvUmed; frm.descr.value = sSrvDescr; frm.obser.value = sSrvObser; frm.tienda.value = sSrvTienda; frm.colid.value = sSrvColid; frm.serial.value = sSrvSerial; frm.fcode.value = sSrvFcode; frm.session.value = sSrvSession; frm.ListID.value = sSrvListID; frm.TipCar.value = sSrvTipCar; frm.submit(); } else { if( iSubmit < 8 ) { iSubmit = iSubmit + 1; setTimeout("SrvSubmit()", 400 * iSubmit); } } } function FilterComent(s) { var iS,iLength; var str; str = "" if(IsEmpty(s)) s = ""; iLength = s.length; for ( i=0; i < iLength; ++i) { if( s.charAt(i) != "'" && s.charAt(i) != '"') str = str + s.charAt(i); } return str; } // Refreshing the Carrito function RefCarritoWin(tipcar) { //alert("Refcarrito:"+tipcar) if(tipcar=="undefined")tipcar=""; sTienda = GetCookie("sa_tienda"); if(sTienda == null) sTienda = ""; sUsrID = GetCookie("sa_usrid"); if(sUsrID == null) sUsrID = ""; sSession = GetCookie("sa_session"); if(sSession == null) sSession = ""; if(IsDefined("top.frames['f_top'].window.frames['f_car02'].document")) top.frames['f_top'].window.frames['f_car02'].document.location.href = "car02.asp?tip_car=" + tipcar + "&sTienda=" + sTienda + "&sSession=" + sSession + "&sUsrID=" + sUsrID; } //Funcion para el popup para la cantidad function PopupWin(id_prod,TipCar) { TipCar1=typeof(TipCar) sTienda = GetCookie("sa_tienda"); if(TipCar1=="undefined"){ window.open('popupCant.asp?tip_car=' +TipCar+ '&id_prod='+id_prod+'&sTienda='+sTienda,'winPUP','width=400,height=200,scrollbars=no,toolbar=no,statusbar=no,left=165,top=180') }else{ //alert("Popipwin:"+TipCar) window.open('../popupCant.asp?tip_car=' +TipCar+ '&id_prod='+id_prod+'&sTienda='+sTienda,'winPUP','width=400,height=200,scrollbars=no,toolbar=no,statusbar=no,left=165,top=180') } } function PopupWinL(id_prod) { sTienda = GetCookie("sa_tienda"); window.open('popupCantL.asp?id_prod='+id_prod+'&sTienda='+sTienda,'winPUP','width=400,height=200,scrollbars=no,toolbar=no,statusbar=no,left=165,top=180') } //fin del popup function ChangeUser() { ClearUserData(); top.frames['f_top'].window.frames['f_centro2'].location = "hom_login.asp"; top.frames['f_top'].window.frames['f_centro3'].location.href = "hombody.asp"; } function ClearUserData() { DeleteCookie("sa_colid"); DeleteCookie("sa_tienda"); DeleteCookie("sa_usrid"); SrvClrParms(); sSrvFcode = "cierra_session"; SrvSubmit(); } function GetSession() { var sSession; sSession = GetCookie("sa_session"); if( sSession == "" || sSession == null) { SrvClrParms(); sSrvFcode = "get_session"; SrvSubmit(); sSession = top.frames['f_lista'].document.session.SessionID.value; SetCookie("sa_session",sSession); } return sSession; } function GotoCarrito(tip_car) { orden = GetCookie("orden_ca"); sUsrID = GetCookie("sa_usrid"); sTienda = GetCookie("sa_tienda"); sSession = GetCookie("sa_session"); if(top.frames['f_top'].Password == 1){ var sArgs,orden; sArgs = "?usrid=" + sUsrID + "&tienda=" + sTienda + "&session=" + sSession + "&orden=" + orden + "&tip_car=" + tip_car; sURL = "fpa001.asp" + sArgs; ShowSearch(); top.frames['f_top'].window.frames['f_centro3'].location = sURL; } else{ sHRef = BuildURL(''); if(UsesHTTPS()) sSecure = '&secure=1'; else sSecure = '&secure=0'; if(sUsrID == null) sUsrID = ""; sTienda = GetCookie("sa_tienda"); if(sTienda == null) sTienda = ""; sSession = GetCookie("sa_session"); if(sSession == null) sSession = ""; sURL = "fra_passwd.asp?usrid=" + sUsrID + "&op=1" + "&tienda=" + sTienda + "&compra=1" + sSecure + "&session=" + sSession + "&href=" + sHRef; sURL = sURL + "&orden=" + orden + "&OpenWhat=C"+ "&tip_car=" + tip_car; sURL = BuildURL(sURL); top.frames['f_top'].window.frames['f_centro3'].location.href = sURL; } } function GotoMuestra(tip_car) { orden = GetCookie("orden_ca"); sUsrID = GetCookie("sa_usrid"); sTienda = GetCookie("sa_tienda"); sSession = GetCookie("sa_session"); if(top.frames['f_top'].Password == 1){ var sArgs,orden; sArgs = "?usrid=" + sUsrID + "&tienda=" + sTienda + "&session=" + sSession + "&orden=" + orden + "&tip_car=" + tip_car; sURL = "car001.asp" + sArgs; ShowSearch(); top.frames['f_top'].window.frames['f_centro3'].location = sURL; } else{ sHRef = BuildURL(''); if(UsesHTTPS()) sSecure = '&secure=1'; else sSecure = '&secure=0'; if(sUsrID == null) sUsrID = ""; sTienda = GetCookie("sa_tienda"); if(sTienda == null) sTienda = ""; sSession = GetCookie("sa_session"); if(sSession == null) sSession = ""; sURL = "fra_passwd.asp?usrid=" + sUsrID + "&op=1" + "&tienda=" + sTienda + "&compra=1" + sSecure + "&session=" + sSession + "&href=" + sHRef; sURL = sURL + "&orden=" + orden + "&OpenWhat=M"+ "&tip_car=" + tip_car; sURL = BuildURL(sURL); top.frames['f_top'].window.frames['f_centro3'].location.href = sURL; } } function GotoPizza() { orden = GetCookie("orden_ca"); sUsrID = GetCookie("sa_usrid"); sTienda = GetCookie("sa_tienda"); sSession = GetCookie("sa_session"); if(top.frames['f_top'].Password == 1){ var sArgs,orden; sArgs = "?usrid=" + sUsrID + "&tienda=" + sTienda + "&session=" + sSession + "&orden=" + orden; sURL = "mecanica.html" + sArgs; ShowSearch(); top.frames['f_top'].window.frames['f_centro3'].location = sURL; } else{ sHRef = BuildURL(''); if(UsesHTTPS()) sSecure = '&secure=1'; else sSecure = '&secure=0'; if(sUsrID == null) sUsrID = ""; sTienda = GetCookie("sa_tienda"); if(sTienda == null) sTienda = ""; sSession = GetCookie("sa_session"); if(sSession == null) sSession = ""; sURL = "fra_passwd.asp?usrid=" + sUsrID + "&tienda=" + sTienda + "&compra=1" + sSecure + "&session=" + sSession + "&href=" + sHRef; sURL = sURL + "&orden=" + orden + "&OpenWhat=Pi"; sURL = BuildURL(sURL); top.frames['f_top'].window.frames['f_centro3'].location.href = sURL; } } function SetUsrID(sUsrID) { if(sUsrID != "" && sUsrID != 0 && sUsrID != "0") SetCookie("sa_usrid", sUsrID); } function NoTelReg() { var sColID; sColID = GetCookie("sa_colid"); if (sColID == "" || sColID == null) { alert("Bienvenido a Superama.\n\nSu teléfono no está registrado.\nSi desea realizar sus compras con nosotros, por favor escriba su código postal en la siguiente ventana.\n\nPara continuar dé click en el botón"); PopupSelTienda(); } } function SetStoreCol(s, sCol) { SetCookie("sa_colid", sCol); SetCookie("sa_tienda", s); UpdateStore(); top.frames['f_top'].window.frames['f_centro1'].location.reload(); } function SetStore(sTienda) { if( sTienda != "" && sTienda != null) SetCookie("sa_tienda", sTienda); } function UpdateStore() { var sColID, sUsrID ,sTienda; SrvClrParms(); sUsrID = GetCookie("sa_usrid"); sTienda = GetCookie("sa_tienda"); sColID = GetCookie("sa_colid"); sSrvUser = sUsrID; sSrvTienda = sTienda; sSrvColid = sColID; sSrvFcode = "upd_tienda"; SrvSubmit(); } function SetUsrID(sUsrID) { if( sUsrID != "" && sUsrID!=0 && sUsrID!="0" ) SetCookie("sa_usrid", sUsrID); } function GotoFormReg() { var sColID; sColID = GetCookie("sa_colid"); if (sColID == "" || sColID == null || sColID == "undefined") { alert("Antes de registrarse, por favor seleccione una tienda"); PopupSelTienda(); } sTienda = GetCookie("sa_tienda"); sSession = GetCookie("sa_session"); if(sSession == "" || sSession == null) alert("No se puede ir al registro, sesión invalida"); else{ sUsrID = GetCookie("sa_usrid"); sURL = "reg001.asp?usrid=" + sUsrID + "&tienda=" + sTienda + "&session=" + sSession + "&colid=" + sColID; top.frames['f_top'].window.frames['f_centro3'].location = BuildURL(sURL); } } function GoHome() { bUsrChanging = 0; sURL = BuildURL("hombody.asp"); top.frames['f_top'].window.frames['f_centro3'].document.location=sURL; } function SendPassword(UsuarioID) { var bDone = false; if( IsDefined("top.frames['f_lista'].document.frm_f") ) { if(UsuarioID > 0) sUsrID = UsuarioID; else sUsrID = GetCookie("sa_usrid"); SrvClrParms(); sSrvUser = sUsrID; sSrvFcode = "sendpwd"; SrvSubmit(); bDone = true; iSPCount = 0; } if( bDone == false && iSPCount < 8 ) { iSPCount = iSPCount + 1; setTimeout("SendPassword()", iSPCount*200); } } function ReloadRegistro() { var sURL, sUsrID, sTienda, sSession, sColID; sUsrID = GetCookie("sa_usrid"); sTienda = GetCookie("sa_tienda"); sSession = GetCookie("sa_session"); sColID = GetCookie("sa_colid"); sURL = "reg001.asp?usrid=" + sUsrID + "&tienda=" + sTienda + "&session=" + sSession + "&colid=" + sColID; top.frames['f_top'].window.frames['f_centro3'] = sURL; } function TransferCar(sOld,s) { sTienda = GetCookie("sa_tienda"); sColID = GetCookie("sa_colid"); SrvClrParms(); sSrvOlduser = sOld; sSrvUser = s; sSrvSession = GetCookie("sa_session"); sSrvUser = sUsrID; sSrvTienda = sTienda; sSrvColid = sColID; sSrvFcode = "transfer_car"; SrvSubmit(); RefCarritoWin(); } function ShowSearch(){ if( IsDefined("top.frames['f_top'].window.frames['f_izq'].window.frames['m_arriba'].document.search")) { top.frames["f_top"].window.frames["f_izq"].window.frames["m_arriba"].search.imagen_busqueda.src="images/procesando.gif"; top.frames["f_top"].window.frames["f_izq"].window.frames["m_arriba"].div_busca.style.visibility="visible"; } } function HideSearch(){ if( IsDefined("top.frames['f_top'].window.frames['f_izq'].window.frames['m_arriba'].document.search")) { top.frames['f_top'].window.frames['f_izq'].window.frames['m_arriba'].div_busca.style.visibility="hidden"; } if( IsDefined("top.frames['f_top'].window.frames['f_izq'].window.frames['m_arriba'].document.search.imagen_busqueda")) { top.frames["f_top"].window.frames["f_izq"].window.frames["m_arriba"].search.imagen_busqueda.src="images/espera.gif"; } } var treepop = null; function Gotreepop(){ if( treepop ) { if( ! treepop.closed ) {treepop.focus(); } else{ treepop = window.open("popup_three.asp","menu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=550,height=650,left=200,top=25"); } } else{ treepop = window.open("popup_three.asp","menu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=550,height=650,left=200,top=25"); } } /************************************************/ var offsetfrommouse=[10,10]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset var displayduration=0; //duration in seconds image should remain visible. 0 for always. var currentimageheight = 400; // maximum image size. var padding=10; // padding must by larger than specified div padding in stylessheet // Global variables for sizes of hoverimg // Defined in "showtrail()", used in "followmouse()" var zoomimg_w=0; var zoomimg_h=0; if (document.getElementById || document.all){ document.write('
'); document.write('
'); } function getObj(name) { if (document.getElementById) { this.obj = document.getElementById(name); this.style = document.getElementById(name).style; } else if (document.all) { this.obj = document.all[name]; this.style = document.all[name].style; } else if (document.layers) { this.obj = document.layers[name]; this.style = document.layers[name]; } } function gettrail(){ return new getObj("trailimageid"); } function truebody(){ return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body } function showtrail(imagename,title,oriwidth,oriheight,zoomimgwidth,zoomimgheight, image, startx, starty, startw, starth){ var imagen= imagename; alert("Show trail...."); var titulo= title; zoomimg_w=zoomimgwidth; zoomimg_h=zoomimgheight; if (zoomimgheight > 0){ currentimageheight = zoomimgheight; } trailobj = gettrail().obj; trailobj.style.width=(zoomimgwidth+(2*padding))+"px"; trailobj.style.height=(zoomimgheight+(2*padding))+"px"; trailobj.setAttribute("startx", startx); trailobj.setAttribute("starty", starty); trailobj.setAttribute("startw", startw); trailobj.setAttribute("starth", starth); trailobj.setAttribute("imagename", imagename); trailobj.setAttribute("imgtitle", titulo); document.onmousemove=followmouse; } function hidetrail(){ alert("Hide"); trailstyle = gettrail().style; trailstyle.visibility = "hidden"; document.onmousemove = ""; trailstyle.left = "-2000px"; trailstyle.top = "-2000px"; } function followmouse(e){ var xcoord=offsetfrommouse[0]; var ycoord=offsetfrommouse[1]; var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15; var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight); var relativeX = null; var relativeY = null; if (typeof e != "undefined"){ if ((typeof e.layerX != "undefined") && (typeof e.layerY != "undefined")) { relativeX = e.layerX; relativeY = e.layerY; } else if ((typeof e.x != "undefined") && (typeof e.y != "undefined")) { relativeX = e.x; relativeY = e.y; } if (docwidth - e.pageX < zoomimg_w + (3 * padding)) { xcoord = e.pageX - xcoord - zoomimg_w - (2 * offsetfrommouse[0]); } else { xcoord += e.pageX; } if (docheight - e.pageY < zoomimg_h + (2 * padding)){ ycoord += e.pageY - Math.max(0,(0 + zoomimg_h + (5 * padding) + e.pageY - docheight - truebody().scrollTop)); } else { ycoord += e.pageY; } } else if (typeof window.event != "undefined"){ if ((typeof event.x != "undefined") && (typeof event.y != "undefined")) { relativeX = event.x; relativeY = event.y; } else if ((typeof event.offsetX != "undefined") && (event.offsetY != "undefined")) { relativeX = event.offsetX; relativeY = event.offsetY; } if (docwidth - event.clientX < zoomimg_w + (3 * padding)) { xcoord = event.clientX - xcoord - zoomimg_w - (2 * offsetfrommouse[0]); } else { xcoord += truebody().scrollLeft+event.clientX; } if (docheight - event.clientY < zoomimg_h + (2 * padding)){ ycoord += event.clientY - Math.max(0,(0 + zoomimg_h + (5 * padding) + event.clientY - docheight - truebody().scrollTop)); } else { ycoord += truebody().scrollTop + event.clientY; } } trail = gettrail(); startx = trail.obj.getAttribute("startx"); starty = trail.obj.getAttribute("starty"); startw = trail.obj.getAttribute("startw"); starth = trail.obj.getAttribute("starth"); imagename = trail.obj.getAttribute("imagename"); title = trail.obj.getAttribute("imagename"); alert("imagen titulo: "+imagename); // calculate and set position BEFORE switching to visible var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15; var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight); if(ycoord < 0) { ycoord = ycoord*-1; } if ((trail.style.left == "-2000px") || (trail.style.left == "")) { trail.style.left=xcoord+"px"; } if ((trail.style.top == "-2000px") || (trail.style.top == "")) { trail.style.top=ycoord+"px"; } trail.style.left=xcoord+"px"; trail.style.top=ycoord+"px"; // alert (trail.style.left+","+trail.style.top); if (trail.style.visibility != "visible") { if (((relativeX == null) || (relativeY == null)) || ((relativeX >= startx) && (relativeX <= (startx + startw)) && (relativeY >= starty) && (relativeY <= (starty + starth)))){ newHTML = '

' + title + '

'; newHTML = newHTML + '
'; trail.obj.innerHTML = newHTML; trail.style.visibility="visible"; } } } /*************************************************/ var winPUPDetails=null; function Show180(descr,price,IdDep,idbarcode){ if(descr.indexOf("&") >= 0){ var cadena = ""; var ampersan = descr.split("&"); for(X=0;X 32) && (window.event.keyCode < 48)) || ((window.event.keyCode > 57) && (window.event.keyCode < 65)) || ((window.event.keyCode > 90) && (window.event.keyCode < 97)) || ((window.event.keyCode > 122) && (window.event.keyCode < 208)) ){ window.event.keyCode = 0 } } var treefuji = null; function abrefuji(var_usuario, var_tienda){ var_pagfuji = "fuji/popup_fuji.asp?usuario="+var_usuario+"&tienda="+var_tienda; if( treefuji ) { if( ! treefuji.closed ) {treefuji.focus(); } else{ treefuji = window.open(var_pagfuji,"menu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=450,height=250,left=200,top=25"); } } else{ treefuji = window.open(var_pagfuji,"menu","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=450,height=250,left=200,top=25"); } return true; } //FUNCION PARA VALIDAR LAS DIRECCIONES DE CORREO ELECTRONICO //REGRESA VALORES: TRUE Y FALSE function mailoCheck(txfObject,emailStr) { if( txfObject.value == "" ){ return false } /* The following pattern is used to check if the entered e-mail address fits the user@domain format. It also is used to separate the username from the domain. */ var emailPat=/^(.+)@(.+)$/ /* The following string represents the pattern for matching all special characters. We don't want to allow special characters in the address. These characters include ( ) < > @ , ; : \ " . [ ] */ var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]" /* The following string represents the range of characters allowed in a username or domainname. It really states which chars aren't allowed. */ var validChars="\[^\\s" + specialChars + "\]" /* The following pattern applies if the "user" is a quoted string (in which case, there are no rules about which characters are allowed and which aren't; anything goes). E.g. "jiminy cricket"@disney.com is a legal e-mail address. */ var quotedUser="(\"[^\"]*\")" /* The following pattern applies for domains that are IP addresses, rather than symbolic names. E.g. joe@[123.124.233.4] is a legal e-mail address. NOTE: The square brackets are required. */ var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/ /* The following string represents an atom (basically a series of non-special characters.) */ var atom=validChars + '+' /* The following string represents one word in the typical username. For example, in john.doe@somewhere.com, john and doe are words. Basically, a word is either an atom or quoted string. */ var word="(" + atom + "|" + quotedUser + ")" // The following pattern describes the structure of the user var userPat=new RegExp("^" + word + "(\\." + word + ")*$") /* The following pattern describes the structure of a normal symbolic domain, as opposed to ipDomainPat, shown above. */ var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$") /* Finally, let's start trying to figure out if the supplied address is valid. */ /* Begin with the coarse pattern to simply break up user@domain into different pieces that are easy to analyze. */ var matchArray=emailStr.match(emailPat) if (matchArray==null) { /* Too many/few @'s or something; basically, this address doesn't even fit the general mould of a valid e-mail address. */ alert("Dirección de E-mail incorrecta (Verifique @ y .'s)"); txfObject.focus(); txfObject.select(); return false; } var user=matchArray[1] var domain=matchArray[2] // See if "user" is valid if (user.match(userPat)==null) { // user is not valid alert("Nombre de usuario invalido."); txfObject.focus(); txfObject.select(); return false; } /* if the e-mail address is at an IP address (as opposed to a symbolic host name) make sure the IP address is valid. */ var IPArray=domain.match(ipDomainPat) if (IPArray!=null) { // this is an IP address for (var i=1;i<=4;i++) { if (IPArray[i]>255) { alert("Direccion IP es invalida!"); txfObject.focus(); txfObject.select(); return false; } } return true } // Domain is symbolic name var domainArray=domain.match(domainPat) if (domainArray==null) { alert("Dominio invalido."); txfObject.focus(); txfObject.select(); return false; } /* domain name seems valid, but now make sure that it ends in a three-letter word (like com, edu, gov) or a two-letter word, representing country (uk, nl), and that there's a hostname preceding the domain or country. */ /* Now we need to break up the domain to get a count of how many atoms it consists of. */ var atomPat=new RegExp(atom,"g") var domArr=domain.match(atomPat) var len=domArr.length if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) { // the address must end in a two letter or three letter word. alert("La dirección debera estar en un domino de tres letras o dos."); txfObject.focus(); txfObject.select(); return false; } // Make sure there's a host name preceding the domain. if (len<2) { var errStr="Falta el hostname!" alert(errStr); txfObject.focus(); txfObject.select(); return false; } // If we've gotten this far, everything's valid! return true; } // FUNCION QUE VALIDA EL TEXTO QUE INGRESAN //EJEMPLO DE LLAMADA onblur=javascript:validatext(this) function validatext( txfObject ){ if( txfObject.value == "" ){ return false } if( !charvalidos( txfObject.value ) ){ alert( 'Solo se permiten caracteres alfabéticos [0-9, A-Z].\n (El carácter "Ñ" y acentos no son aceptados.)' ) txfObject.focus() txfObject.select() return } } // CARACTERES VALIDOS function charvalidos( value ){ var regExp = /^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ]+$/; return regExp.test( value ) }