//Vars
var LightboxWidth = 650;


//Lets do some coding now
var ScreenHeight=document.documentElement.clientHeight;
if(ScreenHeight==0)
{
	ScreenHeight=document.body.clientHeight;
}
var LightboxHeight = ScreenHeight-100;

document.write('<div id="xi-fader"></div>');
document.write('<div id="xi-lightbox"><table border="0" cellspacing="0" cellpadding="0" align="center" id="xi-lightbox-window"><tr><td>');
document.write('<a href="javascript:CloseLightbox();" style="position:relative; float:left; margin-left:-5px; margin-top:-5px; margin-bottom: -40px; z-index:99;"><img src="js/images/closecircle.png" width="30" height="30" border="0"></a></td></tr><tr><td>');
document.write('<div id="xi-lightbox-frame" style="width:'+LightboxWidth+'px; height:'+LightboxHeight+'px; overflow: hidden;"></div>');
document.write('</td></tr></table></div>');

$(document).ready(function()
{
	
	//Lightbox
	$(".lightbox").click(function () {
		ShowLightbox();
		$("#xi-lightbox-frame").load(this.href);
		return false;
	});
	
	
	
});


function ShowLightbox()
{
	$("#xi-fader").fadeIn(300, function(){				
		$("#xi-lightbox").fadeIn(500);
	});
}

function CloseLightbox()
{
	$("#xi-lightbox").fadeOut(500, function(){
		$("#xi-fader").fadeOut(500);									
	});
}
