function in_cojefoco(o) {
	if (o.className=='') {
		o.value=''
	}
	o.className='input_foco';
}

function in_quitafoco(o,text) {
	if (o.value=='' || o.value==text)
	{
		o.value=text;
		o.className='';
	}
}

function validaContacto() {
	if ($('nombre').value=='') {
		alert('Debe rellenar su nombre para poder enviar el formulario de contacto');
		$('nombre').focus();
		return false;
	}
	if ($('apellidos').value=='') {
		alert('Debe rellenar sus apellidos para poder enviar el formulario de contacto');
		$('apellidos').focus();
		return false;
	}
	if ($('email').value=='') {
		alert('Debe rellenar su email para poder enviar el formulario de contacto');
		$('email').focus();
		return false;
	}
	if ($('asunto').value=='') {
		alert('Debe rellenar el asunto del contacto');
		$('asunto').focus();
		return false;
	}
	if ($('condiciones').checked=='') {
		alert('Debe aceptar el aviso legal');
		$('condiciones').focus();
		return false;
	}
}

function validaClub() {
	if ($('nombre').value=='') {
		alert('Debe rellenar su nombre para poder enviar su consulta');
		$('nombre').focus();
		return false;
	}
	if ($('apellidos').value=='') {
		alert('Debe rellenar sus apellidos para poder enviar su consulta');
		$('apellidos').focus();
		return false;
	}
	if ($('telefono').value=='') {
		alert('Debe rellenar su telefono para poder enviar su consulta');
		$('telefono').focus();
		return false;
	}
	if ($('email').value=='') {
		alert('Debe rellenar su email para poder enviar su consulta');
		$('email').focus();
		return false;
	}
	if ($('profesion').value=='') {
		alert('Debe rellenar su profesion para poder enviar su consulta');
		$('profesion').focus();
		return false;
	}
	if ($('estado_civil').value=='') {
		alert('Debe rellenar su estado civil para poder enviar su consulta');
		$('email').focus();
		return false;
	}
	if ($('descripcion').value=='') {
		alert('Debe rellenar la descripción de su consulta');
		$('descripcion').focus();
		return false;
	}
}


/*===Scroll de imagenes===*/
var numElem=0;
var timerID=0;

function it(nE) {
	numElem=nE;
	x=document.getElementById("scroll_dentro");
	x.style.width=((154*numElem)+2) + "px";
}
function st() {
	/*Parar el movimiento*/
	clearTimeout(timerID);
}
function dr() {
	/*Mover a la derecha*/
	clearTimeout(timerID);
	timerID=setTimeout("dcha()", 50);
}
function di() {
	/*Mover a la izquierda*/
	clearTimeout(timerID);
	timerID=setTimeout("izda()", 50);
}
function dcha() {
	x=document.getElementById("scroll_dentro");
	if ( (154*numElem+parseInt(x.style.left)) >= 614 ) {
		x.style.left=(parseInt(x.style.left)-10) + "px";
		timerID=setTimeout("dcha()", 50);
	}
}
function izda() {
	x=document.getElementById("scroll_dentro");
	if ( parseInt(x.style.left) <= 0 ) {
		x.style.left=(parseInt(x.style.left)+10) + "px";
		timerID=setTimeout("izda()", 50);
	}
}

function abrecierra(id) {
	if ($(id).style.display=='') $(id).style.display='none';
	else $(id).style.display='';
}

function validaReclamacion1() {
	var dni=$('dni').value;
	new Ajax.Request('procesaReclamaciones.php?d='+dni,{
		onSuccess: function(response) {
			var t = response.responseText;
			if (t=='false')	{
				alert('No se ha encontrado el dni');
			} else {
				var a=t.split(':');
				$('nombre').value=a[0];
				$('email').value=a[1];
				$('formu').submit();
			}
		}
	});
}
