/* Z stylez */
function changeheight(){
	if (window.innerHeight && window.scrollMaxY) {
		var yWithScroll = window.innerHeight + window.scrollMaxY;
		//alert("firefox");
		var lightBoxOverlayHeight = yWithScroll;
	} else {
		var yWithScroll = document.body.scrollHeight;
		var yHeight = document.body.clientHeight;
		//alert("ie7+ie6"+ yWithScroll + "dfgdfg " + yHeight);
		var lightBoxOverlayHeight = yWithScroll + yHeight;
	} /*else {
		var yWithScroll = document.body.offsetHeight;
		alert("ie6");
	}*/

	e = document.getElementById("lightBoxOverlay");
	e.style.height = lightBoxOverlayHeight + 'px';
}

var lightBoxIsVisible = 0;

function setSwfIsActive(value){
    if(window.flashGal) window.document["flashGal"].SetVariable("swfIsActive", value);
    if(document.flashGal) document.flashGal.SetVariable("swfIsActive", value);
}

function showLB(containerId){
    setSwfIsActive('false');
    lightBoxIsVisible = 1;
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
	obj.innerHTML = "";
	changeheight();
}
/*
function showLB(containerId){
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
	changeheight();
}
*/
function showLBContent(containerId){
	showLB('lightBoxOverlay');
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
	
}

var largeImage;

function showLBImage(containerId, largeImage){
    setSwfIsActive('false');
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
	document.getElementById("lightBoxImage").src = largeImage;
	var whatsTheWidth = document.getElementById("lightImage").offsetWidth;
	var findLeftMargin = whatsTheWidth/2;
	document.getElementById("lightImage").style.marginLeft = "-" + findLeftMargin + "px";
	showLB('lightBoxOverlay');
}

function hideLB(containerId){
	obj2 = MM_findObj(containerId)
	if (!obj2) return;
	obj2.style.display = 'none';
}
function hideAll(){
	hideLB('lightImage');
	hideLB('lightFlash');
	hideLB('lightContent');
	hideLB('lightBoxOverlay');
	amIToPlay('lightFlash', "stop");
	setSwfIsActive('true');
}