// cst010-portada_castefa.js - Funciones de JavaScript para la portada de www.castefa.net - Copyright (c) 2005-2009 by Juan Rodríguez [Consultor] & Begues Internet, s.l.

window.onload=function() {PortadaCastefa()}
window.onresize=new Function("window.location=window.location.href");
HMenu= -170;

function PortadaCastefa() { 
if (self.innerHeight) {ancho=self.innerWidth; alto=self.innerHeight }
else if (document.documentElement && document.documentElement.clientHeight)  {ancho=document.documentElement.clientWidth; alto=document.documentElement.clientHeight }
else if (document.body) {ancho=document.body.clientWidth; alto=document.body.clientHeight }
if (ancho < 801) {RefHor= parseInt( (ancho - 650) / 2 )} else {RefHor= parseInt( (ancho - 500) / 2 )};
if (ancho < 801) {RefVer= parseInt( (alto - 600 ) / 2 )} else {RefVer= parseInt( (alto - 400 ) / 2 )}; 
SMenu= parseInt (ancho / 30); ALVer= parseInt(alto - (alto * 6/100));        
DirTec() }

function DirTec() {
document.getElementById("DirTec").style.top=(alto/20) +"px"; 
if (ancho < 801) {document.getElementById("DirTec").style.left=(ancho-500) +"px"} else {document.getElementById("DirTec").style.left=(ancho/2) +"px"}; 
document.getElementById("DirTec").style.visibility="visible"; Fotos() } 

function Fotos() {
document.getElementById("F1").style.left=RefHor+"px"; document.getElementById("F1").style.top=RefVer+"px"; document.getElementById("F1").style.visibility="visible";
document.getElementById("F2").style.left=(RefHor+150)+"px"; document.getElementById("F2").style.top=(RefVer+100)+"px"; document.getElementById("F2").style.visibility="visible";
document.getElementById("F3").style.left=(RefHor+300)+"px"; document.getElementById("F3").style.top=(RefVer+200)+"px"; document.getElementById("F3").style.visibility="visible";
document.getElementById("F4").style.left=(RefHor+450)+"px"; document.getElementById("F4").style.top=(RefVer+300)+"px"; document.getElementById("F4").style.visibility="visible";
document.getElementById("F5").style.left=(RefHor+175)+"px"; document.getElementById("F5").style.top=(RefVer+236)+"px"; document.getElementById("F5").style.visibility="visible";
document.getElementById("F6").style.left=(RefHor+500)+"px"; document.getElementById("F6").style.top=(RefVer+200)+"px"; document.getElementById("F6").style.visibility="visible";
AncFoto=10; AltFoto=10; MostrarFotos() }

function MostrarFotos() {
if (AncFoto < 193) {
document.getElementById("F1").style.height=AltFoto +"px"; document.getElementById("F1").style.width=AncFoto +"px"; 
document.getElementById("F2").style.height=AltFoto +"px"; document.getElementById("F2").style.width=AncFoto +"px"; 
document.getElementById("F3").style.height=AltFoto +"px"; document.getElementById("F3").style.width=AncFoto +"px"; 
document.getElementById("F4").style.height=AltFoto +"px"; document.getElementById("F4").style.width=AncFoto +"px"; 
document.getElementById("F5").style.height=AncFoto +"px"; document.getElementById("F5").style.width=AltFoto +"px"; 
document.getElementById("F6").style.height=AltFoto +"px"; document.getElementById("F6").style.width=AncFoto +"px";
AncFoto=AncFoto+3; AltFoto=AltFoto+3; setTimeout("MostrarFotos()",5) } 
else AvisoLegal() }

function AvisoLegal() {
document.getElementById("AvisoLegal").style.top=ALVer+"px"; document.getElementById("AvisoLegal").style.left=RefHor+50 +"px"; document.getElementById("AvisoLegal").style.visibility="visible";
Menu() }

function Menu() {if (HMenu < SMenu) {HMenu+=10; document.getElementById("Menu").style.top=(alto-300) +"px"; document.getElementById("Menu").style.left=HMenu+"px"; setTimeout("Menu()",1)} else {NumAnt=99 } }

function VerInfo(num) {
if (num < 20) {document.getElementById("M"+num).style.zIndex=10};
if (NumAnt < 98) {OcultarInfo(NumAnt)};
NumAnt=num; i=num;
if (AbriendoVentana==0) {MostrarInfo(num)} else return }

function MostrarInfo(num) {
AbriendoVentana=1;
// if (num > 29) {dh=(ancho/2)-SMenu, dv=-RefVer+25, ai=434; hi=75} else {dh=175; dv=175, ai=300; hi=90}
if (num > 29) {dh=(ancho/7), dv=-RefVer+60, ai=300; hi=75} else {dh=175; dv=90; ai=300; hi=90}
if (AncInfo < ai) {
document.getElementById("Info"+num).style.left=(SMenu+dh)+"px"; 
document.getElementById("Info"+num).style.top=(RefVer+dv)+"px";
document.getElementById("Info"+num).style.width=AncInfo + "px";
document.getElementById("Info"+num).style.display="inline";
document.getElementById("Info"+num).style.height=hi +"px";
document.getElementById("Info"+num).style.visibility="visible"
AncInfo=AncInfo+10; setTimeout("MostrarInfo(i)",5) } else {AbriendoVentana=0; AncInfo=10} }

function OcultarInfo(NumAnt) {
if (NumAnt < 20) {document.getElementById("M"+NumAnt).style.zIndex=1};
document.getElementById("Info"+NumAnt).style.height=1+"px";
document.getElementById("Info"+NumAnt).style.display="none";
document.getElementById("Info"+NumAnt).style.visibility="hidden"}

NumAnt=99; AbriendoVentana=0; AncInfo=10;

function aBloque(num) {document.getElementById("Bloque"+num).style.height="auto"; document.getElementById("Bloque"+num).style.display="block"; document.getElementById("Bloque"+num).style.visibility="visible"}
function cBloque(num) {document.getElementById("Bloque"+num).style.height=1+"px"; document.getElementById("Bloque"+num).style.visibility="hidden"; document.getElementById("Bloque"+num).style.display="none"}