/* begind - 01 - roll-over*/
/* begind - 02 - tools*/
/* begind - 03 - asóciate*/
/* begind - 04 - login*/
/* begind - 05 - votafotos*/
/* begind - 06 - pedirfotomail*/
/* begind - 07 - reloj*/
/*//////////////////////////*/

/* begind - 01 - roll-over*/
/*///////////////////////
// MM_preloadImages()
///////////////////////*/
function MM_preloadImages()
{
	var d = document;
	if(d.images)
	{
		if(!d.MM_p)
			d.MM_p = new Array();
		var i, j = d.MM_p.length, a = MM_preloadImages.arguments;
		for(i = 0; i < a.length; i++)
			if (a[i].indexOf("#") != 0)
			{
				d.MM_p[j] = new Image;
				d.MM_p[j++].src = a[i];
			}
	}
}

/*///////////////////////
// MM_swapImgRestore()
///////////////////////*/
function MM_swapImgRestore()
{
	var i, x, a = document.MM_sr;
	for(i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++)
	x.src = x.oSrc;
}

/*///////////////////////
// MM_findObj()
///////////////////////*/
function MM_findObj(n, d)
{
	var p, i, x;
	if(!d)
		d = document;
	if((p = n.indexOf("?")) > 0 && parent.frames.length)
	{
		d = parent.frames[n.substring(p + 1)].document;
		n = n.substring(0,p);
	}
	if(!(x = d[n]) && d.all)
		x = d.all[n];
	for (i = 0; !x && i < d.forms.length; i++)
		x = d.forms[i][n];
	for(i = 0; !x && d.layers && i < d.layers.length; i++)
		x = MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById)
		x = d.getElementById(n);
	return x;
}

/*///////////////////////
// MM_swapImage()
///////////////////////*/
function MM_swapImage()
{
	var i, j = 0, x, a = MM_swapImage.arguments;
	document.MM_sr = new Array;
	for(i=0; i < (a.length - 2); i += 3)
		if ((x = MM_findObj(a[i])) != null)
		{
			document.MM_sr[j++]=x;
			if(!x.oSrc)
				x.oSrc=x.src;
			x.src=a[i+2];
		}
}
/* end - 01 - roll-over*/

/* begind - 02 - tools*/
/*///////////////////////
// AFavoritos()
///////////////////////*/
function AFavoritos()
{
	var url = String(document.URL);
	var titulo = String(document.title);
	if (document.all)
		window.external.AddFavorite(url,titulo);
}

/*///////////////////////
// IsNumber()
///////////////////////*/
function IsNumber(number)
{
	var n = number;
 
	if (n.charAt(n.length-1) == ',')
	{
		n = n + '0';
	}
	return (/^[1-9](\d)*((\,)?(\d)+)?$/.test(n));
}

/*///////////////////////
// PopUp()
///////////////////////*/
function PopUp(url, height, width)
{
	var params = "dialogHeight: ";
	params = params + height + "px;dialogWidth: ";
	params = params + width + "px;edge: Raised; center: yes; status: no; resizable: no; help: no; scroll: no; unadorned: yes; dialogHide: yes;";

/*window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500,left = 433,top = 134');");*/
	if (window.showModalDialog)
		window.showModalDialog(url, window, params);
	else if (window.showModelessDialog)
		window.showModelessDialog(url, window, params);
}

/*///////////////////////
// refresca()
///////////////////////*/
function refresca()
{
	location.reload(true);
}

/*///////////////////////
// MontaContador()
///////////////////////*/
function MontaContador(digitos, valorin, tabla)
{
	valor = String(valorin);
	var table = document.getElementById(tabla);
	var bodyname = 'tbody' + tabla;
	var oldtbody = document.getElementById(bodyname);
	if (oldtbody != null)
		table.removeChild(oldtbody);
	var tbody = document.createElement("tbody");
	tbody.setAttribute("id",bodyname);
	var tr = document.createElement('tr');
	var ceros = digitos - valor.length;
	for(var i=0; i < ceros; i++)
	{
		var td = document.createElement('td');
		var imagen = document.createElement('img');
		imagen.style.border="0pt";
		imagen.style.width="16px";
		imagen.style.height="16px";
		imagen.src='imagenes/numero0.gif';
		td.appendChild(imagen);
		tr.appendChild(td);
	}
	for(var i=0; i < valor.length; i++)
	{
		var td = document.createElement('td');
		var imagen = document.createElement('img');
		imagen.style.border="0pt";
		imagen.style.width="16px";
		imagen.style.height="16px";
		if(valor.charAt(i) == 0)
			imagen.src='imagenes/numero0.gif';
		else if(valor.charAt(i) == 1)
			imagen.src='imagenes/numero1.gif';
		else if(valor.charAt(i) == 2)
			imagen.src='imagenes/numero2.gif';
		else if(valor.charAt(i) == 3)
			imagen.src='imagenes/numero3.gif';
		else if(valor.charAt(i) == 4)
			imagen.src='imagenes/numero4.gif';
		else if(valor.charAt(i) == 5)
			imagen.src='imagenes/numero5.gif';
		else if(valor.charAt(i) == 6)
			imagen.src='imagenes/numero6.gif';
		else if(valor.charAt(i) == 7)
			imagen.src='imagenes/numero7.gif';
		else if(valor.charAt(i) == 8)
			imagen.src='imagenes/numero8.gif';
		else if(valor.charAt(i) == 9)
			imagen.src='imagenes/numero9.gif';
		td.appendChild(imagen);
		tr.appendChild(td);
	}
	tbody.appendChild(tr);
	table.appendChild(tbody);
}
/* end - 02 - tools*/

/* begind - 03 - asóciate*/
/*///////////////////////
// CargaAficiones()
///////////////////////*/
function CargaAficiones()
{
	var table = document.getElementById('aficiones');
	var tbody;

	/* 1 tierra*/
	if (document.getElementById("chktierra").checked)
 	{
		tbody = document.getElementById("tbodytierra");
		if (tbody == null)
		{
			var tbody = document.createElement("tbody");
			tbody.setAttribute("id","tbodytierra");
			var tr = document.createElement('tr');

			var td = document.createElement('td');
			var check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chkbicicleta";
			check.name = "chkbicicleta";
			check.checked = false;
			td.appendChild(check);
			var br = document.createElement('br');
			td.appendChild(br);
			var txtInner = document.createTextNode("Bicicleta");
			td.appendChild(txtInner);
			tr.appendChild(td);

			td = document.createElement('td');
			check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chkescalada";
			td.appendChild(check);
			br = document.createElement('br');
			td.appendChild(br);
			txtInner = document.createTextNode("Escalada");
			td.appendChild(txtInner);
			tr.appendChild(td);

			td = document.createElement('td');
			check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chkespeleo";
			td.appendChild(check);
			br = document.createElement('br');
			td.appendChild(br);
			txtInner = document.createTextNode("Espeleo");
			td.appendChild(txtInner);
			tr.appendChild(td);

			td = document.createElement('td');
			check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chksenderismo";
			td.appendChild(check);
			br = document.createElement('br');
			td.appendChild(br);
			txtInner = document.createTextNode("Senderismo");
			td.appendChild(txtInner);
			tr.appendChild(td);

			tbody.appendChild(tr);
			table.appendChild(tbody);
		}
	}
	else
	{
		tbody = document.getElementById("tbodytierra");
		if (tbody != null)
			table.removeChild(tbody);
	}

	/* 2 agua*/
	if (document.getElementById("chkagua").checked)
 	{
		tbody = document.getElementById("tbodyagua");
		if (tbody == null)
		{
			var tbody = document.createElement("tbody");
			tbody.setAttribute("id","tbodyagua");
			var tr = document.createElement('tr');

			var td = document.createElement('td');
			var check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chkpiragua";
			td.appendChild(check);
			var br = document.createElement('br');
			td.appendChild(br);
			var txtInner = document.createTextNode("Piragua");
			td.appendChild(txtInner);
			tr.appendChild(td);

			td = document.createElement('td');
			check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chkbarranquismo";
			td.appendChild(check);
			br = document.createElement('br');
			td.appendChild(br);
			txtInner = document.createTextNode("Barranquismo");
			td.appendChild(txtInner);
			tr.appendChild(td);

			td = document.createElement('td');
			check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chkbuceo";
			td.appendChild(check);
			br = document.createElement('br');
			td.appendChild(br);
			txtInner = document.createTextNode("Buceo");
			td.appendChild(txtInner);
			tr.appendChild(td);

			td = document.createElement('td');
			check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chksurf";
			td.appendChild(check);
			br = document.createElement('br');
			td.appendChild(br);
			txtInner = document.createTextNode("Surf");
			td.appendChild(txtInner);
			tr.appendChild(td);

			tbody.appendChild(tr);
			table.appendChild(tbody);
		}
	}
	else
	{
		tbody = document.getElementById("tbodyagua");
		if (tbody != null)
			table.removeChild(tbody);
	}

	/* 3 nieve*/
	if (document.getElementById("chknieve").checked)
 	{
		tbody = document.getElementById("tbodynieve");
		if (tbody == null)
		{
			var tbody = document.createElement("tbody");
			tbody.setAttribute("id","tbodynieve");
			var tr = document.createElement('tr');

			var td = document.createElement('td');
			var check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chkesqui";
			td.appendChild(check);
			var br = document.createElement('br');
			td.appendChild(br);
			var txtInner = document.createTextNode("Esquí");
			td.appendChild(txtInner);
			tr.appendChild(td);

			td = document.createElement('td');
			check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chktabla";
			td.appendChild(check);
			br = document.createElement('br');
			td.appendChild(br);
			txtInner = document.createTextNode("Tabla");
			td.appendChild(txtInner);
			tr.appendChild(td);

			td = document.createElement('td');
			check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chkfondo";
			td.appendChild(check);
			br = document.createElement('br');
			td.appendChild(br);
			txtInner = document.createTextNode("Fondo");
			td.appendChild(txtInner);
			tr.appendChild(td);

			td = document.createElement('td');
			check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chkalpinismo";
			td.appendChild(check);
			br = document.createElement('br');
			td.appendChild(br);
			txtInner = document.createTextNode("Alpinismo");
			td.appendChild(txtInner);
			tr.appendChild(td);

			tbody.appendChild(tr);
			table.appendChild(tbody);
		}
	}
	else
	{
		tbody = document.getElementById("tbodynieve");
		if (tbody != null)
			table.removeChild(tbody);
	}

	/* 4 aire*/
	if (document.getElementById("chkaire").checked)
	{
		tbody = document.getElementById("tbodyaire");
		if (tbody == null)
		{
			var tbody = document.createElement("tbody");
			tbody.setAttribute("id","tbodyaire");
			var tr = document.createElement('tr');

			var td = document.createElement('td');
			var check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chkparapente";
			td.appendChild(check);
			var br = document.createElement('br');
			td.appendChild(br);
			var txtInner = document.createTextNode("Parapente");
			td.appendChild(txtInner);
			tr.appendChild(td);

			td = document.createElement('td');
			check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chkvela";
			td.appendChild(check);
			br = document.createElement('br');
			td.appendChild(br);
			txtInner = document.createTextNode("Vela");
			td.appendChild(txtInner);
			tr.appendChild(td);

			td = document.createElement('td');
			check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chkparamotor";
			td.appendChild(check);
			br = document.createElement('br');
			td.appendChild(br);
			txtInner = document.createTextNode("Paramotor");
			td.appendChild(txtInner);
			tr.appendChild(td);

			td = document.createElement('td');
			check = document.createElement('input');
			check.type = 'checkbox';
			check.id = "chksalto";
			td.appendChild(check);
			br = document.createElement('br');
			td.appendChild(br);
			txtInner = document.createTextNode("Salto");
			td.appendChild(txtInner);
			tr.appendChild(td);

			tbody.appendChild(tr);
			table.appendChild(tbody);
		}
	}
	else
	{
		tbody = document.getElementById("tbodyaire");
		if (tbody != null)
			table.removeChild(tbody);
	}
}

/*///////////////////////
// CompruebaFicha()
///////////////////////*/
function CompruebaFicha()
{
	var nombre = document.getElementById("txtnombre").value;
	var apellidos = document.getElementById("txtapellidos").value;
	var dni = document.getElementById("txtdni").value;
	var direccion = document.getElementById("txtdireccion").value;
	var localidad = document.getElementById("txtlocalidad").value;
	var provincia = document.getElementById("txtprovincia").value;
	var cp = document.getElementById("txtcp").value;
	var telefono = document.getElementById("txttelefono").value;
	var email = document.getElementById("txtemail").value;
	var observaciones = document.getElementById("txtobservaciones").innerText;
	var error = false;

	/* 1 nombre*/
	var table = document.getElementById('errornombre');
	if (nombre == "")
	{
		var tbody = document.getElementById("tbodyerrornombre");
		if (tbody == null)
		{
			var tbody = document.createElement("tbody");
			tbody.setAttribute("id","tbodyerrornombre");
			var tr = document.createElement('tr');
			var td = document.createElement('td');
			var imagen= document.createElement('img');
			imagen.src='../Imagenes/revisa.gif';
			imagen.style.border="0pt";
			imagen.style.width="60px";
			imagen.style.height="16px";
			td.appendChild(imagen);
			tr.appendChild(td);
			tbody.appendChild(tr);
			table.appendChild(tbody);
		}

		document.getElementById("txtnombre").focus();
		error = true;
	}
	else
	{
		tbody = document.getElementById("tbodyerrornombre");
		if (tbody != null)
			table.removeChild(tbody);
	}

	/* 2 apellidos*/
	table = document.getElementById('errorapellidos');
	if (apellidos == "")
	{
		var tbody = document.getElementById("tbodyerrorapellidos");
		if (tbody == null)
		{
			var tbody = document.createElement("tbody");
			tbody.setAttribute("id","tbodyerrorapellidos");
			var tr = document.createElement('tr');
			var td = document.createElement('td');
			var imagen= document.createElement('img');
			imagen.src='../Imagenes/revisa.gif';
			imagen.style.border="0pt";
			imagen.style.width="60px";
			imagen.style.height="16px";
			td.appendChild(imagen);
			tr.appendChild(td);
			tbody.appendChild(tr);
			table.appendChild(tbody);
		}

		document.getElementById("txtapellidos").focus();
		error = true;
	}
	else
	{
		tbody = document.getElementById("tbodyerrorapellidos");
		if (tbody != null)
			table.removeChild(tbody);
	}

	/* 3 dni*/
	table = document.getElementById('errordni');
	if (dni == "")
	{
		var tbody = document.getElementById("tbodyerrordni");
		if (tbody == null)
		{
			var tbody = document.createElement("tbody");
			tbody.setAttribute("id","tbodyerrordni");
			var tr = document.createElement('tr');
			var td = document.createElement('td');
			var imagen= document.createElement('img');
			imagen.src='../Imagenes/revisa.gif';
			imagen.style.border="0pt";
			imagen.style.width="60px";
			imagen.style.height="16px";
			td.appendChild(imagen);
			tr.appendChild(td);
			tbody.appendChild(tr);
			table.appendChild(tbody);
		}

		document.getElementById("txtdni").focus();
		error = true;
	}
	else
	{
		if ((dni.length != 9) || (!IsNumber(dni.substr(0,8))) || (IsNumber(dni.charAt(8))))
		{
			var tbody = document.getElementById("tbodyerrordni");
			if (tbody == null)
			{
				var tbody = document.createElement("tbody");
				tbody.setAttribute("id","tbodyerrordni");
				var tr = document.createElement('tr');
				var td = document.createElement('td');
				var imagen= document.createElement('img');
				imagen.src='../Imagenes/revisa.gif';
				imagen.style.border="0pt";
				imagen.style.width="60px";
				imagen.style.height="16px";
				td.appendChild(imagen);
				tr.appendChild(td);
				tbody.appendChild(tr);
				table.appendChild(tbody);
			}

			document.getElementById("txtdni").focus();
			error = true;
		}
		else
		{
			tbody = document.getElementById("tbodyerrordni");
			if (tbody != null)
				table.removeChild(tbody);
		}
	}

	/* 4 direccion*/
	table = document.getElementById('errordireccion');
	if (direccion == "")
	{
		var tbody = document.getElementById("tbodyerrordireccion");
		if (tbody == null)
		{
			var tbody = document.createElement("tbody");
			tbody.setAttribute("id","tbodyerrordireccion");
			var tr = document.createElement('tr');
			var td = document.createElement('td');
			var imagen= document.createElement('img');
			imagen.src='../Imagenes/revisa.gif';
			imagen.style.border="0pt";
			imagen.style.width="60px";
			imagen.style.height="16px";
			td.appendChild(imagen);
			tr.appendChild(td);
			tbody.appendChild(tr);
			table.appendChild(tbody);
		}

		document.getElementById("txtdireccion").focus();
		error = true;
	}
	else
	{
		tbody = document.getElementById("tbodyerrordireccion");
		if (tbody != null)
			table.removeChild(tbody);
	}

	/* 5 localidad*/
	table = document.getElementById('errorlocalidad');
	if (localidad == "")
	{
		var tbody = document.getElementById("tbodyerrorlocalidad");
		if (tbody == null)
		{
			var tbody = document.createElement("tbody");
			tbody.setAttribute("id","tbodyerrorlocalidad");
			var tr = document.createElement('tr');
			var td = document.createElement('td');
			var imagen= document.createElement('img');
			imagen.src='../Imagenes/revisa.gif';
			imagen.style.border="0pt";
			imagen.style.width="60px";
			imagen.style.height="16px";
			td.appendChild(imagen);
			tr.appendChild(td);
			tbody.appendChild(tr);
			table.appendChild(tbody);
		}

		document.getElementById("txtlocalidad").focus();
		error = true;
	}
	else
	{
		tbody = document.getElementById("tbodyerrorlocalidad");
		if (tbody != null)
			table.removeChild(tbody);
	}

	/* 6 provincia*/
	table = document.getElementById('errorprovincia');
	if (provincia == "")
	{
		var tbody = document.getElementById("tbodyerrorprovincia");
		if (tbody == null)
		{
			var tbody = document.createElement("tbody");
			tbody.setAttribute("id","tbodyerrorprovincia");
			var tr = document.createElement('tr');
			var td = document.createElement('td');
			var imagen= document.createElement('img');
			imagen.src='../Imagenes/revisa.gif';
			imagen.style.border="0pt";
			imagen.style.width="60px";
			imagen.style.height="16px";
			td.appendChild(imagen);
			tr.appendChild(td);
			tbody.appendChild(tr);
			table.appendChild(tbody);
		}

		document.getElementById("txtprovincia").focus();
		error = true;
	}
	else
	{
		tbody = document.getElementById("tbodyerrorprovincia");
		if (tbody != null)
			table.removeChild(tbody);
	}

	/* 7 cp*/
	table = document.getElementById('errorcp');
	if (cp == "")
	{
		var tbody = document.getElementById("tbodyerrorcp");
		if (tbody == null)
		{
			var tbody = document.createElement("tbody");
			tbody.setAttribute("id","tbodyerrorcp");
			var tr = document.createElement('tr');
			var td = document.createElement('td');
			var imagen= document.createElement('img');
			imagen.src='../Imagenes/revisa.gif';
			imagen.style.border="0pt";
			imagen.style.width="60px";
			imagen.style.height="16px";
			td.appendChild(imagen);
			tr.appendChild(td);
			tbody.appendChild(tr);
			table.appendChild(tbody);
		}

		document.getElementById("txtcp").focus();
		error = true;
	}
	else
	{
		if ((!IsNumber(cp)) || (cp.length != 5))
		{
			var tbody = document.getElementById("tbodyerrorcp");
			if (tbody == null)
			{
				var tbody = document.createElement("tbody");
				tbody.setAttribute("id","tbodyerrorcp");
				var tr = document.createElement('tr');
				var td = document.createElement('td');
				var imagen= document.createElement('img');
				imagen.src='../Imagenes/revisa.gif';
				imagen.style.border="0pt";
				imagen.style.width="60px";
				imagen.style.height="16px";
				td.appendChild(imagen);
				tr.appendChild(td);
				tbody.appendChild(tr);
				table.appendChild(tbody);
			}

			document.getElementById("txtcp").focus();
			error = true;
		}
		else
		{
			tbody = document.getElementById("tbodyerrorcp");
			if (tbody != null)
				table.removeChild(tbody);
		}
	}

	/* 8 telefono*/
	table = document.getElementById('errortelefono');
	if (telefono == "")
	{
		var tbody = document.getElementById("tbodyerrortelefono");
		if (tbody == null)
		{
			var tbody = document.createElement("tbody");
			tbody.setAttribute("id","tbodyerrortelefono");
			var tr = document.createElement('tr');
			var td = document.createElement('td');
			var imagen= document.createElement('img');
			imagen.src='../Imagenes/revisa.gif';
			imagen.style.border="0pt";
			imagen.style.width="60px";
			imagen.style.height="16px";
			td.appendChild(imagen);
			tr.appendChild(td);
			tbody.appendChild(tr);
			table.appendChild(tbody);
		}

		document.getElementById("txttelefono").focus();
		error = true;
	}
	else
	{
		if (!IsNumber(telefono))
		{
			var tbody = document.getElementById("tbodyerrortelefono");
			if (tbody == null)
			{
				var tbody = document.createElement("tbody");
				tbody.setAttribute("id","tbodyerrortelefono");
				var tr = document.createElement('tr');
				var td = document.createElement('td');
				var imagen= document.createElement('img');
				imagen.src='../Imagenes/revisa.gif';
				imagen.style.border="0pt";
				imagen.style.width="60px";
				imagen.style.height="16px";
				td.appendChild(imagen);
				tr.appendChild(td);
				tbody.appendChild(tr);
				table.appendChild(tbody);
			}

			document.getElementById("txttelefono").focus();
			error = true;
		}
		else
		{
			tbody = document.getElementById("tbodyerrortelefono");
			if (tbody != null)
				table.removeChild(tbody);
		}
	}

	/* 9 email*/
	table = document.getElementById('erroremail');
	if (email != "")
	{
		var arroba = email.split("@");
		if (arroba.length < 2)
		{
			var tbody = document.getElementById("tbodyerroremail");
			if (tbody == null)
			{
				var tbody = document.createElement("tbody");
				tbody.setAttribute("id","tbodyerroremail");
				var tr = document.createElement('tr');
				var td = document.createElement('td');
				var imagen= document.createElement('img');
				imagen.src='../Imagenes/revisa.gif';
				imagen.style.border="0pt";
				imagen.style.width="60px";
				imagen.style.height="16px";
				td.appendChild(imagen);
				tr.appendChild(td);
				tbody.appendChild(tr);
				table.appendChild(tbody);
			}

			document.getElementById("txtemail").focus();
			error = true;
		}
		else
		{
			var user = arroba[0];
			var host = arroba[1];
			var punto = host.split(".");
			if ((user == "") || (punto.length < 2) || (punto[0] == "") || (punto[1] == ""))
			{
				var tbody = document.getElementById("tbodyerroremail");
				if (tbody == null)
				{
					var tbody = document.createElement("tbody");
					tbody.setAttribute("id","tbodyerroremail");
					var tr = document.createElement('tr');
					var td = document.createElement('td');
					var imagen= document.createElement('img');
					imagen.src='../Imagenes/revisa.gif';
					imagen.style.border="0pt";
					imagen.style.width="60px";
					imagen.style.height="16px";
					td.appendChild(imagen);
					tr.appendChild(td);
					tbody.appendChild(tr);
					table.appendChild(tbody);
				}

				document.getElementById("txtemail").focus();
				error = true;
			}
			else
			{
				tbody = document.getElementById("tbodyerroremail");
				if (tbody != null)
					table.removeChild(tbody);
			}
		}
	}
	else
	{
		tbody = document.getElementById("tbodyerroremail");
		if (tbody != null)
			table.removeChild(tbody);
	}

	return error;
}

/*///////////////////////
// LeeAficiones()
///////////////////////*/
function LeeAficiones()
{
	var aficiones = "";
	var boxs = new Array();
	boxs = ['chkbicicleta','chkescalada','chkespeleo','chksenderismo',
			'chkpiragua','chkbarranquismo','chkbuceo','chksurf',
			'chkesqui','chktabla','chkfondo','chkalpinismo',
			'chkparapente','chkvela','chkparamotor','chksalto']
	for(var i = 0; i < boxs.length; i++)
	{
		var check = document.getElementById(boxs[i]);
		if ((check != null) && (check.checked))
			aficiones += "1";
		else
			aficiones += "0";
				
	}

	document.getElementById('chkaficiones').value = aficiones;
}

/*///////////////////////
// MandarFicha()
///////////////////////*/
function MandarFicha()
{
	if (!CompruebaFicha())
	{
		LeeAficiones();
		document.ficha.submit();
	}
}
/* end - 03 - asóciate*/

/* begind - 04 - login*/
/*///////////////////////
// CompruebaLogin()
///////////////////////*/
function CompruebaLogin()
{
	return false;
}

/*///////////////////////
// Loguea()
///////////////////////*/
function Loguea()
{
	if (!CompruebaLogin())
		return true;
}
/* end - 04 - login*/

/* begind - 05 - votafotos*/
/*///////////////////////
// VotaFoto()
///////////////////////*/
function VotaFoto(foto, voto)
{
	var url = "votafoto.php?IDFOTO=" + foto + "&PUNTOS=" + voto;
	PopUp(url,150,250);
	/*location.reload(true);*/
}
/* end - 05 - votafotos*/

/* begind - 06 - pedirfotomail*/
/*///////////////////////
// CompruebaMail()
///////////////////////*/
function CompruebaMail()
{
	var foto = document.getElementById("txtfoto").value;
	var email = document.getElementById("txtemail").value;
	var error = false;

	if (foto.length != 8)
			error = true;

	if (email == "")
	{
		error = true;
	}
	else
	{
		var arroba = email.split("@");
		if (arroba.length < 2)
		{
			error = true;
		}
		else
		{
			var user = arroba[0];
			var host = arroba[1];
			var punto = host.split(".");
			if ((user == "") || (punto.length < 2) || (punto[0] == "") || (punto[1] == ""))
				error = true;
		}
	}

	return error;
}

/*///////////////////////
// PedirFoto()
///////////////////////*/
function PedirFoto()
{
	if (!CompruebaMail())
	{
		document.getElementById('chkmail').value = "1";
		document.fotocorreo.submit();
	}
	else
	{
		document.getElementById('chkmail').value = "0";
		document.fotocorreo.submit();
	}
}
/* end - 06 - pedirfotomail*/

/* begind - 07 - reloj*/
function reloj()
{
	var fObj = new Date();
	var horas = fObj.getHours();
	var minutos = fObj.getMinutes();
	var segundos = fObj.getSeconds();
	MontaContador(2, horas, 'tblclockh');
	MontaContador(2, minutos, 'tblclockm');
	MontaContador(2, segundos, 'tblclocks');
}
function iniciaReloj()
{
	var fObj = new Date();
	var horas = fObj.getHours();
	var minutos = fObj.getMinutes();
	var segundos = fObj.getSeconds();
	MontaContador(2, horas, 'tblclockh');
	MontaContador(2, minutos, 'tblclockm');
	MontaContador(2, segundos, 'tblclocks');
	var id = setInterval("reloj()",1000);
	/*setTimeout("clearInterval("+id+")",15000);*/
}
/* end - 07 - reloj*/

