﻿
  function DefinirFrameDescripcion(elementId, estil) {
  	frames[elementId].document.write('<body style="' + estil +'">'+document.getElementById(elementId).innerHTML+'</body>');
  }

  function mostrarHabitacion(hab) {
	var node = document.getElementById(hab);
	node.style.display='block';
	var p;
	for (p = node.parentNode.firstChild; p != null; p = p.nextSibling) {
		if (p.getAttribute('id') != hab) p.style.display='none';
	}
	document.getElementById("txtHabitacion").innerHTML = document.getElementById('txt' + hab).innerHTML;
	document.getElementById("txtOcupHabitacion").innerHTML = document.getElementById('txtoc' + hab).innerHTML;
	document.getElementById('menuhab').style.display='none';
  }

        function selectMiniatura(obj, ratio) {
          with (document.getElementById("FOTO")) {
               setAttribute("src", obj.firstChild.getAttribute("name"));
               if (ratio < 0.825) {
                  removeAttribute("width");
                  setAttribute("height", "218");
               } else {
                  removeAttribute("height");
                  setAttribute("width", "180");
               }
          }  
        }

function ocultarFakePopups() {
		 elems=document.getElementsByTagName('div');
		 for(i=0; i < elems.length; i++)
				if (elems[i].className=='fakePopup') elems[i].style.display='none';
}

function mostrarFakePopup(name, vLeft, vTop, vWidth, vHeight) {
	ocultarFakePopups();
	with (document.getElementById(name)) {
		with (style) {
			display='block';
			left = vLeft;
			top = vTop;
			width = vWidth;
			height = vHeight;
		}
		/* barra del titol: amb l'estil pujem barra de titol */
		/* mida interior ample: +4px  (degut al border) */
		with (firstChild) {
			style.width= (vWidth+4)+'px';
			/* imatge */
			lastChild.firstChild.style.left= (vWidth-11)+'px';
		}
	}
}
