function externalLinks() 
{
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) 
	{
		var anchor = anchors[i];
		if (anchor.getAttribute("href") &&
			anchor.getAttribute("rel") == "external")
		anchor.target = "_blank";
	}
}

function index()
{
	 var is_ie6 = ( window.external && typeof window.XMLHttpRequest == "undefined");
      if (is_ie6)
      {
      	document.getElementById('menu').style.paddingLeft = '20px';
      }
}

function selector(idcapa)
{
	
	var x; var y;
	if (document.getElementById) 
	{
		var capa1=document.getElementById(idcapa);
		//alert('X:'+capa1.offsetLeft+',Y:'+capa1.offsetTop);
		x = capa1.offsetLeft;
		y = capa1.offsetTop;
	} 
	else if (document.all) 
	{
		//alert('X:'+document.all.capa1.offsetLeft+',Y:'+document.all.capa1.offsetTop);
		x = document.all.capa1.offsetLeft;
	} 
	else if (document.layers) 
	{
		//alert('X:'+document.layers[idcapa].pageX+',Y:'+document.layers[idcapa].pageY);
		x = document.layers[idcapa].pageX;
	}
	else alert('Su navegador no está soportado.');

	var ht = document.body.clientHeight;

	document.getElementById('selector').style.height = (ht-500)+'px';

	if ((x-15) > 0) 
		document.getElementById('selector').style.left = (x-15)+'px';
	else
		document.getElementById('selector').style.left = (x+3)+'px';

	document.getElementById('selector').style.top = (y-7)+'px';
	
	   
      var is_ie6 = ( window.external && typeof window.XMLHttpRequest == "undefined");
      var display = '';
      if (is_ie6)
      {
      	
      	
      	display = 'none';
      	document.getElementById('menu').style.paddingLeft = '20px';
      	document.getElementById('botonres').style.marginRight = '10px';
      	
      	
      }
      else
      	display = 'block';


	
	document.getElementById('selector').style.display = display;
}

function borra(item)
{
	item.value = '';
}

function ValidaContacto(form)
{
	var msg ='';

	if (form.nombre.value == 'Nombre' || form.nombre.value =='')
	{
		msg += 'Debe introducir un nombre'+"\n";
	}
	if (form.mail.value == 'Correo electrónico' || form.mail.value == '')
		msg += 'Debe introducir su dirección de correo electrónico'+"\n";

	if (form.asunto.value == 'Asunto' || form.asunto.value =='')
		msg += 'Debe escribir algo en el campo asunto';	
	if (msg == '')
		return true;
	else
	{
		alert(msg);
		return false;
	}
}

function ValidaReserva(form)
{
	var msg ='';

	if (form.nombre.value =='')
		msg += 'Debe introducir un nombre'+"\n";
	if (form.tfn.value == '')
		msg += 'Debe introducir un número de teléfono'+"\n";

	if (form.habdoble.value == 0 && form.habind.value == 0 && form.habespecial.value == 0)
		msg += 'Debe seleccionar al menos una habitación';

	if (msg == '')
		return true;
	else
	{
		alert(msg);
		return false;
	}
}
