$(document).ready(function() { cargarBanner(); }); function cargarBanner() { $("#divBannerSubLogo").fadeIn('slow'); $('#divBannerSubLogo').animate( { width : 290, height : 144, opacity : 1 }, 'fast', function() { for (i = 1; i <= 16; i++) { cargarSubBanner(i); } }); setInterval(function() { cargarSubBannerOff(); }, 8000); } function cargarSubBanner(i) { setTimeout(function() { $('#divBannerSub' + i).css("backgroundImage", "url(http://www.eia.com.ar/plantillas/pics/banners/" + banners[0] + ")"); $('#divBannerSub' + i).animate( { width : 143, height : 144, opacity : 1 }, 'fast'); $("#divBannerSub" + i).fadeIn('fast'); }, 100 * i); } var imgBanner = 0; function cargarSubBannerOff() { if (imgBanner == (bannersCant - 1)) { imgBanner = 0; } else { imgBanner++; } for (j = 1; j <= 16; j++) { cargarSubBannerRefresh(j); } } function cargarSubBannerRefresh(j) { setTimeout(function() { $('#divBannerSub' + j).animate( { opacity : 0 }, 'fast', function() { $("#divBannerSub" + j).css("backgroundImage", "url(http://www.eia.com.ar/plantillas/pics/banners/" + banners[imgBanner] + ")"); $('#divBannerSub' + j).animate( { width : 143, height : 144, opacity : 1 }, 'fast'); }); }, 150 * j); } function cargarContenido(seccion) { $('#divContenido').slideUp(); $('#preloading').fadeIn(); document.getElementById('divContenido').innerHTML = ""; setTimeout(function() { var conn = new Ext.data.Connection(); conn.request( { url : 'cargarContenido.php', method : 'POST', params : { "seccion" : seccion }, success : function(responseObject) { $('#preloading').fadeOut(); document.getElementById('divContenido').innerHTML = responseObject.responseText; $('#divContenido').slideDown(); } }); }, 200); } function validarContacto() { var regex = new RegExp("^[^@ ]+@([a-zA-Z0-9-]+.)+([a-zA-Z0-9-]{2}|net|com|gov|mil|org|edu|int|biz|info|name|pro)$"); var faltan = ""; var email = document.getElementById('contact_email'); if (regex.test(email.value) == false) { faltan = " - Email
"; email.className = 'cajaContactoError'; email.onclick = function() { this.className = 'cajaContacto'; }; } var pars = "tipo=contacto&desea=" + document.getElementById('contact_desea').checked + "&email=" + email.value + "&"; var campos = new Array("nombre", "apellido", "telefono", "comentario", "movil", "prov", "direccion"); var obligatorios = new Array("Nombre", "Apellido", "Teléfono", "Comentario", "", "", ""); for (i = 0; i < campos.length; i++) { campo = document.getElementById('contact_' + campos[i]); if (campo.value == "" && obligatorios[i] != "") { faltan += " - " + obligatorios[i] + "
"; campo.className = 'cajaContactoError'; campo.onclick = function() { this.className = 'cajaContacto'; }; } pars += campos[i] + "=" + campo.value + "&"; } if (faltan != "") { // Dialog document.getElementById('divError').innerHTML = '*Por favor complete todos los campos obligatorios!'; } else { document.getElementById('divContenido').innerHTML = '
'; var conn = new Ext.data.Connection(); conn.request( { url : 'enviarContacto.php', method : 'POST', params : pars, success : function(responseObject) { document.getElementById('divContenido').innerHTML = responseObject.responseText; } }); } } var noticiaActiva = 1; function cargarNoticiasRecuadro(idNoticia, noticiaActual) { if (noticiaActiva > noticiaActual) { fxIn = 'l'; fxOut = 'r'; } else { fxIn = 'r'; fxOut = 'l'; } document.getElementById('linkNoticia' + noticiaActiva).className = 'linkNoticiaOff'; document.getElementById('linkNoticia' + noticiaActual).className = 'linkNoticiaOn'; noticiaActiva = noticiaActual; var el = document.getElementById('noticiasContenido'); el = Ext.get(el); el.slideOut(fxOut); var conn = new Ext.data.Connection(); conn.request( { url : 'noticiasCargarRecuadro.php', method : 'POST', params : { "idNoticia" : idNoticia }, success : function(responseObject) { el.slideIn(fxIn); document.getElementById('noticiasContenido').innerHTML = responseObject.responseText; } }); } function verNoticia(idNoticia) { jQuery.lightbox("./noticias.php?idNoticia=" + idNoticia + "&pv=true&hl=es&tab=nw&lightbox[iframe]=true&lightbox[width]=620&lightbox[height]=520&lightbox[modal]=true", { 'width' : 620, 'height' : 520, 'modal' : true, 'autoresize' : false }); } function validarRegistro() { var regex = new RegExp("^[^@ ]+@([a-zA-Z0-9-]+.)+([a-zA-Z0-9-]{2}|net|com|gov|mil|org|edu|int|biz|info|name|pro)$"); var faltan = ""; var email = document.getElementById('usuario_email'); if (regex.test(email.value) == false) { faltan = " - Email
"; } var nombre = document.getElementById('usuario_nombre'); if (nombre.value == "") { faltan += " - Nombre
"; } var telefono = document.getElementById('usuario_telefono'); if (telefono.value == "") { faltan += " - Telefono
"; } var apellido = document.getElementById('usuario_apellido'); if (apellido.value == "") { faltan += " - apellido
"; } var movil = document.getElementById('usuario_movil'); if (movil.value == "") { faltan += " - movil
"; } var pars = "email=" + email.value + "&nombre=" + nombre.value + "&telefono=" + telefono.value + "&apellido=" + apellido.value + "&movil=" + movil.value; if (faltan != "") { document.getElementById('divErrorRegistro').innerHTML = '*Por favor complete todos los campos obligatorios!'; } else { volverRegUs = document.getElementById('registrarUsuario').innerHTML; document.getElementById('registrarUsuario').innerHTML = '
%REGISTRANDO%...
'; var conn = new Ext.data.Connection(); conn.request( { url : './usuariosVerificar.php', method : 'POST', params : { "nombre" : nombre.value, "email" : email.value }, success : function(responseObject) { if (responseObject.responseText == '0') { var conn = new Ext.data.Connection(); conn.request( { url : './admin/usuariosGuardar.php', method : 'POST', params : { "nombre" : nombre.value, "email" : email.value, "telefono" : telefono.value, "apellido" : apellido.value, "movil" : movil.value }, success : function(responseObject) { document.getElementById('registrarUsuario').innerHTML = '
Registro exitoso!
'; } }); } else { document.getElementById('registrarUsuario').innerHTML = volverRegUs; document.getElementById('divError').innerHTML = 'El e-mail ingresado se encuentra registrado! Vuelva a intentarlo por favor. Gracias!'; } } }); } }