// JavaScript Document

var anchoPagina = window.screen.width;

function openPhoenix()
{
		var w = window.open("http://www.grupo-phoenix.com", "ingwin", "width="+screen.availWidth+", height="+screen.availHeight+", screenX=0,screenY=0, top=0, left=0, status=yes , resizable=yes, scrollbars=yes" );
		w.focus();
}

function cambiarMouseOverMenu(opcion, imagen, texto, comentario)
{
	var nopcion = document.getElementById(opcion);
	nopcion.style.width = 'auto';
	nopcion.style.height = '71px';
	nopcion.style.backgroundImage = 'url(imagenes/'+imagen+')';
	
	var ntexto = document.getElementById(texto);
	ntexto.style.color = '#478F8F';
	if(BrowserDetect.OS == 'Linux')
		ntexto.style.fontFamily = 'URW Chancery L';
	else
		ntexto.style.fontFamily = 'Times New Roman';					
	ntexto.style.fontsize = '24pt';
	ntexto.style.position = 'relative';
	ntexto.style.top = '17px';
	ntexto.style.left = '7px';
	ntexto.style.cursor = 'pointer';                
	
	var comment = document.getElementById('preComentario');
	comment.src = 'imagenes/'+comentario;
}

function cambiarMouseOutMenu(opcion, imagen, texto)
{
	var nopcion = document.getElementById(opcion);
	nopcion.style.width = 'auto';
	nopcion.style.height = '71px';
	nopcion.style.backgroundImage = 'url(imagenes/'+imagen+')';
	
	var ntexto = document.getElementById(texto);
	ntexto.style.color = '#DFFFFF';
	if(BrowserDetect.OS == 'Linux')
		ntexto.style.fontFamily = 'URW Chancery L';
	else
		ntexto.style.fontFamily = 'Times New Roman';					
	ntexto.style.fontsize = '24pt';
	ntexto.style.position = 'relative';
	ntexto.style.top = '17px';
	ntexto.style.left = '7px';
	ntexto.style.cursor = 'pointer';                
}

function actualizarPanelCentral(idClick)
{
	document.getElementById("textobienvenida").style.display = 'none';
	document.getElementById("textoquienessomos").style.display = 'none';
	document.getElementById("textocontactenos").style.display = 'none';
	document.getElementById("textocreditos").style.display = 'none';
	document.getElementById("textosalones").style.display = 'none';
	document.getElementById("textoubicacion").style.display = 'none';
	document.getElementById("textoservicios").style.display = 'none';
	document.getElementById("textogaleria").style.display = 'none';
	document.getElementById("textohabitaciones").style.display = 'none';
	
	document.getElementById("textobienvenida").setAttribute('activo','0');
	document.getElementById("textoquienessomos").setAttribute('activo','0');
	document.getElementById("textocontactenos").setAttribute('activo','0');
	document.getElementById("textocreditos").setAttribute('activo','0');
	document.getElementById("textosalones").setAttribute('activo','0');
	document.getElementById("textoubicacion").setAttribute('activo','0');
	document.getElementById("textoservicios").setAttribute('activo','0');
	document.getElementById("textogaleria").setAttribute('activo','0');
	document.getElementById("textohabitaciones").setAttribute('activo','0');
	
	var npanel = document.getElementById(idClick);
	var nick = npanel.getAttribute('nick');
	
	var migaja = document.getElementById('textoMigaja');
	while(migaja.hasChildNodes())
	{
		migaja.removeChild(migaja.firstChild);
	}
	var ntexto = document.createTextNode(nick);
	migaja.appendChild(ntexto);
	
	npanel.setAttribute('activo','1');
	npanel.style.display = 'block';
}

function mostrarTarifas()
{
	var tmp0 = document.getElementById("pisos");
	tmp0.style.display = 'none';
	var tmp = document.getElementById("tarifas");
	tmp.style.display = 'block';				
}

function actualizarPiso(idnodo, numhabs, numhabd, numhabt)
{
	var tmp = document.getElementById("tarifas");
	tmp.style.display = 'none';
	var id = idnodo.getAttribute("id");
	var idactual = idnodo.getAttribute('actual');
	var nodoActual = document.getElementById(idactual);
	nodoActual.setAttribute('activo','0'); 
	nodoActual.className = 'deshabilitado';
	nodoActual.setAttribute('actual',id);
	
	idnodo.setAttribute('activo','1');
	idnodo.className = 'habilitado';
	
	var nodo1 = document.getElementById('piso1');
	nodo1.setAttribute('actual',id);
	var nodo2 = document.getElementById('piso2');
	nodo2.setAttribute('actual',id);
	var nodo3 = document.getElementById('piso3');
	nodo3.setAttribute('actual',id);
	var nodo4 = document.getElementById('piso4');
	nodo4.setAttribute('actual',id);
	var nodo5 = document.getElementById('piso5');
	nodo5.setAttribute('actual',id);
	
	var recuadro = document.getElementById('flotante');
	
	if(id=='piso1' || id=='piso2' || id=='piso3' || id=='piso4')
	{
		var contenedorpisos = document.getElementById('pisos');
		contenedorpisos.style.display = 'block';
		
		var contenedorfiesta = document.getElementById('fiesta');
		contenedorfiesta.style.display = 'none';
		
		var numhab1 = document.getElementById('numhabitacionessencillas');
		while(numhab1.hasChildNodes())
		{
			numhab1.removeChild(numhab1.firstChild);
		}
		var numhab2 = document.getElementById('numhabitacionesdobles');
		while(numhab2.hasChildNodes())
		{
			numhab2.removeChild(numhab2.firstChild);
		}
		var numhab3 = document.getElementById('numhabitacionestriples');
		while(numhab3.hasChildNodes())
		{
			numhab3.removeChild(numhab3.firstChild);
		}
		var nuevo1 = document.createTextNode(numhabs); 
		var nuevo2 = document.createTextNode(numhabd);
		var nuevo3 = document.createTextNode(numhabt);
		numhab1.appendChild(nuevo1);
		numhab2.appendChild(nuevo2);
		numhab3.appendChild(nuevo3);										
	}else{
		var contenedorpisos = document.getElementById('pisos');
		contenedorpisos.style.display = 'none';
		
		var contenedorfiesta = document.getElementById('fiesta');
		contenedorfiesta.style.display = 'block';
	}
	
	if(id == "piso5")
	{
		recuadro.style.marginTop = "6px";                    
	}
	if(id == "piso4")
	{
		recuadro.style.marginTop = "44px";
	}
	if(id == "piso3")
	{
		recuadro.style.marginTop = "81px";
	}
	if(id == "piso2")
	{
		recuadro.style.marginTop = "118px";
	}
	if(id == "piso1")
	{
		recuadro.style.marginTop = "156px";
	}
}

function cambiarMouseOverHab(imgHabitacion)
{   
	var comment = document.getElementById('preHabitacion');
	comment.src = 'imagenes/'+imgHabitacion;
	Spry.Effect.DoGrow('fadeMeHab', {duration:1000, from:"0%", to:"100%", toggle: false});
}