function MostrarFilas(Fila,area) { 
var elementos = document.getElementsByName(Fila);
if(area=='oficina tecnica'){
    for (i = 0; i< elementos.length; i++) { 
        if(navigator.appName.indexOf("Microsoft") > -1){ 
               var visible = 'block' 
        } else { 
               var visible = 'table-row'; 
        } 
	elementos[i].style.display = visible; 
        } 
} else {
    for (i = 0; i< elementos.length; i++) { 
		elementos[i].style.display = 'none'; 
        } 
}
} 

function validar_noticia(f){	

	if(f.titulo.value.length < 1){
		alert("Introduce un título para la noticia");		
		f.titulo.focus();
		return false;
		}		
	if(f.noticia.value.length < 1){
		alert("Introduce un la noticia");		
		f.noticia.focus();
		return false;
		}		
	return true;	
}
function validar_nuevo_aforismo(f){

	aforismo = f.aforismo.value;	
	if(aforismo.length < 1){
		alert("Introduce un aforismo");		
		f.aforismo.focus();
		return false;
		}		
	return true;	
}

function validar_nuevo_cliente(f){
	
	if(f.nombre.value.length < 1){
		alert("Introduce un cliente");	
		f.nombre.focus();
		return false;				
		}
	/*if(f.area.value=="0"){
		alert("Selecciona un área");		
		return false;						
		}*/
	return true;	
}

function validar_enlace(f){

	if(f.empresa.value.length < 1){		
		alert("Debes introducir una empresa")
		return false;					
		}		
	if(f.enlace2.value.length < 8){		
		alert("Debes introducir el enlace")
		return false;					
		}		
	return true;	
}
function validar_contacto(f){
	if(f.nombre.value.length < 1){
		alert("Introduce un nombre");	
		f.nombre.focus();
		return false;				
		}
	var str=f.email.value
	var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
	testresults=true;
else{
	alert("El e-mail no es correcto!")
	f.email.focus();
	return false;
	}
	
	if(f.consulta.value.length<1){
		alert("Debe escribir su consulta");
		f.consulta.focus();
		return false;
	}
return true;
}
var contador=0;

function ObtenerDatos(datos,divID) { 
	var obj = document.getElementById(divID); 
	var peticion = false; 
	contador=contador+1;
	if (window.XMLHttpRequest) { 
    	peticion = new XMLHttpRequest(); 
    } else if (window.ActiveXObject) { 
        peticion = new ActiveXObject("Microsoft.XMLHTTP"); 
	}
	if(peticion) { 
		var url=datos + '?contador=' + contador;
     	peticion.open("GET", url);   //
     	peticion.onreadystatechange = function() { 
        	if (peticion.readyState == 4) { 
         		obj.innerHTML = peticion.responseText	;
		   	} 
     	} 
		peticion.send(null); 
	}
setTimeout("ObtenerDatos('logos.php','logos')",5000);
}

