$(document).ready(function(){
	var host=window.location.href.replace(/^([a-z0-9]+:\/\/.*?\/).*/i,'$1');
	$('a').filter(function(){
		return this.href.length>0&&this.href.substring(0,host.length)!=host;
	}).click(function(){
		var $e=$(this).parent();
		var p='';
		while($e.length>0&&$e[0].nodeName!='HTML'){
			p='/'+$e[0].nodeName+($e.attr('class')?'.'+$e.attr('class'):'')+p;
			$e=$e.parent();
		}
		$.post('/goto.json.php',{
			n:document.title.replace(/^(.*?)\|[^\|]+$/i,'$1'),
			f:window.location.href,
			t:this.href,
			p:p
		});
		window.open(this.href);
		return false;
	});
});
