agregarEvento = function(elemento, evento, funcion)
 {
  if(typeof elemento == "string")
	elemento = document.getElementById(elemento);
  if(elemento == null)
	return false;
  if(elemento.addEventListener)
	elemento.addEventListener(evento, funcion, true);
  else if(elemento.attachEvent)
   {
	elemento.attachEvent('on'+evento, funcion);
   }
  else
	elemento["on" + evento] = funcion;
 };
/*
function obtenerPosAbsoluta(el)
 {
  var SL = 0, ST = 0;
  var is_div = /^div$/i.test(el.tagName);
  if (is_div && el.scrollLeft)
    SL = el.scrollLeft;
  if (is_div && el.scrollTop)
    ST = el.scrollTop;
  var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST };
  if (el.offsetParent)
   {
    var tmp = obtenerPosAbsoluta(el.offsetParent);
    r.x += tmp.x;
    r.y += tmp.y;
   }
  return r;
 };

function ubicarFondo()
 {
  r = obtenerPosAbsoluta(document.getElementById("flashcontent3"));
  var celda = document.getElementById("contenedorcelda");
  celda.style.background = 'url(http://192.168.1.118/~pablo/ti7/cabezal) no-repeat center '+(r.y - 200)+'px';
 }
*/

function recFlashEmbed(peliculaNombre)
 {
  if(window.document[peliculaNombre])
	return window.document[peliculaNombre];
  if(document.embeds && document.embeds.namedItem(peliculaNombre))
	return document.embeds.namedItem(peliculaNombre);
  return document.getElementById(peliculaNombre);
 }

function altoVentana()
 {
  if(typeof(window.innerWidth) == 'number')
   {
    //Non-IE
    alto = window.innerHeight;
   }
  else if(document.documentElement && document.documentElement.clientHeight)
   {
    //IE 6+ in 'standards compliant mode'
    alto = document.documentElement.clientHeight;
   }
  else if(document.body && document.body.clientHeight)
   {
    //IE 4 compatible
    alto = document.body.clientHeight;
   }
  return alto;
 }

function altoPelicula()
 {
  var pelicula = recFlashEmbed('pelicula');
  var alto = altoVentana();
  pelicula.height = (alto < 768) ? 768 : alto;
 }

//agregarEvento(window, 'load', ubicarFondo);
agregarEvento(window, 'resize', altoPelicula);
