ticked = 0;
animationLock = false;

function fiatLux(thisImage)
{
 if(!animationLock)
 {
	animationLock = true;
	imageHolder = new Image();
	document.getElementById("lightBoxRoot").style.visibility = "hidden";
	document.getElementById("lightBoxRoot").style.opacity = 0;
	document.getElementById("lightBoxRoot").style.filter = "alpha(opacity=0)";	
	document.getElementsByTagName("body")[0].appendChild(document.getElementById("blackDrop"));
	document.getElementsByTagName("body")[0].appendChild(document.getElementById("lightBoxRoot"));
	imageHolder.src = thisImage;
	windowWidth = document.getElementsByTagName("body")[0].offsetWidth;
	windowHeight = (window.innerHeight) ? window.innerHeight : document.documentElement.clientHeight;
	scrolledBy = (document.body.scrollTop)?document.body.scrollTop: document.documentElement.scrollTop;
	displayLightBox();
 }
}

function displayLightBox()
{
	if(imageHolder.complete)
	{
		document.getElementById("lightBoxHolder").style.width = imageHolder.width + "px";
		document.getElementById("lightBoxHolder").style.height = imageHolder.height + "px";
		document.getElementById("lightBoxHolder").style.backgroundImage = "url("+imageHolder.src+")";
		document.getElementById("lightBoxRoot").style.width = imageHolder.width + 20 + "px";
		document.getElementById("lightBoxRoot").style.height = imageHolder.height + 20 + "px";
		document.getElementById("lightBoxRoot").style.left = (windowWidth/2)-(imageHolder.width/2) + "px";
		document.getElementById("blackDrop").style.display = "block";
		document.getElementById("blackDrop").style.height = document.body.scrollHeight+"px";
		document.getElementById("lightBoxRoot").style.top = 40+scrolledBy+"px";
		document.getElementById("lightBoxRoot").style.visibility = "visible";
		document.getElementById("lightBoxRoot").style.filter = "alpha(opacity=100)";
		document.getElementById("lightBoxRoot").style.opacity = "1";
		animationLock = false;
	}
	else window.setTimeout("displayLightBox();",250);
}
function closeLightbox()
{
	if(!animationLock)
	{
		document.getElementById("lightBoxRoot").style.visibility = "hidden";
		document.getElementById("lightBoxRoot").style.opacity = 0;
		document.getElementById("lightBoxRoot").style.filter = "alpha(opacity=0)";
		document.getElementById("blackDrop").style.display = "none";
	}
}

function FnGetLink(mylink)
{
	window.location=mylink;
}


