 var nuevo_alto;
   var nuevo_ancho;
   var aux_alto;
   var current_x;
   var current_y;
   var incremento_x;
   var incremento_y;
   var progresion_x;
   var progresion_y;
   var cont_x;
   var cont_y;
function casa()
{
   if(document.getElementById('photoholder0'))document.getElementById('photoholder0').style.background='#000000';
   if(document.getElementById('photoholder1'))document.getElementById('photoholder1').style.background='#000000';
   if(document.getElementById('photoholder2'))document.getElementById('photoholder2').style.background='#000000';
   if(document.getElementById('photoholder3'))document.getElementById('photoholder3').style.background='#000000';
   if(document.getElementById('photoholder4'))document.getElementById('photoholder4').style.background='#000000';
   if(document.getElementById('photoholder5'))document.getElementById('photoholder5').style.background='#000000';
   if(document.getElementById('photoholder6'))document.getElementById('photoholder6').style.background='#000000';
   if(document.getElementById('photoholder7'))document.getElementById('photoholder7').style.background='#000000';
   if(document.getElementById('photoholder8'))document.getElementById('photoholder8').style.background='#000000';


}
var w;
var v;
var ancho_x;
var alto_y;

function cerrar()
{

   w = parseInt(ancho_x)/40;
   u = parseInt(alto_y)/40;
   progresion_x = parseInt(w);
   incremento_x = 0;
   incremento_y = 0;
   progresion_y = parseInt(u);
  document.getElementById('iframe_lap').style.display = 'none';
   document.getElementById('iframe_lap').style.width = 0;
   document.getElementById('iframe_lap').style.height=0;
 // document.iframe_lap.location.replace('./loading_grande.jpg');

  }

   function fixPNG2(myImage) // correctly handle PNG transparency in Win IE 5.5 or higher.
   {
    if (window.ie55up)
	 {
	 var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	 var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	 var imgTitle = (myImage.title) ? "title='" + myImage.title + "' " : "title='" + myImage.alt + "' "
	 var imgStyle = "display:inline-block;" + myImage.style.cssText
	 var strNewHTML = "<span " + imgID + imgClass + imgTitle
	 strNewHTML += " style=\"" + "width:" + myImage.width + "px; height:" + myImage.height + "px;" + imgStyle + ";"
	 strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
	 strNewHTML += "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	 myImage.outerHTML = strNewHTML
	 }
   }
   fixPNG2("izq.png");
function mueve(id,ancho,alto,imagen)
{
    document.getElementById('iframe_lap').style.display = '';
   incremento_x = 0;
   incremento_y  = 0;
   nuevo_ancho = parseInt(ancho/300);
   nuevo_alto = parseInt(alto/300);
   aux_alto =0;
   j = nuevo_ancho;
   var j;
   iframe_lap.location.replace('foto2a.php?lang=es&id='+id+'&fichero='+imagen);
   progresion_x = parseInt((ancho + 80)/40);

   progresion_y = parseInt((alto+90)/40);
   count_x = 0;
   count_y = 0;
   incremento_x = 0;
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",10);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",10);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",10);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",10);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",20);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",20);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",20);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",20);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",30);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",30);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",30);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",30);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",40);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",40);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",40);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",40);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",50);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",50);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",50);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",50);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",60);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",60);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",60);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",60);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",70);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",70);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",70);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",70);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",80);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",80);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",80);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",80);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",90);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",90);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",90);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",90);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",100);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",100);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",100);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",100);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",110);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",110);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",110);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",110);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",120);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",120);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",120);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",120);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",130);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",130);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",130);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",130);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",140);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",140);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",140);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",140);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",150);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",150);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",150);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",150);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",160);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",160);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",160);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",160);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",170);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",170);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",170);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",170);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",180);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",180);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",180);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",180);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",190);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",190);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",190);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",190);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",200);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",200);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",200);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",200);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",210);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",210);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",210);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",210);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",220);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",220);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",220);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",220);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",230);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",230);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",230);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",230);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",240);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",240);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",240);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",240);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",250);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",250);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",250);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",250);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",260);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",260);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",260);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",260);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",270);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",270);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",270);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",270);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",280);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",280);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",280);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",280);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",290);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",290);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",290);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",290);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",300);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",300);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",300);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",300);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",310);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",310);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",310);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",310);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",320);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",320);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",320);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",320);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",330);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",330);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",330);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",330);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",340);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",340);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",340);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",340);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",350);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",350);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",350);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",350);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",360);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",360);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",360);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",360);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",370);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",370);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",370);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",370);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",380);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",380);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",380);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",380);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",390);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",390);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",390);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",390);
setTimeout("incremento_x = parseInt(progresion_x) + parseInt(incremento_x);",400);
setTimeout("incremento_y = progresion_y + parseInt(incremento_y);",400);
setTimeout("document.getElementById('iframe_lap').style.width = parseInt(incremento_x);",400);
setTimeout("document.getElementById('iframe_lap').style.height= parseInt(incremento_y);",400);

}



document.write("<style type='text/css'>#thephoto0 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto1 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto2 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto3 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto4 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto5 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto6 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto7 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#thephoto8 {visibility:hidden;}</style>");


function initImage()
{
var imageId0 = 'header-hotel';
var imageId1 = 'header-habitaciones';
var imageId2 = 'header-zona';
var imageId3 = 'header-gallery';
var imageId4 = 'header-precios';
var imageId5 = 'header-galeria';
var imageId6 = 'header-reservas';
var imageId7 = 'flash-header';
var imageId8 = 'thephoto8';

if(document.getElementById(imageId0)){  var image0 = document.getElementById(imageId0);}
if(document.getElementById(imageId1)){  var image1 = document.getElementById(imageId1);}
if(document.getElementById(imageId2)){  var image2 = document.getElementById(imageId2);}
if(document.getElementById(imageId3)){	var image3 = document.getElementById(imageId3);}
if(document.getElementById(imageId4)){	var image4 = document.getElementById(imageId4);}
if(document.getElementById(imageId5)){	var image5 = document.getElementById(imageId5);}
if(document.getElementById(imageId6)){	var image6 = document.getElementById(imageId6);}
if(document.getElementById(imageId7)){	var image7 = document.getElementById(imageId7);}
if(document.getElementById(imageId8)){	var image8 = document.getElementById(imageId8);}


if(document.getElementById(imageId0)){  setOpacity(image0, 0);image0.style.visibility = "visible";fadeIn(imageId0,0);}
if(document.getElementById(imageId1)){  setOpacity(image1, 0);image1.style.visibility = "visible";fadeIn(imageId1,0);}
if(document.getElementById(imageId2)){	setOpacity(image2, 0);image2.style.visibility = "visible";fadeIn(imageId2,0);}
if(document.getElementById(imageId3)){	setOpacity(image3, 0);image3.style.visibility = "visible";fadeIn(imageId3,0);}
if(document.getElementById(imageId4)){	setOpacity(image4, 0);image4.style.visibility = "visible";fadeIn(imageId4,0);}
if(document.getElementById(imageId5)){	setOpacity(image5, 0);image5.style.visibility = "visible";fadeIn(imageId5,0);}
if(document.getElementById(imageId6)){	setOpacity(image6, 0);image6.style.visibility = "visible";fadeIn(imageId6,0);}
if(document.getElementById(imageId7)){	setOpacity(image7, 0);image7.style.visibility = "visible";fadeIn(imageId7,0);}
if(document.getElementById(imageId8)){	setOpacity(image8, 0);image8.style.visibility = "visible";fadeIn(imageId8,0);}



}
function fadeIn(objId,opacity) {
	if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity <= 100) {
			setOpacity(obj, opacity);
			opacity += 10;
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
		}
		window.setTimeout("casa()", 100);
	}
}
function setOpacity(obj, opacity)
{
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}
function cambiar_x()
{
  if(document.getElementById('categ').value!=0)
  {
         document.location.replace('/galeria.php?lang=es&categoria='+document.getElementById('categ').value);
   }

}
window.onload = function() {initImage()}


