// JavaScript Document
// JavaScript Document
	var x=0;
	var xx=0;
	var nums;
	var id;
	var id_a_mostrar=1;
	var id_a_borrar=0;
	var tiempos=null;
	var elemento=new Array;
	var cambiar=false;
	var empezar=0;
	
function cambio(tiempo,num)
{
	  tiempos = tiempo.split(",");
	  nums=num;
	  if(num<=1)return;
	  
	  elemento=crearElementos(nums);
	  
	  if(isWindows(elemento[0]))
    {
      	id_a_mostrar = Math.random()*nums-1;
        id_a_mostrar =	parseInt(id_a_mostrar);
      	document.getElementById(elemento[id_a_borrar]).style['display']='none';
        document.getElementById(elemento[id_a_mostrar]).style['display']='block';
        return
    }
    id = setInterval('switchElement(elemento)',tiempos[x] );	
}
function switchElement(elements)
{
    if(empezar!=0)
    {
        id_a_borrar++;
        if(id_a_borrar>=nums){id_a_borrar=0;}
    
        id_a_mostrar++;
        if(id_a_mostrar>=nums){id_a_mostrar=0;}    
        
    }else{
      empezar=1;
    }
    x++;
    if(x>=nums) x=0;
    clearInterval(id);
    bbk(elemento[id_a_borrar]);
    setTimeout("mostrarElement()",2000); 
    id = setInterval('switchElement(elemento)',tiempos[x] );
}
function mostrarElement()
{
  bbk(elemento[id_a_mostrar]);
}
function isWindows(el)
{
	var x = document.getElementById(el);
	if (x.currentStyle)
	{
	   if(parseFloat(navigator.appVersion.substring(22,25))<7)
	   {
           return true;
     }
  }
  return false;
}

function bbk(elemento)
{
    Effect.toggle(elemento,'appear');
}
function getStyle(el,styleProp)
{
	var x = document.getElementById(el);
	if (x.currentStyle)
	{
		var y = x.currentStyle[styleProp];
		//WINDOWS
	}	else if (window.getComputedStyle){
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
		//FIREFOX
		}
	return y;
}
function crearElementos(num)
{
  var i=0;
  for(i=0;i<num;i++)
  {
    elemento[i] = 'mostPro_'+i;
  }
  return elemento;
}
function changeImage(img)
{
  document.imagen.src = img;
  setHeight();
}
function setHeight()
{
  self.scroll(0,0); 
}
function backGroundTrans()
{
  if(isFirefox('contenido'))
  {

        document.getElementById("pie").style['backgroundImage']="url(http://www.elizabethhotel.com/img/shadow/bottom.png)";
        document.getElementById("contenido").style['backgroundImage']="url(http://www.elizabethhotel.com/img/shadow/lateral.png)";      
                document.getElementById("logo_franklyn").style.backgroundImage="url(http://www.elizabethhotel.com/img/logo_franklyn.png)";
  }else
  {
    if(isWindows('contenido'))
    {
        document.getElementById("pie").style['backgroundImage']="url(http://www.elizabethhotel.com/img/shadow/bottom.gif)";
        document.getElementById("contenido").style['backgroundImage']="url(http://www.elizabethhotel.com/img/shadow/lateral.gif)";
        document.getElementById("contenido").style['filter']=null;         
    }else{
        document.getElementById("pie").style['backgroundImage']="url(http://www.elizabethhotel.com/img/shadow/bottom.png)";
        document.getElementById("contenido").style['backgroundImage']="url(http://www.elizabethhotel.com/img/shadow/lateral.png)"; 
    }
  }
}
