<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Untitled Document</title>
<script type="text/javascript" src="jquery-1.3.2.js"></script>
</head>
<script type="text/javascript">
<!--
function show_text(event, text) {
if ($('#text').length) return false;
$('body').prepend('<div id="text" style="width:300px;height:50px;border:solid 1px #f00;"><span>' + text + '</span></div>');
event.stopPropagation();
$(document).click(function(e){
var target = $(e.target);
if (target.is('#text') || target.parents('#text').length) return;
$(document).unbind('click', arguments.callee);
$('div#text').remove();
});
}
//-->
</script>
<body>
<p><a href="/images/img.jpg" target="_blank" onclick="show_text(event, 'some text');return false;">click</a></p>
</body>
</html>