function lenguaje() {leng=(document.all?navigator.browserLanguage:navigator.language);if(leng.indexOf("es")!=-1) return "es"; else return "en";}

function firmarLV()
{
document.lvform.accion.value="firmar";
document.lvform.submit();
}

function compruebaEntrada()
{
roj="#ff0000";
whi='#D2DADA';
mens="";
f=document.lvfirma;
lengua=lenguaje();

f.nombre.style.borderColor=whi;
f.lugar.style.borderColor=whi;
f.url.style.borderColor=whi;
f.email.style.borderColor=whi;
f.texto.style.borderColor=whi;

//nombre debe estar relleno
if(f.nombre.value=="") 
	{
	f.nombre.style.borderColor=roj;
	mens+=(lengua=='es'?'se debe introducir un nombre<br>':'name is obligatory<br>');
	}
//lugar también
if(f.lugar.value=="") 
	{
	f.lugar.style.borderColor=roj;
	mens+=(lengua=='es'?'se debe introducir un lugar<br>':'place is obligatory<br>');
	}
//si hay url, que lleve http
if(f.url.value!="")
	if(f.url.value.substr(0,7).toLowerCase()!="http://" && f.url.value.substr(0,8).toLowerCase()!="https://")
	{
	f.url.style.borderColor=roj;
	mens+=(lengua=='es'?'la url ha de comenzar por http:// o https://<br>':'the url must begin with http:// or https://<br>');
	}
//controlar email
if(f.email.value!="" && f.email.value.indexOf("@")==-1)
	{
	f.email.style.borderColor=roj;
	mens+=(lengua=='es'?'el email parece incorrecto<br>':'the email does not look as one<br>');
	}
//controlar texto
if(f.texto.value=="") 
	{
	f.texto.style.borderColor=roj;
	mens+=(lengua=='es'?'hay que introducir texto<br>':'you must introduce some text<br>');
	}
if(f.texto.value.length>2048)
	{
	f.texto.style.borderColor=roj;
	mens+=(lengua=='es'?'el texto admite máximo de 2048 caracteres y tiene '+f.texto.value.length+'<br>':'text 2048 characters maximum and it has '+f.texto.value.length+'<br>');
	}

//quita mayúsculas
if(f.texto.value==f.texto.value.toUpperCase()) f.texto.value=f.texto.value.toLowerCase();


//final
if(mens!="") 
	{
	document.getElementById("mensaje").innerHTML=mens;
	return false;
	} 
	else {return true};
}


function tabre()
{
document.write('<table cellspacing=0><tr><td style="width:10px;height:10px"><img src="img/domt1.gif" width=10 height=10></td><td background="img/domt2.gif"><img src="img/domt2.gif" width=10 height=10></td><td style="width:10px;height:10px"><img src="img/domt3.gif" width=10 height=10></td></tr><tr><td background="img/domt4.gif"><img src="img/domt4.gif"></td><td style="background-color:#f8f8f8">');
}

function tcierra()
{
document.write('</td><td background="img/domt5.gif"><img src="img/domt5.gif"></td></tr><tr><td style="width:10px;height:10px"><img src="img/domt6.gif" width=10 height=10></td><td background="img/domt7.gif"><img src="img/domt7.gif" width=10 height=10></td><td style="width:10px;height:10px"><img src="img/domt8.gif" width=10 height=10></td></tr></table></td></tr></table>');
}

function lanzaLogon()
{
document.lvform.accion.value="logon";
document.lvform.submit();
}

function borrarEntrada(n)
{
if(!confirm("¿está seguro?")) return;
document.listaform.accion.value='borrar';
document.listaform.numero.value=n;
document.listaform.submit();
}

function editarEntrada(n)
{
document.listaform.accion.value='editar';
document.listaform.numero.value=n;
document.listaform.submit();
}

function firmarMensajeInicial()
{
qes='<span style="color:#666666;font-size:9px">el email no se mostrará.<br>esta página, para evitar spam, impide a robots de búsqueda trazar la url enviada.<br>mensajes ofensivos y de spam serán eliminados</span>';
qen='<span style="color:#666666;font-size:9px">email won´t be displayed.<br>this guestbook blocks the crawling of the url submitted to avoid spamming.<br>spam and offending messages will be removed</span>';
if(lenguaje()=='es')
	document.getElementById("mensaje").innerHTML=qes;
else
	document.getElementById("mensaje").innerHTML=qen;
}

function mailea(){location.href="mailto:voet"+"@"+"cra"+'nf.ne'+"t";}

function puteasuplantador(ip)
{
alert('La suplantación de personalidad es delito');
alert('IP '+ip+' almacenada');
alert('(y yo que tú apagaba el ordenador antes de darle a ENTER)');
location.href='http://google.com';
}