$(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 = '
Registro exitoso! |