function Start_load(){
document.getElementById('loader').style.display = 'none';
document.body.background = 'images/bg_02.jpg';
setTimeout("document.getElementById('int_1').style.display = 'block';",1000);
setTimeout("document.getElementById('int_2').style.display = 'block';",1500);
setTimeout("document.getElementById('int_3').style.display = 'block';",2000);
setTimeout("document.getElementById('int_4').style.display = 'block';",2500);
setTimeout("document.getElementById('int_5').style.display = 'block';",3000);
setTimeout("document.getElementById('menu').style.display = 'block';",4000);
setTimeout("document.getElementById('bg_content').style.display = 'block';",4000);
setTimeout("document.getElementById('div_contenido').style.display = 'block';",4000);
setTimeout("document.getElementById('div_sociales').style.display = 'block';",4000);
setTimeout("fade('logo')",5000);
setTimeout("GoHome();",4000);
}

function GoHome(){
document.getElementById('div_contenido').innerHTML = '<table width="800" align="center" class="tb_contenido"><tr><td><iframe src ="content/home.html" style="background-image:url(../images/black_6.png);" onload="calcHeight()" align="center" width="788" id="if_contenido" name="if_contenido" frameborder="0" scrolling="no" allowtransparency="true"></iframe></td></tr></table>';
}
function GoGal(){
document.getElementById('div_contenido').innerHTML = '<table width="800" align="center" class="tb_contenido"><tr><td><iframe src ="content/galerias.html" style="background-image:url(../images/black_6.png);" onload="calcHeight()" align="center" width="788" id="if_contenido" name="if_contenido" frameborder="0" scrolling="no" allowtransparency="true"></iframe></td></tr></table>';
}
function GoVid(){
document.getElementById('div_contenido').innerHTML = '<table width="800" align="center" class="tb_contenido"><tr><td><iframe src ="content/videos.html" style="background-image:url(../images/black_6.png);" onload="calcHeight()" align="center" width="788" id="if_contenido" name="if_contenido" frameborder="0" scrolling="no" allowtransparency="true"></iframe></td></tr></table>';
}
function GoBios(){
document.getElementById('div_contenido').innerHTML = '<table width="800" align="center" class="tb_contenido"><tr><td><iframe src ="content/bios.html" style="background-image:url(../images/black_6.png);" onload="calcHeight()" align="center" width="788" id="if_contenido" name="if_contenido" frameborder="0" scrolling="no" allowtransparency="true"></iframe></td></tr></table>';
}
function GoCont(){
document.getElementById('div_contenido').innerHTML = '<table width="800" align="center" class="tb_contenido"><tr><td><iframe src ="content/cont.html" style="background-image:url(../images/black_6.png);" onload="calcHeight()" align="center" width="788" id="if_contenido" name="if_contenido" frameborder="0" scrolling="no" allowtransparency="true"></iframe></td></tr></table>';
}
function GoDown(){
document.getElementById('div_contenido').innerHTML = '<table width="800" align="center" class="tb_contenido"><tr><td><iframe src ="downloads/" style="background-image:url(../images/black_6.png);" onload="calcHeight()" align="center" width="788" id="if_contenido" name="if_contenido" frameborder="0" scrolling="no" allowtransparency="true"></iframe></td></tr></table>';
}

function GoFacebook(){
alert('IR A FACEBOOK')
}

function calcHeight()
{
  //find the height of the internal page
  var the_height=document.getElementById('if_contenido').contentWindow.document.body.scrollHeight;

  //alert(the_height)
  //change the height of the iframe
  document.getElementById('if_contenido').height=the_height;
  //document.getElementById('tb_bg_content').height=the_height + 10;
}

var TimeToFade = 1000.0;

function fade(eid)
{  
  var element = document.getElementById(eid);
  if(element == null)
    return;
   
  if(element.FadeState == null)
  {
    if(element.style.opacity == null 
        || element.style.opacity == '' 
        || element.style.opacity == '1')
    {
      element.FadeState = 2;
    }
    else
    {
      element.FadeState = -2;
    }
  }
    
  if(element.FadeState == 1 || element.FadeState == -1)
  {
    element.FadeState = element.FadeState == 1 ? -1 : 1;
    element.FadeTimeLeft = TimeToFade - element.FadeTimeLeft;
  }
  else
  {
    element.FadeState = element.FadeState == 2 ? -1 : 1;
    element.FadeTimeLeft = TimeToFade;
    setTimeout("animateFade(" + new Date().getTime() + ",'" + eid + "')", 33);
  }  
}

function animateFade(lastTick, eid)
{  
  var curTick = new Date().getTime();
  var elapsedTicks = curTick - lastTick;
  
  var element = document.getElementById(eid);
 
  if(element.FadeTimeLeft <= elapsedTicks)
  {
    element.style.opacity = element.FadeState == 1 ? '1' : '0';
    element.style.filter = 'alpha(opacity = ' + (element.FadeState == 1 ? '100' : '0') + ')';
    element.FadeState = element.FadeState == 1 ? 2 : -2;
    return;
  }
  element.FadeTimeLeft -= elapsedTicks;
  var newOpVal = element.FadeTimeLeft/TimeToFade;
  if(element.FadeState == 1)
    newOpVal = 1 - newOpVal;

  element.style.opacity = newOpVal;
  element.style.filter = 'alpha(opacity = ' + (newOpVal*100) + ')';
  
  setTimeout("animateFade(" + curTick + ",'" + eid + "')", 33);
}

