function lbClose()
{
	$('#lbOverlay').remove();
	$('#lbImageBox').remove();
	return false;
}

$(window).load(function ()
{
	$("a").each(function ()
	{
		if ($(this).attr("rel") == 'ad')
		{
			$(this).click(function ()
			{
				window.scrollTo(0,0);
				$("div.header").before("<div id='adOverlay'></div><iframe id='adFrame' src='"+$(this).attr("href")+"'></iframe>");
				$("#adOverlay").css({"height":$(document).height()+"px","width":$(document).width()+"px","background-color":"#000","position":"absolute","top":"0px","left":"0px","opacity":0,"z-index":"1000"});
				$("#adFrame").css({"display":"none"});
				$("#adOverlay").animate({opacity:0.9}, 800);
				$("#adFrame").css({"width":$(document).width()*.8+"px", "height":$(window).height()*.8+"px","display":"block","position":"absolute","z-index":"1001","top":"50px","left":($(document).width()-$(document).width()*.8)/2+"px","border":"2px solid #fff"});
				$("#adOverlay").append("<div id='adCloseContainer' style='text-align: center;'><a href='#' id='adClose'>Close Ad</a></div>");
				$("#adCloseContainer").css({"left":$(document).width()/2+"px", "top":($(window).height()*.8+60)+"px","display":"block","position":"absolute","z-index":"1001"});
				$("#adOverlay").click(function ()
				{
					$("#adOverlay").remove();
					$("#adFrame").remove();
				});
				$("#adClose").click(function ()
				{
					$("#adOverlay").remove();
					$("#adFrame").remove();
				});
				return false;
			});
		}
	});
});