function antispam(usuario,dominio,clase)
{
	document.write("<a class=\"" + clase + "\" href=\"mailto:" + usuario + "@" + dominio + "\">" + usuario + "@" + dominio + "</a>")
}

function googlekey(keyabajo,kayarriba,domabajo,domarriba){
	var documento = self.location.href.match( /\/([^/]+)$/ )[1];
	if (document.location.href == 'http://servidor.'+ domabajo +'/'+ documento)
	{
		document.write("<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key="+ keyabajo +"' type='text/javascript'></script>");
	}
	else
	{
		if (document.location.href == 'http://'+ domarriba +'/'+ documento);
		{
			document.write("<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key="+ kayarriba +"' type='text/javascript'></script>");
		}
	}
}

function opcionmenu(){
	if ((self.location.href == 'http://servidor.restaurantelasolea/') || (self.location.href == 'http://www.restaurantelasolea.com/nueva/') || (self.location.href == 'http://www.restaurantelasolea.com/'))
	{
		var marcado='restaurante';
	}
	else
	{
		var documento = self.location.href.match( /\/([^/]+)$/ )[1];
		marcado = documento.replace(".aspx","");
	}
	if (document.getElementById(marcado)!=null)
	{
		document.getElementById(marcado).className='enlace_on';
		document.getElementById(marcado).onmouseout=function(){}
	}
}

//--------------------------------------------------------------------------------------------
//Función que valida el formulario de entrada

function validarentrada(formulario){

	if ((formulario.usuario.value == "") || (formulario.clave.value == "")){
		alert('The name and the password are required');
		return(false);
	}
	else{
		formulario.firma.value=hex_md5(formulario.clave.value);
		formulario.clave.value="";		
		if (formulario.zona.value=="intranet"){
			formulario.action="http://www.temena.es/cgi-bin/intranet.exe/login";
		}else{
			formulario.action="http://www.temena.es/cgi-bin/extranet.exe/login";
		}
		return(true);
	}
}
