﻿var lightBox = {
	
	block:$('lightBox'),
	content:$('lightBoxContent'),
	height:Math.max(document.documentElement.clientHeight,Math.max(window.innerHeight || 0,document.documentElement.scrollHeight)),
	width:document.body.clientWidth,
	
	show: function() {
		if(this.block != null && this.content != null) {
			this.block.show();	
			this.content.show();
			this.content.style.top = (this.height - this.content.offsetHeight) /2 + 'px';
		}
	},
	
	hide: function() {
		if(this.block != null && this.content != null) {
			this.block.hide();	
			this.content.hide();
		}
	},
	
	findPos: function(obj) {
        var curleft = curtop = 0;
        if (obj.offsetParent) {
	        curleft = obj.offsetLeft
	        curtop = obj.offsetTop
	        while (obj = obj.offsetParent) {
		        curleft += obj.offsetLeft
		        curtop += obj.offsetTop
	        }
        }
        return [curleft,curtop];
    }
}