// jrc020-portada.js - Copyright (C) 2008-2011 by Juan Rodríguez, consultor & Begues Internet, s.l.

function Resize() {window.location.reload()}
window.onresize=Resize;

DerVer=-335; IzqHor=-150; Salto=1;
AnchoCentral=300;

function Portada() { 
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 }
RefHor=parseInt((ancho -0) / 2);
RefVer=parseInt((alto -400) / 2);
StopIzq=RefHor-(AnchoCentral/2)-175-25; 
StopDer=RefVer;
if (alto <600) {SepPie=50} else SepPie=50;
CuerpoCentral() } 

function CuerpoCentral() {
document.getElementById("Tarjeta").style.left=RefHor-(AnchoCentral/2)+"px"; 
document.getElementById("Tarjeta").style.top=RefVer+"px";
document.getElementById("Derecha").style.left=RefHor+(AnchoCentral/2)+25+"px";
document.getElementById("Izquierda").style.top=RefVer+"px";
MoverLaterales()}

function MoverLaterales() {
if (IzqHor < (StopIzq-11)) {Salto=10} else Salto=1;
if (IzqHor < StopIzq) {IzqHor+=Salto; document.getElementById("Izquierda").style.left=IzqHor+"px"}; 

if (DerVer < (StopDer-11)) {Salto=10} else Salto=1;
if (DerVer < StopDer) {DerVer+=Salto; document.getElementById("Derecha").style.top=DerVer+"px"};

if ((IzqHor == StopIzq) && (DerVer == StopDer)) {VerPie()} 
else {
// posder = document.getElementById("Derecha").style.left; 
// alert("RefHor: "+RefHor+" StopIzq: "+StopIzq+" IzqHor: "+IzqHor+" RefVer: "+RefVer+" DerVer: "+DerVer+" posder:" +posder);
setTimeout("MoverLaterales()",10)} }

function VerPie() {
document.getElementById("Pie").style.left=RefHor-325+"px"; 
document.getElementById("Pie").style.top=(alto-SepPie)+"px";
document.getElementById("Pie").style.visibility="visible"}

// SACAR TEXTOS ONMOUSEOVER
OpcAnt=-1;

function VerOpc(num) {
if (OpcAnt == num) {return};
document.getElementById("Tarjeta").style.visibility="hidden";

if (OpcAnt >= 0) {
document.getElementById("opc"+OpcAnt).style.visibility="hidden" }
document.getElementById("LogoDer").style.left=RefHor+(AnchoCentral/2)+"px"; 
document.getElementById("LogoDer").style.top=RefVer+5+"px"; 
document.getElementById("LogoDer").style.visibility="visible";
OpcAct=num; OpcAnt=OpcAct; 
document.getElementById("opc"+OpcAct).style.left=RefHor-(AnchoCentral/2)+"px"; 
document.getElementById("opc"+OpcAct).style.top=RefVer+"px"; 
document.getElementById("opc"+OpcAct).style.visibility="visible";
document.getElementById("Derecha").style.textAlign="right"; 
document.getElementById("Izquierda").style.textAlign="left";
color=45; CamCol=5; MostrarTexto() }

function MostrarTexto() {
if (color < 210) {
color=color+CamCol; 
document.getElementById("opc"+OpcAct).style.color="rgb("+color+","+color+","+color+")"; 
setTimeout("MostrarTexto()",100)} }  

function OcultarOpcion(OpcAct) {
document.getElementById("LogoDer").style.visibility="hidden";
document.getElementById("opc"+OpcAct).style.visibility="hidden";
document.getElementById("Tarjeta").style.visibility="visible";
document.getElementById("Derecha").style.textAlign="left"; document.getElementById("Izquierda").style.textAlign="right"; OpcAnt=-1 }


