﻿/*
  Lightbox for images 
  (c) 2008-2009 xul.fr
  GPL license

	Modified for Browse-gifts section purposes CE - 112509

*/  


// height of current view for all browsers but IE

function viewHeight() 
{
    if(window.innerHeight)return(window.innerHeight);
    if(document.documentElement && document.documentElement.clientHeight) 
         return(document.documentElement.clientHeight);
    if(document.body) return(document.body.clientHeight); 
    return 50;
}


function openbox(card)
{
	var box = document.getElementById(card); 
  var filter =  document.getElementById('filter');	
	document.getElementById('filter').style.display='block';
	
  if(navigator.appName.substring(0, 3) == "Mic")  // for IE
  {
    box.style.display='block';
    x = document.documentElement.scrollTop + document.body.scrollTop + 
    box.offsetHeight / 8;
    box.style.top = x + "px";
    filter.style.top = document.documentElement.scrollTop + document.body.scrollTop;
  }
  else
  {
    box.style.display='block';
    var top =  (viewHeight() - box.offsetHeight ) / 2;    
    box.style.top = top + 'px';
    box.style.position='fixed'; // fixed does not work on IE
    filter.style.position='fixed'; 
  }

}


function closebox(card)
{
	document.getElementById(card).style.display='none';
	document.getElementById('filter').style.display='none';
}	


/* sorry for that one */
function realign() 
{
}
