// JavaScript Document

function lightBox() {
	WindowHeight = (window.innerHeight) ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight;
	OffWidth = document.documentElement.scrollWidth;
	OffHeight = document.documentElement.scrollHeight;
	if ( OffHeight < WindowHeight ) { OffHeight = WindowHeight; 	}
	
	var spinBox = document.createElement('div');
	spinBox.style.backgroundColor = "#000000";
	spinBox.id = "ThumbnailScroll_Box";
	spinBox.style.width = OffWidth + "px";
	spinBox.style.height = OffHeight + "px";
	spinBox.style.position = "absolute";
	spinBox.style.zIndex = 50;
	spinBox.style.left = spinBox.style.top = 0 + "px";
	if ( navigator.appName.indexOf("Explorer") != -1 ) {
		spinBox.style.filter="Alpha(opacity=20)";
	} else {
		spinBox.style.opacity=0.2;
	}
	document.documentElement.getElementsByTagName("body")[0].appendChild(spinBox);
	
	var spinIframe = document.createElement('iframe');
	spinIframe.id = "ThumbnailScroll_Iframe";
	spinIframe.style.width = OffWidth + "px";
	spinIframe.style.height = OffHeight + "px";
	spinIframe.style.position = "absolute";
	spinIframe.style.zIndex = 49;
	spinIframe.style.left = spinIframe.style.top = 0 + "px";
	if ( navigator.appName.indexOf("Explorer") != -1 ) {
		spinIframe.style.filter="Alpha(opacity=0)";
	} else {
		spinIframe.style.opacity=0;
	}
	document.documentElement.getElementsByTagName("body")[0].appendChild(spinIframe);
	
}

function lightBoxclose() {
	document.documentElement.getElementsByTagName("body")[0].removeChild(document.getElementById("ThumbnailScroll_Box"));
	document.documentElement.getElementsByTagName("body")[0].removeChild(document.getElementById("ThumbnailScroll_Iframe"));
}

function LayerPopupClose(obj) {
	var objName = document.getElementById(obj);
	objName.style.display = "none";
	lightBoxclose();
}

function LayerPopupMousePoint(e,obj,addX,addY) {
	var objName = document.getElementById(obj);
	if ( objName.style.display == "block" ) {
	} else {
		lightBox();
		objName.style.display = "block";
	}
}
