
$(document).ready(function()
{
	if ($.browser.msie && $.browser.version > 6 && $.browser.version < 9)
	{
		$(".thumbs .thumb").click(function()
		{
			window.open($(this).css("background-image").replace(/-thumb/gi, "").replace(/"/gi, "").replace(/url\(/gi, "").replace(/\)/gi, ""), "", ($(this).hasClass("tall") ? "width=386,height=570" : "width=570,height=386,") +  'scrollbars=0,resizable=0,menubar=0,location=0,titlebar=0,status=0,toolbar=0');
		});
		
		// fix css size bugs
		$(".thumb.tall").css({"height": "200px", "width": "133px"});
	}
	else
	{
		// create overlay
		$(".thumbs .thumb").hover(function()
		{
			// get rid of old overlay(s)
			$(this).parent().find(".overlay").remove();
			
			// output new overlay
			$(this).before("<div class=\"overlay" + ($(this).hasClass("tall") ? " tall" : "") + "\" style=\"background-image: " + $(this).css("background-image").replace(/-thumb/gi, "").replace(/"/gi, "'") + ";display:none;\"></div>");
			
			// fade in and remove on mouse out
			$(this).parent().find(".overlay").fadeIn(500).mouseleave(function()
			{
				$(this).fadeOut(250, function()
				{
					$(this).remove();
				});			
			});
		});
	};
});
