
	var showingLightBox = 0;
	
	function hideLightBox(){
		showingLightBox = 0;
		
		$('#jquery-lightbox').remove();
		$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });
		$('embed, object, select').css({ 'visibility' : 'visible' });
	}
	
	function loadVideoLightBox(wVideo){
		showingLightBox = 1;
		setupLightBox();
		
		$('#jquery-overlay').fadeIn();
		$('embed, object, select').css({ 'visibility' : 'hidden' });
		
		query = "id=" + wVideo;
		
		$.get("/common_gl/inc_lightbox_video.php", query, function(data){
			$("#jquery-lightbox .lightbox-loading").hide();
			$("#jquery-lightbox .lightbox-content").html(data);
		});
	}
	
	function setupLightBox(){
		$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="jquery-lightbox-back"></div><div class="lightbox-secNav"><a href="#" class="lightbox-secNav-btnClose"></a></div><div class="lightbox-container-image-box"><div class="lightbox-container-image"><div class="lightbox-content"></div><div class="lightbox-loading"><a href="#" class="lightbox-loading-link"></a></div></div></div></div>');
		
		$(".lightbox-container-image-box").css({width: '816px', height: '466px'});
		$(".lightbox-content").css({width: "800px", height: "450px"});
		$(".lightbox-secNav").css({width: "426px"});
		
		var arrPageSizes = ___getPageSize();
		$('#jquery-overlay').css({
				backgroundColor:	"#000",
				opacity:			flashWithOpacity == false ? 1 : 0.8,
				width:				arrPageSizes[0],
				height:				arrPageSizes[1]
			}).fadeIn();
		var arrPageScroll = ___getPageScroll();
		$('#jquery-lightbox').css({
				top:	arrPageScroll[1] + (arrPageSizes[3] / 10),
				left:	arrPageScroll[0]
			}).show();
		$('#jquery-overlay, #jquery-lightbox-back').click(function() {
				hideLightBox();
			});
		$('.lightbox-loading-link,.lightbox-secNav-btnClose').click(function() {
				hideLightBox();
				return false;
			});
		$(window).resize(function() {
				// Get page sizes
				var arrPageSizes = ___getPageSize();
				// Style overlay and show it
				$('#jquery-overlay').css({
					width:		arrPageSizes[0],
					height:		arrPageSizes[1]
				});
				// Get page scroll
				var arrPageScroll = ___getPageScroll();
				// Calculate top and left offset for the jquery-lightbox div object and show it
				$('#jquery-lightbox').css({
					top:	arrPageScroll[1] + (arrPageSizes[3] / 10),
					left:	arrPageScroll[0]
				});
			});
	}
