/*#REV:LizardCMS-c24b26b172-1ca854-7261dbfee95b-7c45d27178b4dcfce6f23d01e7cb468f 7 2010-05-04 16:18:37 d2c6bfdabfe224a426e823288575bfff */

LDMain.addEvent(window, 'load', initDesign);
LDMain.addEvent(document, 'mousemove', mouseMove);


var foot1init = 215;
var foot2init = 115;

var feetMoving = false;
var feetTimer = null;
var feetFrame = 0;
var foot1bottom = foot1init;
var foot2bottom = foot2init;
var footFading = false;
var footFadeOut = true;
var footOpacity = 1;
var footCount = 0;
var frameDelay = 150;

var mouseX = 0;
var mouseY = 0;


function mouseMove(e)
{
  if (e == null) {var e = window.event;}
  if (e.pageX == null)
  {
    mouseX = e.clientX + document.body.scrollLeft;
    mouseY = e.clientY + document.body.scrollTop;
  } else
  {
    mouseX = e.pageX;
    mouseY = e.pageY;
  }
}

var flashinstalled = 0;
if (navigator.plugins && navigator.plugins.length)
{
  var x = navigator.plugins["Shockwave Flash"];
  if (x) {flashinstalled = 2;} else {flashinstalled = 1;}
  if (navigator.plugins["Shockwave Flash 2.0"]) {flashinstalled = 2;}
} else
if ((navigator.mimeTypes != null) && (navigator.mimeTypes.length > 0))
{
  var x = navigator.mimeTypes['application/x-shockwave-flash'];
  if (x && x.enabledPlugin) {flashinstalled = 2;} else {flashinstalled = 1;}
}




function initDesign()
{
  if (document.getElementById('secret3') != null) {document.getElementById('secret3').onclick = cornerSecretClick;}
  initFeet();
}

function initFeet()
{
  document.getElementById('foot1').onmouseover = hoverFeet;
  document.getElementById('foot2').onmouseover = hoverFeet;
}


function hoverFeet()
{
  if (feetMoving) {return;}
  feetMoving = true;
  feetFrame = 0;
  footFading = false;
  footFadeOut = true;
  footOpacity = 1;
  feetMoveFrame();
}

function feetMoveFrame()
{
  var oos = false;
  if (feetFrame == 0)
  {
    if (footOpacity > 0)
    {
      footOpacity -= 0.2;
      document.getElementById('foot1').style.opacity = Math.round(footOpacity*100)/100;
      setTimeout('feetMoveFrame();', 25);
    } else
    {
      document.getElementById('foot1').style.display = 'none';
      document.getElementById('foot3').style.display = 'block';
      document.getElementById('foot3').style.right = '0px';
      footOpacity = 1;
      feetFrame++;
      setTimeout('feetMoveFrame();', frameDelay);
    }
  } else
  if ((feetFrame % 2) == 0)
  {
    if (footOpacity > 0)
    {
      footOpacity -= 0.2;
      document.getElementById('foot3').style.opacity = Math.round(footOpacity*100)/100;
      setTimeout('feetMoveFrame();', 25);
    } else
    {
      foot = document.getElementById('foot3');
      foot1bottom += 195;
      foot.style.bottom = foot1bottom+'px';
      foot.style.opacity = 1;
      footOpacity = 1;
      feetFrame++;
      if (foot1bottom > screen.height+1000) {oos = true;} else {setTimeout('feetMoveFrame();', frameDelay);}
    }
  } else
  {
    if (footOpacity > 0)
    {
      footOpacity -= 0.2;
      document.getElementById('foot2').style.opacity = Math.round(footOpacity*100)/100;
      setTimeout('feetMoveFrame();', 25);
    } else
    {
      var foot = document.getElementById('foot2');
      foot2bottom += 195;
      foot.style.bottom = foot2bottom+'px';
      foot.style.opacity = 1;
      footOpacity = 1;
      feetFrame++;
      if (foot2bottom > screen.height+250) {oos = true;} else {setTimeout('feetMoveFrame();', frameDelay);}
    }
  }

  if (oos)
  {
    setTimeout('resetFeet(1);', 10000);
  }
}



function resetFeet(footindex)
{
  if (footindex == 1)
  {
    document.getElementById('foot3').style.display = 'none';
    document.getElementById('foot3').style.bottom = foot1init+'px';
    document.getElementById('foot1').style.display = 'block';
    document.getElementById('foot1').style.opacity = 1;
    foot1bottom = foot1init;
    setTimeout('resetFeet(2);', 250);
  } else
  if (footindex == 2)
  {
    foot2bottom = foot2init;
    document.getElementById('foot2').style.bottom = foot2init+'px';
    setTimeout('resetFeet(3);', 100);
  } else
  {
    feetMoving = false;
    footCount++;
    if (footCount > 10)
    {
      var secret = document.getElementById('secret1');
      if (secret != null)
      {
        secret.style.display = 'block';
        secret.onclick = feetSecretClick;
      }
    }
  }
}

function feetSecretClick()
{
  var c0 = 0; var c1 = 37; var c2 = 18; var c3 = 7;
  eval(unescape('%63%30%20%3D%20%55%53%45%52%49%4E%44%45%58%2A%37%2B%31%33%3B'));
  if (c0 < 1000) {c0 += 987;}
  location.href = INDEXFILE+'?page=secrets&secret=1&code='+c0;
}

function cornerSecretClick()
{
  var c0 = 0; var c1 = 17; var c2 = 123; var c3 = 3;
  eval(unescape('%20%63%32%20%3D%20%63%31%2B%55%53%45%52%49%4E%44%45%58%2A%63%33%2B%38%3B%20%69%66%20%28%63%32%20%3C%20%31%30%30%30%29%20%7B%63%32%20%2B%3D%20%37%38%39%3B%7D'));
  location.href = INDEXFILE+'?page=secrets&secret=3&code='+c2;
}
