/**
 * Initialization handlers
 */
window.onload = function() {
	setLightBoxHeight();
}

function setLightBoxHeight()
{
	if (!document.getElementById('lightbox_bg')) return;

	var ua = navigator.userAgent.toLowerCase(),
		isOpera = (ua.indexOf('opera')  > -1),
		isIE = (!isOpera && ua.indexOf('msie') > -1);

	document.getElementById('lightbox_bg').style.height = getDocumentHeight() + 'px';

	function getDocumentHeight() {
		return Math.max(document.compatMode != 'CSS1Compat' ? document.body.scrollHeight : document.documentElement.scrollHeight, getViewportHeight());
	}

	function getViewportHeight() {
		return ((document.compatMode || isIE) && !isOpera) ? (document.compatMode == 'CSS1Compat') ? document.documentElement.clientHeight : document.body.clientHeight : (document.parentWindow || document.defaultView).innerHeight;
	}
}
