this.linkpreview = function(){	
	x = -20;
	y = -50;
	
	$("a.post_preview").hover(function(e){
		this.t = this.title;
		this.title = "";
		this.li_title = "";
		
		if ( ( $(this).parent('li').prop('title') != "" ) && ( $(this).parent('li').prop('title') != undefined ) ) {
			this.li_title = "<h2>"+$(this).parent('li').prop('title')+"</h2>";
		}
		
		if ( this.t != "" ) {
			var c = "<p>" + this.t + "</p>";
			var imgstyle = "style=\"float:left;margin-right:10px;\"";
		}
		else {
			var c = "";
			var imgstyle = "style=\"float:left\"";
		}
		
		$("body").append("<div id=\"post_preview_box\"><div id=\"post_preview_box_container\">"+this.li_title+"<img "+ imgstyle +" src=\""+ this.rel +"\" alt=\"\" />"+c+"</div></div>");
		$("#post_preview_box").css("top",(e.pageY - x) + "px").css("left",(e.pageX + y) + "px").fadeIn("fast");
	},
	function(){
		this.title = this.t;
		$("#post_preview_box").remove();
	});	
	$("a.post_preview").mousemove(function(e){
		$("#post_preview_box").css("top",(e.pageY - x) + "px").css("left",(e.pageX + y) + "px");
	});			
};

$(document).ready(function(){
	linkpreview();
});
