// Make the flash animation appear on all pages

add_load_event(showflash);

function showflash ()
{
  var div1 = document.createElement('DIV');
  var div2 = document.createElement('DIV');
  
  var x,y;
  if (self.innerHeight) // all except Explorer
  {
  	x = self.innerWidth;
  	y = self.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight)
  	// Explorer 6 Strict Mode
  {
  	x = document.documentElement.clientWidth;
  	y = document.documentElement.clientHeight;
  }
  else if (document.body) // other Explorers
  {
  	x = document.body.clientWidth;
  	y = document.body.clientHeight;
  }
  
  div2.innerHTML = '<object width="480" height="320"><param name="movie" value="zeldr.swf"><embed src="zeldr.swf" width="480" height="320"></embed></object>';
  
  div1.style.width = x + 'px';
  div1.style.height = y + 'px';
  div1.style.backgroundColor = '#F6FF6B';
  div1.style.position = 'fixed';
  div1.style.top = 0;
  div1.style.left = 0;
  
  div2.style.position = 'absolute';
  div2.style.top = (y/2 - 160) + 'px';
  div2.style.left = (x/2 - 240) + 'px';
  
  div1.appendChild(div2);
  
  var body = document.getElementsByTagName('BODY')[0];
  
  body.appendChild(div1);
  
  var hide = function (e) { body.removeChild(div1); e.preventDefault(); };
  
  var link = document.createElement('A');
  
  link.href = '#';
  
  link.appendChild(document.createTextNode('Enter'));
  
  link.style.position = 'absolute';
  link.style.bottom = '-2em';
  link.style.right = '0';
  link.style.backgroundColor = 'white';
  link.style.padding = '0.5em 1.5em';
  
  div2.appendChild(link);
  
  add_event(link, 'click', hide);
  
  add_event(document, 'click', hide);
}
