// JavaScript Document
function notNull(str)
{
if (str.length == 0 ) return false;
else return true;
}
function notBlank(str)
{
for (i = 0; i < str.length; i++) {
if (str.charAt(i) != " ") return true;
}
return false;
}
function isSize(str, size) {
if (str.length == size) return true;
else return false;
}
function isDigits(str)
{
var i;
for (i = 0; i < str.length; i++) {
mychar = str.charAt(i);
if (mychar < "0" || mychar > "9") return false;
}
return true;
}
function isNumber(str)
{
numdecs = 0;
for (i = 0; i < str.length; i++) {
mychar = str.charAt(i);
if ((mychar >= "0" && mychar <= "9") || mychar == ".") {
if (mychar == ".") numdecs++;
} else return false;
}
if (numdecs > 1) return false;
return true;
}
function isInRange(str, num1, num2)
{
var i = parseInt(str);
return((i >= num1) && (i <= num2));
}
function validateMail(myfield, s) {
plant = /^([^@]*)+@{1}[\w\.-]+\.[\w]{2,4}$/i
if (plant.test(myfield.value)) {
return(true)
} else {
alert("El campo " + s + " no es correcto, por favor rellene este campo correctamente.");
return(false)
}
}
function validateString(myfield, s)
{
if (notNull(myfield.value)&& notBlank(myfield.value))
return true;
else {
myfield.focus();
alert("El campo " + s + " est\xe1 vac\xedo, por favor rellene este campo.");
return false;
}
}
function validaForm()
{
if (document.formSolicitud.formPais.value == "ES" && document.formSolicitud.formProvincia.value == 0) {
alert("Por favor seleccione una provincia.");
return false;
} else {
return (validateString(document.formSolicitud.formNombre, "NOMBRE") &&
validateString(document.formSolicitud.formUrl, "URL") &&
validateMail(document.formSolicitud.formEmail, "EMAIL") &&
validateString(document.formSolicitud.formImagen, "TEXTO DE LA IMAGEN"));
}
}
function cambiaBtnEnvio(modo)
{
if (modo == 1) {
document.getElementById('formSolicitud').reset();
}
if (document.getElementById('condiciones').checked == true) {
document.getElementById('btnEnvio').disabled = false;
} else {
document.getElementById('btnEnvio').disabled = true;
}
}
function goW(url, idCliente, idActividad, ip, navegador, referer, posicion, esLogo)
{
requestClick('cuenta_click_cliente.php?idCliente='+idCliente+'&idActividad='+idActividad+'&ip='+ip+'&naveg='+navegador+'&referer='+referer+'&pos='+posicion);
///////////window.open("http://"+url,"goW");
//var nombreNuevaVentana = "nuevaVentana";
//var ventana = window.open("","nuevaVentana");
if (esLogo == 1) {
var enlace = document.getElementById("L"+idCliente);
} else if(esLogo == 0) {
var enlace = document.getElementById(idCliente);
} else{
var enlace = document.getElementById("T"+idCliente);
}
//enlace.target = "nuevaVentana";
enlace.href = "http://"+url;
enlace.click();
}
function toggleDiv(){
//alert(" ");
document.getElementById("flotante").style.display = "none";
}
function toggleDivRotulos(){
document.getElementById("rotulos").style.display = "none";
}
function showLogoRefs(id_site,texto_title, enlace_site, enlace_site_logo, follow, path_logo, ancho, alto, texto_alt){
document.getElementById('site_'+id_site).innerHTML = "
";
}
function cambiarClase(idCapa,clase) {
document.getElementById(idCapa).className=clase;
}