function showLoginForm() {
	if (/WebKit/.test(navigator.userAgent) || /Gecko/.test(navigator.userAgent)) {
		$(document.body).append([
			"<div style='position: fixed; top: 0; left: 0; right: 0; bottom: 0; opacity: 0; background: rgba(0, 0, 0, 0.8); z-index: 40000;' id='swp-login'>",
			"<iframe src='about:blank' id='swp-login-container' style='opacity: 0; position: fixed; width: 100%; height: 100%; border: 0; top: 0; left: 0; right: 0; bottom: 0; background: transparent;'>",
			"</iframe>",
			"</div>"
		].join(""));
		$("#swp-login").animate({opacity:1});
		$("#swp-login-container").load(function() {
			$("#swp-login-container").animate({ opacity: 1 });
		}).attr('src', '/admin/index.php?popover=1');
		return false;
	}
}

window.swp_login = function() {
	$("#swp-login").animate({ opacity: 0 }, function() { $(this).remove(); });
	$.get("/inc/eyeball-login.php?ajax=1", function(result) {
		$(document.body).append(result);
	});
}

$(function() {
	$("a[rel=x-swp-login]").click(showLoginForm);
});

if (/run-page-editor/.test(location.href)) {
	document.write("<style type='text/css'>#eyeball { display: none !important; top: -10000px; left: -10000px; }</style>");
}


