// cst010-portada_castefa.js - (c) 2005-2010 Juan Rodríguez, consultor & Begues Internet, s.l.

window.onload=function() {PortadaCastefa()}
// window.onresize=new Function("window.location=window.location.href");
HMenu=-50; var RefHor;

function PortadaCastefa() { 
if (self.innerHeight) {ancPant=self.innerWidth; altPant=self.innerHeight }
else if (document.documentElement && document.documentElement.clientHeight)  {ancPant=document.documentElement.clientWidth; altPant=document.documentElement.clientHeight }
else if (document.body) {ancPant=document.body.clientWidth; altPant=document.body.clientHeight }
if (ancPant < 801) {RefHor= parseInt( (ancPant - 650) / 2 )} else {RefHor= parseInt( (ancPant - 500) / 2 )};
if (ancPant < 801) {RefVer= parseInt( (altPant - 600 ) / 2 )} else {RefVer= parseInt( (altPant - 400 ) / 2 )}; 
SMenu= parseInt (ancPant / 30); ALVer= parseInt(altPant - (altPant * 6/100));        
TraductorGoogle();
DirTec() }

function DirTec() {
document.getElementById("DirTec").style.top=(altPant/20) +"px"; 
if (ancPant < 801) {document.getElementById("DirTec").style.left=(ancPant-500) +"px"} else {document.getElementById("DirTec").style.left=(ancPant/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+10; AltFoto=AltFoto+10; setTimeout("MostrarFotos()",1) } 
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(); 
// TraductorGoogle()
 }

function Menu() {if (HMenu < SMenu) {HMenu+=10; document.getElementById("Menu").style.top=(altPant-300) +"px"; document.getElementById("Menu").style.left=HMenu+"px"; setTimeout("Menu()",1)} else {NumAnt=99 } }

function googleTranslateElementInit() {new google.translate.TranslateElement({pageLanguage: 'es'}, 'google_translate_element');}
function TraductorGoogle(){
var script=document.createElement("script"); script.src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"; script.type="text/javascript"; 
document.getElementsByTagName("head")[0].appendChild(script) }

function VerInfo(num) {if (NumAnt < 98) {OcultarInfo(NumAnt)}; NumAnt=num; MostrarInfo(num) }

function MostrarInfo(num) {
if (num > 29) {dh=RefHor-125; dv=-RefVer+60, ai=300; hi=75} else {dh=175; dv=125; ai=300; hi=75}
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" }

function OcultarInfo(NumAnt) {document.getElementById("Info"+NumAnt).style.height=1+"px"; document.getElementById("Info"+NumAnt).style.display="none"; document.getElementById("Info"+NumAnt).style.visibility="hidden"}
NumAnt=99; 

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"}

tActivo=80;
function tTeclado(tt) {if (tActivo==80) {cBloque(80); aBloque(81); tActivo=81} else {cBloque(81); aBloque(80); tActivo=80} };

// Atajos
tAtaVisible=0; jsAtajos=0;
document.onkeydown=oirTeclado;

function include(ficheroJS) {var jr=document.createElement("script"); jr.type="text/javascript"; jr.src=ficheroJS; document.body.appendChild(jr)};
function preleerTeclado() {if (jsAtajos==1) {leerTeclado()} else {alert("Hola,\n\nLa página no se ha cargado del todo.\n\nCierre esta ventana y complete su atajo.\n\nSi el problema persiste, verifique su conexión a Internet.\n\nGracias.")} }

function oirTeclado(e) {
if (document.getElementById('JRcF') )  {return}
var kC; if (!e) var e=window.event; if (e.keyCode) {kC=e.keyCode} else {if (e.which) {kC=e.which} }; 
if (kC==19) {window.location="cst249-abeja_castefa.html"};
if ((kC==27) && (tAtaVisible==1)) {document.getElementById('Atajos').innerHTML=""; tAtaVisible=0};
if ((kC==219) || (kC==221)) {window.location="230-castefa_como_buscar_en_el_directorio.html"};
if (kC <= 47) {return}; if ((kC >= 91) && (kC <= 95)) {return}; if ((kC >= 106) && (kC <=190)) {return}; if (kC >=193) {return};
if (tAtaVisible==0) {document.getElementById('Atajos').innerHTML=t21; tAtaVisible=1; document.getElementById('dAtajos').style.visibility="visible"; scrollTo(0,0); document.getElementById('cT').focus()};
if (jsAtajos==0) {include("rc/cst018-atajos.js")}; }

t21 ='<div id="dAtajos"><div id="vAtajos">';
t21 +='<h2>Atajos: El camino más corto</h2><p>No es necesario pulsar [Intro]. El sistema busca a medida que Vd. vaya escribiendo. Si sigue viendo esta ventana complete (o revise) el atajo escrito.</p>';
t21 +='<form action="javascript:void(0)" method="post" id="fAtajos"><p style="text-align:center"><input type="text" name="in" size="10" onkeyup="preleerTeclado()"; value="" id="cT" /></p></form>';
t21 +='<p>SUGERENCIAS:</p><p>* Si busca determinado tipo de empresas o profesionales escriba (2 veces) la inicial de la actividad. Por ejemplo: Escriba <b>AA</b> si busca abogados, academias, albañiles,...</p><p>* Si busca una información en concreto, escríbala.<br />Por ejemplo: <b>tiempo</b> para acceder a la información meteorológica.</p><p>* ¿ Necesita ayuda ?, pues escriba <b>ayuda</b>.</p><p>* Pulse <b>Esc</b> en su teclado físico para cerrar esta venta. También puede escribir <i>esc</i>, <i>salir</i>, <i>sortir</i> o <i>exit</i>.</p> ';
t21 +='</div></div>';
