var TamInicial;
tamfoto = 1;

function Cambia(ImgAlt)
{
    if (window.event.srcElement.tagName == "IMG" ) 
    {
        window.event.srcElement.src = ImgAlt;
    }
}

function Glosario()
{
	x=window.open('../Glosario.htm','Glosario','resizable=yes,scrollbars=YES,height=400,width=450,status=NO,toolbar=no,menubar=no,location=no')
}

function Restaura()
{
	if(TamInicial > 0)
	{
		FotoPrincipal.height = TamInicial;
		FotoPrincipal.value = "2";
	}
}

function Amplia()
{
	if (tamfoto == 1) 
	{
		TamInicial = FotoPrincipal.height;
		FotoPrincipal.src = '../FOTOSG/'+numPlanta+'.JPG';
		tamfoto = 0;
	}
	else
	{		
		if ((Cuerpo.clientHeight > FotoPrincipal.clientHeight * 1.2) && (Cuerpo.clientWidth > FotoPrincipal.clientWidth * 1.2))
		{
			FotoPrincipal.height = FotoPrincipal.height * 1.2
		}
		else
		{
			alert("La fotografía ya está al tamaño máximo de la ventana")
		}
	}
}

function Siguiente(num)
{
    var numb  = parseInt(num,10)+1;
    if (numb>522)
        numb=1;
    var number=""+numb;
    while(number.length<3)
        number = "0"+number;
    window.location = number+".htm";
}

function getPage(page)
{
	var dir=page.indexOf("PLANTA");
	var barra = page.indexOf("/",dir-1);
	return page.substr(barra);
	}

if (top.frames.length==0)window.location.href=("http://www.laguiadeplantas.com?"+getPage(document.location.pathname))