var gl; $(function () { gl = { ventana : $('#ventana-gral'), fndoscuro: $('#fondo-oscuro'), noticia: $('#noticia'), leer: $("#leer"), prusuario: "imagencont/scripts/usuarios/procesausuarios.php", //error mail em_nombre: $("#forma-nombre"), em_mail:$("#forma-email"), em_tel:$("#forma-tel"), em_cpth:$("#forma-codcpth"), em_imcap:$("#forma-img-codcpth"), obligatorio:'* Obligatorio', cloc:true, mloc:true }; }); function CargaRSS(){ gl.noticia.load('imagencont/scripts/rss_ajax.php?action=RSS',function(){gl.noticia.show();RSSTemp();}); } function RSSTemp(){ i=1; pausa=false; gl.noticia.hover(function() {pausa = true;}, function() {pausa = false;}); $('#tabs').hover(function() {pausa = true;}, function() {pausa = false;}); $(".tabs1").click(function () {i=1;}); $(".tabs2").click(function () {i=2;}); $(".tabs3").click(function () {i=3;}); $(".tabs4").click(function () {i=4;}); $(".tabs5").click(function () {i=0;}); var varpausa= function(){ if (gl.leer.is(":visible")){pausa = true; } if(!pausa && gl.noticia.is(":visible")){ LeerRSS('RSS',i,0); i=i+1; if(i==5){i=0;} } } setInterval(varpausa, 6000); } function LeerRSS(tipoStr, numero, noticia){ vnum=numero; vtip=tipoStr; if( vtip == "RSS"){gl.leer.fadeOut(500, function(){ $("leer").hide() });} if( vtip == "LEER"){gl.noticia.fadeOut(500, function(){ $("noticia").hide() }); } if( vtip == "RSS"){ gl.noticia.show(); nummas=vnum+1; for (bor=0;bor<=4;bor++){ $('#tabs'+(bor+1)).removeClass("tabs"+(bor+1)+"h"); $('#cnt-not'+bor).hide(); } $("#tabs"+nummas).addClass("tabs"+nummas+"h"); $('#cnt-not'+vnum).fadeIn(300); } if( vtip == "LEER"){ gl.leer.load('imagencont/scripts/rss_ajax.php?action='+ tipoStr +'&id='+ numero+'¬='+ noticia,function(){gl.leer.fadeOut(500);gl.leer.fadeIn(500);}); } } function sinusuario_checkerror(){ $(".forma-error").hide(); var hasErrore = false; var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; var nombreVal = $("#forma-nombre").val(); if(nombreVal =="") { $("#forma-nombre").after('* Obligatorio'); hasErrore = true; } var emailVal = $("#forma-email").val(); if(emailVal =="") { $("#forma-email").after('* Obligatorio'); hasErrore = true; } else if (!emailReg.test(emailVal)) { $("#forma-email").width(120); $("#forma-email").after('* e-mail invaliddo'); hasErrore = true; } else { $("#forma-email").width(140); } var telVal = $("#forma-tel").val(); if(telVal =="") { $("#forma-tel").after('* Obligatorio'); hasErrore = true; } var codcaptchaVal = $("#forma-codcpth").val(); var codResp= $.ajax({type: "POST", url:"imagencont/scripts/valdatos.php", data:{capcod:codcaptchaVal, tipo:'codigo'}, async: false }).responseText; if(codcaptchaVal == "") { $("#forma-img-codcpth").after('* Obligatorio'); hasErrore = true; } else { if(codResp=="no"){ $("#forma-img-codcpth").after('* Codigo incorrecto'); $("#forma-img-codcpth").attr("src","imagencont/scripts/cptch.php?" + Math.random()); hasErrore = true; } } if(hasErrore == false) { $(this).hide(); } } function registro_checkerror(){ var hayError = false, emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/, largocampo=210, aux=null, pos=null, campo=null; $(".registro-error").hide(); $("#usuario-registro-form :input[type=text],#usuario-registro-form :input[type=password]").each(function(index){ campo=$(this); if(campo.val() == "") { //vacio campo.after(gl.obligatorio); hayError = true; } else { if(campo.val().length <= 5 && campo.is('.usorig, .orig')) {//pocos caracteres campo.width(largocampo-100); campo.after('* Debe ser de 6 o mas caracteres'); hayError = true; } else { //console.log(campo); if(!campo.is(".rno")){campo.width(largocampo);} if (campo.is('.orig')){ aux=campo.val(); //pos=campo; } else { if(campo.val()!=aux && aux!=null){ //no son iguales //console.log(index + campo.val()); $(this).after('* Deben ser iguales'); hayError = true; } else { if(!emailReg.test(campo.val()) && campo.val()!="" && campo.is('.origm')) { //email incorrecto campo.after('* e-mail invalido'); hayError = true; } } aux=null; } } } }); //provincia var provVal = $("#usuario-registro-provincia option:selected").text(); if(provVal =="Elegir") {$("#usuario-registro-provincia").after(gl.obligatorio); hayError = true;} //captcha var codVal = $("#usuario-registro-codcpth").val(); var codResp= $.ajax({type: "POST", url:"imagencont/scripts/valdatos.php", data:{capcod: codVal, tipo:'codigo'}, async: false }).responseText; if(codResp=="no" && codVal!=""){ $("#usuario-registro-codcpth").after('* Codigo incorrecto'); $("#usuario-registro-img-codcpth").attr("src","imagencont/scripts/cptch.php?" + Math.random()); hayError = true; } if(hayError == false) { registro_enviar(); //$(this).hide(); } } function cv_checkerror(){ var hayError = false, emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/, campo=null; $(".registro-error").hide(); $("#ventana-cv :input[type=text]").each(function(index){ campo=$(this); if(campo.val() == "") { //vacio campo.after(gl.obligatorio); hayError = true; } }); if(!emailReg.test($("#cvemail").val()) && $("#cvemail").val()!=""){ $("#cvemail").after('* e-mail invalido'); hayError = true;} if($("#cvarch").val()==""){ $("#cvarch").after('* Obligatorio'); hayError = true;} if(hayError == false) { return true; } } function cv_res(respuesta){ $(".registro-error").hide(); if(respuesta=="err_cvusu"){ $("#cvnombre").after('* invalido');} if(respuesta=="err_cvape"){ $("#cvapellido").after('* invalido');} if(respuesta=="err_cvmail"){ $("#cvemail").after('* invalido');} if(respuesta=="err_cvdoc"){ $("#cvarch").after('* invalido');} if(respuesta=="cv_ok"){ ventanacv_cierra();} } function registro_enviar(){ var regusu=$("#usuario-registro-usuario"), regclv=$("#usuario-registro-clave"), regeml=$("#usuario-registro-email"), regnom=$("#usuario-registro-nombre"), regape=$("#usuario-registro-apellido"), regtid=$("#usuario-registro-identificacion"), regnid=$("#usuario-registro-idenum"), regiva=$("#usuario-registro-civa"), regdom=$("#usuario-registro-domicilio"), regtel=$("#usuario-registro-tel"), regcda=$("#usuario-registro-ciudad"), regpro=$("#usuario-registro-provincia"), error_validacion = false, aux=null; $("#sepocu").load(gl.prusuario,{usuario:regusu.val(), clave:regclv.val(), email:regeml.val(), nombre:regnom.val(), apellido:regape.val(), tel:regtel.val(), ciudad:regcda.val(), provincia:regpro.val(), domicilio:regdom.val(), tipid:regtid.val(), numid:regnid.val(), condiva:regiva.val(), tipo:"regusuario"},function(respuesta, status, xhr){ //mismo usuario if (xhr.responseText == "err_mismousuario" ){ regusu.width(115); regusu.after('* El usuario ya existe'); error_validacion=true;} else {regusu.width(210); } //mismo email if (xhr.responseText == "err_mismoemail" ){ $("#usuario-registro-email").width(115); $("#usuario-registro-email").after('* El e-mail ya existe'); error_validacion=true;} else {$("#usuario-registro-email").width(210); } switch(xhr.responseText){ case "err_vusuario": aux=regusu; break; case "err_vclave": aux=regclv; break; case "err_vmail": aux=regeml; break; case "err_vnombre": aux=regnom; break; case "err_vapellido": aux=regape; break; case "err_vtel": aux=regtel; break; case "err_vciudad": aux=regcda; break; case "err_vprovincia": aux=regpro; break; case "err_vtid": aux=regtid; break; case "err_vnid": aux=regnid; break; case "err_vciva": aux=regiva; break; case "err_vdom": aux=regdom; break; case "err_vcuit": regnid.after('* CUIT no valido');error_validacion=true; break; } if(aux){ aux.width(115); aux.after('* Caracteres invalidos'); error_validacion=true; } if (!error_validacion){ mensajereg='
Registro exitoso
Se ha registrado exitosamente, un e-mail ha sido enviado a su cuenta de correo para validar el nuevo usuario.

'; $("#subventana-gral .cont-int").html(mensajereg); subventana_muestra("#ventana-gral", "sub-registrook") } }); } function registro_lvcheck(tipo){ $(".registro-error").hide(); reglusu=$("#usuario-registro-usuario"); regleml=$("#usuario-registro-email"); if (tipo=="reglckus"){lvcheck=reglusu.val();pos=reglusu;msg="usuario";} if (tipo=="reglckml"){lvcheck=regleml.val();pos=regleml;msg="e-mail";} $("#sepocu").load(gl.prusuario,{lvtipo:tipo, acheck:lvcheck, tipo:"reglvchk"},function(respuesta, status, xhr){ if (xhr.responseText == "ndisp" ){ pos.width(115); pos.after('* El '+msg+' ya existe'); error_validacion=true;} else {reglusu.width(210); } if (xhr.responseText == "sdisp" ){ pos.width(115); pos.after('* correcto'); } if(xhr.responseText == "verror" ){ pos.width(115); pos.after('* Caracteres invalidos'); error_validacion=true; } else { pos.width(210); } } )} function valida_resend(email){ $("#sepocu").load(gl.prusuario,{mail:email, tipo:"valrsnd"},function(respuesta, status, xhr){ if (xhr.responseText == "rsnd_ok" ){ mensajevrsnd='
Reenvio de validación
Se ha enviado una nueva validación para su cuenta de usuario, revise su casilla de e-mail

'; } else { mensajevrsnd='
Reenvio de validación
Se ha producido un error, vuelva a intentarlo mas tarde

'; } $("#subventana-gral .cont-int").html(mensajevrsnd); subventana_muestra("#ventana-gral","sub-valrsnd"); }) } function habilitapedi(){ var acepta=$("#forma-aceptatyc").attr("checked"); if (acepta==true){ $("#jcart-paypal-checkout").attr("disabled",false) } else { $("#jcart-paypal-checkout").attr("disabled",true) } } function cambios_checkerror(){ var hayError = false, emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/, largocampo=210, aux=null, pos=null, campo=null; $(".registro-error").hide(); $("#usuario-opciones :input[type=text],#usuario-opciones :input[type=password]").each(function(index){ campo=$(this); if(campo.val() == "") { //vacio if (!campo.is('.nocheck')){campo.after(gl.obligatorio); hayError = true;} } else { if ($("#opciones-clave").val()!="" && ($("#opciones-clavenue").val()==""||$("#opciones-claverep").val()=="")){hayError = true;} if(campo.val().length <= 5 && campo.is('.orig')) {//pocos caracteres campo.width(largocampo-100); campo.after('* Debe ser de 6 o mas caracteres'); hayError = true; } else { campo.width(largocampo); if (campo.is('.orig')){ aux=campo.val(); //pos=campo; } else { if(campo.val()!=aux && aux!=null){ //no son iguales $(this).after('* Deben ser iguales'); hayError = true; } else { if(!emailReg.test(campo.val()) && campo.val()!="" && campo.is('.origm')) { //email incorrecto campo.after('* e-mail invalido'); hayError = true; } } aux=null; } } } }); //provincia var provVal = $("#usuario-registro-provincia option:selected").text(); if(provVal =="Elegir") {$("#usuario-registro-provincia").after(gl.obligatorio); hayError = true;} if(hayError == false) { cambios_enviar(); } } function cambio_cbcom(tipo){ var clo=$("#cl-ocu"), cro=$("#cr-ocu"), mlo=$("#ml-ocu"), emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/, comprc=true, compre=true, hay_error=false; $(".registro-error").hide(); if(tipo=="clave"){ pvalor=$("#opciones-clave").val(); if(pvalor.length <= 5){ comprc=false; }else{ comprc=true; } } if(tipo=="email"){pvalor=$("#opciones-email").val();if(!emailReg.test(pvalor) && pvalor!=""){compre=false;}else{compre=true;}} if(comprc && compre) { $("#sepocu").load(gl.prusuario,{valor:pvalor, tipo:"cmblvchk", param:tipo},function(respuesta, status, xhr){ if (xhr.responseText == "cmb_nclok" && tipo=="clave"){ gl.cloc=false; clo.fadeIn(150); cro.fadeIn(150); $("#opciones-clavenue,#opciones-claverep").removeClass("nocheck"); $("#opciones-clavenue").focus(); } else if(tipo=="clave" && xhr.responseText != "cerror"){ $("#opciones-clave").width(115); $("#opciones-clave").after('* Clave Incorrecta'); hay_error=true; } if (xhr.responseText == "cmb_emok" && tipo=="email"){ $("#opciones-emailrep").val(""); gl.mloc=false; console.log(gl.mloc); console.log(gl.cloc); mlo.fadeIn(150); $("#opciones-emailrep").focus(); } else if(tipo=="email" && xhr.responseText != "cerror"){ $("#opciones-email").width(115); $("#opciones-email").after('* El e-mail ya existe'); hay_error=true; } if(!hay_error){ $("#ventana-gral").removeClass().addClass("gral-opcionesanim"); if( !gl.cloc && gl.mloc ){ $("#ventana-gral").animate( {height: '475px'}, 300); } if( !gl.cloc && !gl.mloc ){ $("#ventana-gral").animate( {height: '505px'}, 300); gl.cloc=true; gl.mloc=true; } if(gl.cloc && !gl.mloc) { $("#ventana-gral").animate( {height: '450px'}, 300); } // } }); } } function cambios_enviar(){ var cmbclv=$("#opciones-clavenue"), cmbeml=$("#opciones-email"), cmbnom=$("#opciones-nombre"), cmbape=$("#opciones-apellido"), cmbtel=$("#opciones-tel"), cmbtid=$("#opciones-identificacion"), cmbnid=$("#opciones-idenum"), cmbiva=$("#opciones-civa"), cmbdom=$("#opciones-domicilio"), cmbcda=$("#opciones-ciudad"), cmbpro=$("#opciones-provincia"), error_validacion = false, aux=null; $("#sepocu").load(gl.prusuario,{clave:cmbclv.val(), email:cmbeml.val(), nombre:cmbnom.val(), apellido:cmbape.val(), tel:cmbtel.val(), ciudad:cmbcda.val(), provincia:cmbpro.val(), domicilio:cmbdom.val(), tipid:cmbtid.val(), numid:cmbnid.val(), condiva:cmbiva.val(), tipo:"cambia"},function(respuesta, status, xhr){ //mismo email if (xhr.responseText == "err_mismoemail" ){ $("#opciones-email").width(115); $("#opciones-email").after('* El e-mail ya existe'); error_validacion=true; } else { $("#opciones-email").width(215); } switch(xhr.responseText){ case "err_vclave": aux=cmbclv; break; case "err_vmail": aux=cmbeml; break; case "err_vnombre": aux=cmbnom; break; case "err_vapellido": aux=cmbape; break; case "err_vtel": aux=cmbtel; break; case "err_vciudad": aux=cmbcda; break; case "err_vprovincia": aux=cmbpro; break; case "err_vtid": aux=cmbtid; break; case "err_vnid": aux=cmbnid; break; case "err_vciva": aux=cmbiva; break; case "err_vdom": aux=cmbdom; break; case "err_vcuit": cmbnid.after('* CUIT no valido');error_validacion=true; break; } if(aux){ aux.width(115); aux.after('* Caracteres invalidos'); error_validacion=true;// } else { aux.width(215); } // correcto if (!error_validacion && xhr.responseText == "ok"){ if (cmbclv.val()==""){ mensajecmb='
Cambio exitoso
Los cambios se han realizado con exito
'; } else { mensajecmb='
Cambio exitoso
Los cambios se han realizado con exito
Debera volver a ingresar con su nueva clave
'; } $("#subventana-gral .cont-int").html(mensajecmb); subventana_muestra("#ventana-gral","sub-cambiook"); } }); } function animoferta(ppal,ofa,ofb,posppal,posa,posb,posfa,posfb){ if($("#oferta"+ppal+ " button.botof").text()!='Volver'){ if(jQuery.support.opacity){ $("#oferta"+ofa).animate({ opacity: 0, left: posa}, 300,function(){$("#oferta"+ofa).hide();} ); $("#oferta"+ofb).animate({ opacity: 0, left: posb}, 250,'linear' ,function(){ $("#oferta"+ofb).hide(); $("#oferta"+ppal).animate( {left: '0'}, 250, 'linear', function(){ $("#ofertas-mas").animate( {width: '456px'}, 300);$("#ofertas-mas").fadeIn(150); $("#ofmas"+ppal).show();}); }); } else { //Internet Exploder $("#oferta"+ofa).fadeOut(200); $("#oferta"+ofb).fadeOut(200, function(){ $("#oferta"+ppal).animate({ left: '0' }, 300, 'linear', function(){ $("#ofertas-mas").animate( {width: '456px'}, 150);$("#ofertas-mas").fadeIn(150); $("#ofmas"+ppal).show();}); }); } $("#oferta"+ppal+ " button.botof").text('Volver'); } else { if(jQuery.support.opacity){ //1er estado $("#ofertas-mas").animate( {width: '0px'}, 300,'linear', function(){ $("#oferta"+ofa).show(); $("#oferta"+ofb).show(); $("#ofertas-mas").hide(); $("#ofmas"+ppal).hide(); $("#oferta"+ppal).animate( {left: posppal},300, 'linear',function(){ $("#oferta"+ofa).animate({ opacity: 1, left: posfa}, 300 );$("#oferta"+ofb).animate({ opacity: 1, left: posfb}, 300 );})}); }else{ //Internet Exploder $("#ofertas-mas").animate( {width: '0px'}, 300,'linear', function(){ $("#ofertas-mas").hide(); $("#ofmas"+ppal).hide(); $("#oferta"+ppal).animate( {left: posppal},300, 'linear',function(){ $("#oferta"+ofa).fadeIn(200);$("#oferta"+ofb).fadeIn(200);})}); } $("#oferta"+ppal+ " button.botof").text('Ver Más'); } } function sAlconsulta0(){ alertaconsulta=false; $("#carrito-listacont .jcart-item-price span").each(function(index){ if($(this).text()=="$0.00"){alertaconsulta=true;} if(alertaconsulta){$("#alconsulta").fadeIn(150);}else{$("#alconsulta").fadeOut(150);} }); } function cargacarrito(inicio){ if ($('#ofertas-cnt').hasClass('conborde')){ $("#mtabs7").removeClass("mtabs7arr"); $('#carrito-lista').fadeOut(300, function(){$("#carrito-lista").hide()} ); $('#carrito-cat').fadeOut(300, function(){$("#carrito-cat").hide()}); $('#carrito-fltr').fadeOut(300, function(){$("#carrito-fltr").hide()}); $('#sidebar').fadeOut(300, function(){$("#sidebar").hide();}); $('#carrito-cont').fadeOut(300, function(){$("#carrito-cont").hide() if($("#cuerpo-ppal").hasClass("ppalconborde")){ $('#misc-cnt').fadeIn(300); $("#cuerpo-ppal").removeClass("ppalconborde"); } $('#cont-noticia').fadeIn(300); $('#ofertas-cnt-ppal').fadeIn(300); $('#fotos-cnt').fadeIn(300); $('#ofertas-cnt').removeClass("conborde"); }); } else { if($("#cuerpo-ppal").hasClass("ppalconborde")){ $('#ofertas-cnt').fadeIn(300); $('#cuerpo-cnt').fadeOut(300, function(){$("#cuerpo-cnt").hide();}); $('#misc-cnt').fadeIn(300); $("#cuerpo-ppal").removeClass("ppalconborde"); } $("#mtabs7").addClass("mtabs7arr"); $('#ofertas-cnt-ppal').fadeOut(300, function(){ $("#ofertas-cnt-ppal").hide(); $('#sidebar').fadeIn(300); $('#carrito-lista').fadeIn(300); $('#carrito-cont').fadeIn(300); $('#carrito-cat').fadeIn(300); $('#carrito-fltr').fadeIn(300); $('#ofertas-cnt').addClass("conborde"); }); $('#cont-noticia').fadeOut(300, function(){$("#cont-noticia").hide();}); $('#fotos-cnt').fadeOut(300, function(){$("#fotos-cnt").hide();}); } } function cargappald(opcion){ //esta carrito if ($('#ofertas-cnt').hasClass('conborde') && opcion!="principal"){ $("#mtabs7").removeClass("mtabs7arr"); $('#carrito-lista').fadeOut(300, function(){$("#carrito-lista").hide()} ); $('#carrito-cat').fadeOut(300, function(){$("#carrito-cat").hide()}); $('#carrito-fltr').fadeOut(300, function(){$("#carrito-fltr").hide()}); $('#sidebar').fadeOut(300, function(){$("#sidebar").hide();}); $('#carrito-cont').fadeOut(300, function(){$("#carrito-cont").hide()}); $('#misc-cnt').fadeOut(300, function(){$("#misc-cnt").hide();}); $('#ofertas-cnt').removeClass("conborde"); $('#cont-noticia').fadeIn(300); } // es principal? //oculta principales if (opcion=="principal"){ if($("#cuerpo-ppal").hasClass("ppalconborde")){ $('#ofertas-cnt').fadeIn(300, function(){$("#ofertas-cnt-ppal").show();}); $("#fotos-cnt").fadeIn(300); $('#misc-cnt').fadeIn(300); $('#cuerpo-cnt').fadeOut(300, function(){$("#cuerpo-cnt").hide();}); $("#cuerpo-ppal").removeClass("ppalconborde"); } if ($('#ofertas-cnt').hasClass('conborde')){ cargacarrito(true); } }else{ if (!$('#ofertas-cnt').hasClass('conborde')){ $('#ofertas-cnt').fadeOut(300, function(){$("#ofertas-cnt").hide();$("#ofertas-cnt-ppal").hide();}); $('#fotos-cnt').fadeOut(300, function(){$("#fotos-cnt").hide();}); $('#misc-cnt').fadeOut(300, function(){$("#misc-cnt").hide();}); $("#cuerpo-cnt").hide(); if (opcion=="nosotros"){ $("#cuerpo-cnt").load("imagencont/scripts/contenidosppal.php",{tipo:"nosotros"}); } if (opcion=="enlaces"){ $("#cuerpo-cnt").load("imagencont/scripts/contenidosppal.php",{tipo:"enlaces"}); } } $("#cuerpo-ppal").addClass("ppalconborde"); $('#cuerpo-cnt').fadeIn(300); } } function animapanelutils(cierra){ panelutils=$("#panel-utils"); if ((panelutils.css('display')=="none") && (cierra==false)){ $("#mtabs4").addClass("mtabs4arr"); panelutils.show(); panelutils.animate({height:'262px'},300); }else{ panelutils.animate({height:'0px'},300,function(){panelutils.hide();}); $("#mtabs4").removeClass("mtabs4arr"); } } function animapanelusuario(cierra){ panelusuario=$("#panel-usuario"); if ((panelusuario.css('display')=="none") && (cierra==false)){ $("#mtabs8").addClass("mtabs8arr"); panelusuario.show(); if($("#mtabs8").hasClass("mtabs8arrlog")){pualto="163px";}else{pualto="175px";} panelusuario.animate({height:pualto},300); }else{ panelusuario.animate({height:'0px'},300,function(){panelusuario.hide();}); $("#mtabs8").removeClass("mtabs8arr"); } } function animapanelusuarioreg(nombre,noanim,cookie){ $("#usuario-logver a").text(nombre); if(cookie){ $("#sepocu").text(nombre); $("#sepocu").css("font-size", "18px"); ancho= $("#sepocu").width() + 40; } else { ancho= $("#usuario-logver").width(); } $("#panel-usuario").animate({height:'163px'},200,function(){ if (ancho < 110){ if (noanim){$("#panel-usuario").width('110px');} else {$("#panel-usuario").animate({width:'110px'},200);} } else { if (noanim){$("#panel-usuario").width(ancho+10+'px');} else{$("#panel-usuario").animate({width:ancho+10+'px'},200);} } }); } function usuarioexpirado(email,etapa){ if (etapa==1){ $("#ventana-gral .cont-int").html("
Cuenta Inactiva

Han pasado mas de 6 meses desde su ultima visita por lo que su cuenta a sido desactivada.

     
") ventana_muestra('gral-desac'); } if (etapa==2){ $("#ventana-gral .cont-int").html("
Cuenta Inactiva

Recibira un e-mail confirmado que su cuenta se ha activado.

¿Necesita actualizar su e-mail de contacto?

No hace falta
Quiero cambiar mi e-mail
") $("#expdefchk").attr("checked","checked"); $("#ventana-gral").removeClass().addClass("gral-opcionesanim"); $("#ventana-gral").animate( {height: '220px'}, 150); } if (etapa==3){ $("#ventana-gral .cont-int").html("
Cuenta Inactiva - Cambio de e-mail
") $("#ventana-gral").removeClass().addClass("gral-opcionesanim"); $("#ventana-gral").animate( {height: '200px'}, 150); } if (etapa==4){ $("#sepocu").load(gl.prusuario,{tipo:"expsndmail"}); $("#ventana-gral .cont-int").html("
Cuenta Inactiva
Se ha notificado al administrador para la reactivacion de su cuenta, usted sera notificado cuando su cuenta este activada.
") $("#ventana-gral").removeClass().addClass("gral-opcionesanim"); $("#ventana-gral").animate( {height: '150px'}, 150); } } function usuarioexpiradosel(demail){ if($("#explv2 input[name='des-rd']:checked").val()=="exprdcambno"){ usuarioexpirado("",4); } else if($("#explv2 input[name='des-rd']:checked").val()=="exprdcambok"){ usuarioexpirado(demail,3) } console.log($("#explv2 input[name='des-rd']:checked").val()); } function expira_cmbmail(vemailo,vemailr){ var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; largoo=vemailo.length; largor=vemailr.length; $(".expregistro-error").hide(); if(largoo!=0){ if(!emailReg.test(vemailo)) { //email incorrecto $("#des-mail").after('* e-mail invalido'); } else { if(largor!=0){ if(!emailReg.test(vemailr)) { //emailrep incorrecto $("#des-mailr").after('* e-mail invalido'); } else { if(vemailo!=vemailr) { //distintos $("#des-mail").after('* deben ser iguales'); $("#des-mailr").after('* deben ser iguales'); }else{ $("#sepocu").load(gl.prusuario,{mail:vemailo, tipo:"expcmbmail"},function(respuesta, status, xhr){ if (xhr.responseText == "expcmbm_ok"){ usuarioexpirado(vemailo,4); } if(xhr.responseText == "expcmbm_er"){ $("#des-mail").after('* El e-mail ya existe'); } }); } } }else{ $("#des-mailr").after('* e-mail vacio'); } } }else{ $("#des-mail").after('* e-mail vacio'); } } function usuariovalidar(email){ $('#ventana-gral .cont-int').html("
Validación de usuario

Para ingresar primero debe validar su cuenta de usuario, para hacerlo debe ingresar a la cuenta de e-mail con la que se registró:

"+email+"

Si lo desea puede reenviar la validación haciendo clic aqui

"); ventana_muestra('gral-noval'); } function usuarioactivar(){ $('#ventana-gral .cont-int').html("

Debe esperar a que el administrador active su cuenta de usuario, usted recibirá un e-mail cuando esto suceda

"); ventana_muestra('gral-noact'); } jQuery.fn.liScroll = function(settings){ settings = jQuery.extend({ para:true},{ travelocity: 0.07 }, settings); return this.each(function(){ var $strip = jQuery(this); if (settings.para==true){ $strip.removeClass("newsticker"); $strip.css("left", 0); jQuery(this).stop(false,true); $strip.css("left", 0); } else { $strip.addClass("newsticker") $strip.css("left", 0); jQuery(this).stop(false,true); $strip.css("left", 0); var stripWidth = 0; var containerWidth = $strip.parent().parent().width(); $strip.find("li").each(function(i){ stripWidth += jQuery(this, i).width();}); $strip.width(stripWidth); var totalTravel = stripWidth+containerWidth; var defTiming = totalTravel/settings.travelocity; function scrollnews(spazio, tempo){ $strip.delay(500).animate({left: '-='+ spazio}, tempo, "linear", function(){$strip.css("left", containerWidth); scrollnews(totalTravel, defTiming);}); } scrollnews(totalTravel, defTiming); $strip.hover(function(){}, function(){ var offset = jQuery(this).offset(); var residualSpace = offset.left + stripWidth; var residualTime = residualSpace/settings.travelocity; scrollnews(residualSpace, residualTime); } ); } }); }; jQuery.fn.center = function(params) { var options = { vertical: true, horizontal: true } op = jQuery.extend(options, params); return this.each(function(){ var $self = jQuery(this); var width = $self.width(); var height = $self.height(); var paddingTop = parseInt($self.css("padding-top")); var paddingBottom = parseInt($self.css("padding-bottom")); var borderTop = parseInt($self.css("border-top-width")); var borderBottom = parseInt($self.css("border-bottom-width")); var mediaBorder = (borderTop+borderBottom)/2; var mediaPadding = (paddingTop+paddingBottom)/2; var positionType = $self.parent().css("position"); var halfWidth = (width/2)*(-1); var halfHeight = ((height/2)*(-1))-mediaPadding-mediaBorder; var cssProp = { position: 'absolute' }; if(op.vertical) { cssProp.height = height; cssProp.top = '50%'; cssProp.marginTop = halfHeight; } if(op.horizontal) { cssProp.width = width; cssProp.left = '50%'; cssProp.marginLeft = halfWidth; } if(positionType == 'static') { $self.parent().css("position","relative"); } $self.css(cssProp); }); }; function envialogin(locus,locpas,locrem,locres){ var logusu=$(locus).val(); var logclv=$(locpas).val(); var logrem=$(locrem).val(); $(locres).load(gl.prusuario,{usuario:logusu, clave:logclv, recordar:logrem, tipo:"logusuario"}); } function usuario_logout(){ $("#sepocu").load(gl.prusuario,{tipo:"deslogusuario"},function(){ location.reload();}); } function registro_cancelar(){ $("#carrito_pedir").hide(); ventana_cierra(); borraclavesregistro(); } function registro_cerrar(){ subventana_cierra('ventana-gral',true); $("#ventana-gral").removeClass("gral-registrook"); borraclavesregistro(); } function registro_habilitar(){ //habilita grabar cuando el usuario acepta tyc var acepta=$("#usuario-registro-aceptatyc").attr("checked"); if (acepta==true){ $("#usuario-registro-botreg").attr("disabled",false) } else { $("#usuario-registro-botreg").attr("disabled",true) } } function borraclavesregistro(){ $(".registro-error").hide(); if($("#carrito_pedir").is(":hidden")){$("#fondo-oscuro").hide();} $('#usuario-registro :input[type=text]').val(""); $("#usuario-registro-rescorreo").attr('checked', false); $("#usuario-registro-botreg").attr("disabled",true) } function folregistro(){ $("#ventana-gral").hide(); gl.ventana.removeClass(); $("#ventana-gral .cont-int").html(""); ventana_muestra("gral-registro"); } function ventana_muestra(estilo){ gl.fndoscuro.show(); gl.ventana.addClass(estilo); gl.ventana.center(); if(estilo=="gral-opciones"){$("#ventana-gral .cont-int").load(gl.prusuario,{tipo:"opciones"}, function(){gl.ventana.fadeIn(150);});} if(estilo=="gral-historial"){$("#ventana-gral .cont-int").load(gl.prusuario,{tipo:"historial"}, function(){gl.ventana.fadeIn(150);});} if(estilo=="gral-recuperar"){$("#ventana-gral .cont-int").load(gl.prusuario,{tipo:"recuperarUI"}, function(){gl.ventana.fadeIn(150);});} if(estilo=="gral-registro"){$("#ventana-gral .cont-int").load(gl.prusuario,{tipo:"registroUI"}, function(){gl.ventana.fadeIn(150);});} if(estilo=="gral-noval"){gl.ventana.fadeIn(150)} if(estilo=="gral-desac"){gl.ventana.fadeIn(150)} if(estilo=="gral-noact"){gl.ventana.fadeIn(150)} if(estilo=="gral-folleto"){$("#ventana-gral .cont-int").load("imagencont/scripts/contenidosppal.php",{tipo:"folleto"}, function(){ if(!$("#mtabs8").hasClass("mtabs8arrlog") ){ gl.ventana.removeClass(); gl.ventana.addClass("gral-folletoSU"); gl.ventana.center(); } gl.ventana.fadeIn(150); });} } function ventana_cierra(){ $("#ventana-gral").fadeOut(150,function(){ $("#fondo-oscuro").hide(); gl.ventana.removeClass(); $("#ventana-gral .cont-int").html(""); }); if($(".gral-opciones").height()!=430){$(".gral-opciones").height(430);} } function subventana_muestra(padre, estilo){ $(padre).addClass("gral-atras"); $("#subventana-gral").addClass(estilo).center().fadeIn(150); } function subventana_cierra(padre,todo){ $("#subventana-gral").fadeOut(150,function(){ $(padre).removeClass("gral-atras"); $("#subventana-gral").center({horizontal: false,vertical:false}); $("#subventana-gral").removeClass(); $("#subventana-gral .cont-int").html(""); if (todo){ ventana_cierra(); } }); } function ventanacv_muestra(){ gl.fndoscuro.show(); $("#ventana-cv").center(); $("#ventana-cv").fadeIn(150); } function ventanacv_cierra(){ $("#ventana-cv").fadeOut(150,function(){ $("#fondo-oscuro").hide(); }); } function usuario_check(){ $("#sepocu").load(gl.prusuario,{tipo:"checkusuario"}, function(respuesta, status, xhr){ cadena= xhr.responseText; if ((cadena != "")){ $("#usuario-login-usuario").val(cadena); $("#usuario-login-recordar").attr("checked","true"); } }); } function recuperar_clave(){ $("#recupera_contmed p").load(gl.prusuario,{usuario:$("#cuprecupera").val(),email:$("#cmprecupera").val(),tipo:"recuperar"}); } function cargacat(nomcat,pos){ $("#carrito-cat-cont a").removeClass(); $('#carrito-cont').load("imagencont/scripts/prods.php",{cat:nomcat,ord:0}); $("#hdcat").html(nomcat); $(pos).addClass("carrito-catsel"); arriba(); } function usuario_login(){ if ($("#usuario-login-usuario").val()!="" && $("#usuario-login-clave").val()){ envialogin("#usuario-login-usuario","#usuario-login-clave","#usuario-login-recordar:checked","#usuario-login-resp"); } } function actintervalo(){ if((inusr==false) && (inpas==false) && (foco==false)){ intervalo = setTimeout("animapanelusuario(true)",1000); } else { clearInterval(intervalo); } } function arriba(){$('#carrito-cont').animate({scrollTop:0}, '300');}; function abajo(){$('#carrito-listacont').animate({scrollTop: $("#carrito-listacont").attr("scrollHeight")}, '300');}; function checkout_cusuario(){ $("#fondo-oscuro").hide(); $("#carrito_pedir").hide(); animapanelusuario(false); } function checkout_susuario(){ $("#forma-sinregistro").show(); $("#forma-tipopedido").hide(); $("#carrito_pedir").addClass("sin-usuario"); $("#carrito_pedir").center(); $("#forma-checkout").addClass("sin-usuario-ch"); $("#carrito-listaitemscheck").show(); $("#forma-botoncheck").show(); $("#carrito-legales, #chk-leyend-dispsu").show(); } function checkout_volver_susuario(){ $('#carrito_pedir').hide(); $('#carrito_pedir').addClass("carrito_pedir"); $('.jcart-remove').show(); $('#fondo-oscuro').hide(); $("#carrito_pedir").removeClass("sin-usuario"); $("#forma-checkout").removeClass("sin-usuario-ch"); } function checkout_volver(){ $('#carrito_pedir').hide(); $('#fondo-oscuro').hide(); } function miniprecio(precio){ if (precio.width()>71){precio.addClass("tpreciomini");precio.parent().css("padding-top","2px");} } function fotos(){ $(".image_thumb ul li:first").addClass('active'); $(".image_thumb ul li:last").addClass('last'); $(".image_thumb ul li").click(function(){ var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL if ($(this).is(".active")) { return false; } else { $(".main_image").fadeOut(300,function(){$(".main_image img").attr({ src: imgTitle});}).fadeIn(300); } $(".image_thumb ul li").removeClass('active'); $(this).addClass('active'); return false; }).hover(function(){ $(this).addClass('hover'); }, function() { $(this).removeClass('hover'); }); pauseClickNext = false; $(".image_thumb").hover( function (){ pauseClickNext = true; }, function (){ pauseClickNext = false; } ); var clickNext = function(){ if(!pauseClickNext) { var $next_li = $("li.active").next("li"); if($("li.active").hasClass("last") ){ $(".image_thumb ul li:first").trigger("click"); } else { $next_li.trigger("click"); } } }; setInterval(clickNext, 4000); }; function anim_fotos(){ $("#imgn-logo").fadeIn(3000,function(){ $("#imgn15").fadeIn(2500,function(){ $("#fnd-fotos").fadeOut(1500,function(){ $('#fotoss').crossSlide({ speed: 25, fade: 1 }, [ { src: 'imagencont/imagenes/fotoss/imagen.jpg', dir: 'up' }, { src: 'imagencont/imagenes/fotoss/frente.jpg', dir: 'down' }, { src: 'imagencont/imagenes/fotoss/ventas.jpg', dir: 'up' }, { src: 'imagencont/imagenes/fotoss/servicio.jpg', dir: 'down' } ]); }); }); }); } function _loadimages(imgArr,callback) { var imagesLoaded = 0; function _loadAllImages(callback){ var img = new Image(); $(img).attr('src',imgArr[imagesLoaded]); if (img.complete || img.readyState === 4) { imagesLoaded++; if(imagesLoaded == imgArr.length) { callback(); } else { _loadAllImages(callback); } } else { $(img).load(function(){ imagesLoaded++; if(imagesLoaded == imgArr.length) { callback(); } else { _loadAllImages(callback); } }); } }; _loadAllImages(callback); } function imgn15a() { if (jQuery.support.opacity) { $("#cont-15a") .animate({ opacity: 0.75 }, 1500) .animate({ opacity: 1 }, 1500, imgn15a ); } } // Inicio de la pagina $(document).ready(function() { var images = ['imagencont/imagenes/pagina/bk-fotos.jpg','imagencont/imagenes/pagina/imgn-logo.png','imagencont/imagenes/pagina/imgn-15.png','imagencont/imagenes/fotoss/imagen.jpg','imagencont/imagenes/fotoss/frente.jpg','imagencont/imagenes/fotoss/ventas.jpg','imagencont/imagenes/fotoss/servicio.jpg']; _loadimages(images,anim_fotos); imgn15a(); miniprecio($("#oferta1 .tprecont")); miniprecio($("#oferta2 .tprecont")); miniprecio($("#oferta3 .tprecont")); usuario_check(); var intervalo=""; var inusr = false; var inpas = false; var foco = false; CargaRSS(); $("#fot-pcont").fotos(); $("#dolcont .tdolar").load('imagencont/scripts/dolar.php'); $("#virus").load('imagencont/scripts/rss_virus.php'); $("#clima").load('imagencont/scripts/clima/clima.php'); $("#downloads").load('imagencont/scripts/rss_downl.php'); LeerRSS('RSS',0,0); fotos(); // acciones de boton $("#mtabs1").click(function(){ cargappald("principal");}); $("#mtabs2").click(function(){ cargappald("nosotros");}); $("#mtabs3").click(function(){ window.location.href = "http://imagen-net.com.ar:2084/horde/imp/login.php";return false;}); $("#mtabs4").click(function(){ animapanelutils(false);}); $("#aenlaces").click(function(){ cargappald("enlaces");}); $("#mtabs5").click(function(){ window.location.href = "mailto:imagen@imagen-net.com.ar";return false;}); $("#mtabs6").click(function(){ ventanacv_muestra()}); $("#mtabs7").click(function(){ cargacarrito(false);}); $("#mtabs8").click(function(){ animapanelusuario(false);}); //$("#usuario-registro-aceptatyc").live("click",function(){ registro_habilitar();}); $("#usuario-registro-botreg").live("click",function(){ registro_checkerror();}); $("#registro-bot-cancela").live("click", function(){ registro_cancelar();}); $("#opciones-cambia").live("click", function(){ cambios_checkerror();}); //$("#usuario-bot-regfin").click(function(){ registro_cerrar();}); $("#oferta1 button.botof,#oferta1 .of-img").click(function(){ animoferta(1,2,3,'0','-=231','-=462','+=231','+=462');}); $("#oferta2 button.botof,#oferta2 .of-img").click(function(){ animoferta(2,1,3,'231','+=231','-=231','-=231','+=231');}); $("#oferta3 button.botof,#oferta3 .of-img").click(function(){ animoferta(3,1,2,'462','+=462','+=231','0','-=231');}); $("#usuario-login-botreg, #regbot").click(function(){ ventana_muestra("gral-registro");}); $("#usuario-login-botlog").click(function(){ usuario_login();}); $(document).mouseup(function(e){ if($("#panel-usuario").css("display")!="none"){ animapanelusuario(true);}}); $(document).mouseup(function(e){ if($("#panel-utils").css("display")!="none"){ animapanelutils(true);}}); $("#panel-usuario").mouseup(function(){ return false}); $("#panel-utils").mouseup(function(){ return false}); $("#usreg-salir").click(function(){ usuario_logout();}); $("#usreg-historial").click(function(){ ventana_muestra("gral-historial");}); $("#usreg-opciones").click(function(){ ventana_muestra("gral-opciones")}); $("#usuario-login-reclave").click(function(){ ventana_muestra("gral-recuperar")}); $("#img-retec").click(function(){ window.open("http://www.retecargentina.com.ar/")}); $("#formcv").submit(function(){ cv_checkerror()}); if($("#oferta1 .tituloOf").height()>28 || $("#oferta2 .tituloOf").height()>28||$("#oferta3 .tituloOf").height()>28){$(".of-img").css("top","55px")} //$("#opciones-clave").live("change", function(){ cambio_cbcom("clave"); }); //$("#opciones-email").live("change", function(){ cambio_cbcom("email"); }); //$("#usuario-registro-usuario").live("blur", function(){ if($("#usuario-registro-usuario").val()!=""){registro_lvcheck("reglckus");}}); //$("#usuario-registro-email").live("blur", function(){ if($("#usuario-registro-email").val()!=""){registro_lvcheck("reglckml");}}); //$("#fot-iz").click(function(){ fotosauto(false)}); //$("#fot-dr").click(function(){ fotosauto(true)}); $('#usuario-login :input').keypress(function(e){if(e.which == 13){ usuario_login();}}); // $('#usuario-opciones :input').live("keypress", function(e){if(e.which == 13){ cambios_checkerror();}}); contentRotator($("ul#hdrmarquesina > li:first")); $("#exp-botcmb").live("click",function(){expira_cmbmail($("#des-mail").val(),$("#des-mailr").val());}); $("#cbuscar").submit(function(){ if($('#tbuscar').val()!=''){ $('#carrito-cont').load('imagencont/scripts/prods.php',{busc:$('#tbuscar').val().replace(/ /g,"|"),ord:0}); $("#hdcat").html(""); return false; }else{ return false; } }); $('#ord-cnt :input[type=button]').click(function() { if ($("#hdcat").html()!=""){ $('#carrito-cont').load("imagencont/scripts/prods.php",{cat:$("#hdcat").html(),ord:this.id}); } else { $('#carrito-cont').load("imagencont/scripts/prods.php",{busc:$('#tbuscar').val().replace(/ /g,"|"),ord:this.id}); } }); $("#regbot").hover(function(){ $(this).addClass('regboth'); }, function() { $(this).removeClass('regboth'); }); }); $.fn.fotos = function(opciones){ var defaults = { prevId: 'fot-iz', nextId: 'fot-dr', velocidad: 500, auto: true, pausa: 5000, continuo: true, numericId: 'controls', pausado: false }; var opciones = $.extend(defaults, opciones); this.each(function() { var obj = $(this); var s = $("li", obj).length; var w = $("li", obj).width(); var h = $("li", obj).height(); var clickable = true; obj.width(w); obj.height(h); obj.css("overflow","hidden"); var ts = s-1; var t = 0; $("ul", obj).css('width',s*w); if(opciones.continuo){ $("ul", obj).prepend($("ul li:last-child", obj).clone().css("margin-left","-"+ w +"px")); $("ul", obj).append($("ul li:nth-child(2)", obj).clone()); $("ul", obj).css('width',(s+1)*w); }; $("li", obj).css('float','left'); $("#"+opciones.nextId).click(function(){ animate("next",true) clearTimeout(timeout); timeout=timeout = setInterval(function(){if(!opciones.pausado){animate("next",false);}},opciones.pausa); }); $("#"+opciones.prevId).click(function(){ animate("prev",true); clearTimeout(timeout); timeout=timeout = setInterval(function(){if(!opciones.pausado){animate("next",false);}},opciones.pausa); }); function setCurrent(i){ i = parseInt(i)+1; $("li", "#" + opciones.numericId).removeClass("current"); $("li#" + opciones.numericId + i).addClass("current"); }; function adjust(){ if(t>ts) t=0; if(t<0) t=ts; $("ul",obj).css("margin-left",(t*w*-1)); clickable = true; }; $('#fot-pcont, #fot-iz, #fot-dr').mouseenter(function(){ opciones.pausado=true;}); $('#fot-pcont, #fot-iz, #fot-dr').mouseleave(function(){ opciones.pausado=false;;}); function animate(dir,clicked){ if (clickable){ clickable = false; var ot = t; switch(dir){ case "next": t = (ot>=ts) ? (opciones.continuo ? t+1 : ts) : t+1; break; case "prev": t = (t<=0) ? (opciones.continuo ? t-1 : 0) : t-1; break; default: t = dir; break; }; var diff = Math.abs(ot-t); var velocidad = diff*opciones.velocidad; p = (t*w*-1); $("ul",obj).animate( { marginLeft: p }, { queue:false, duration:velocidad, complete:adjust } ); }; }; var timeout; if(opciones.auto){ timeout = setInterval(function(){ if(!opciones.pausado){animate("next",false);} },opciones.pausa); }; }); }; function contentRotator(content) { content.fadeOut(0, function(content) { return function() { /* HIDE ALL ITEMS */ $("ul#hdrmarquesina > li").fadeOut(1000); content.fadeIn(1000, function() { /* GO BACK TO FIRST ITEM */ if ($(this).attr("id") == $("ul#hdrmarquesina > li:last").attr("id")) { setTimeout(function() { contentRotator($("ul#hdrmarquesina > li:first")); }, 500); } else { /* FADE IN NEXT ITEM */ setTimeout(function() { contentRotator($(content.next())); }, 500); } }); }; } (content)); }