//
// http://kawika.org/jquery/linklook/
//
jQuery.fn.linklook = function (opt) {

	$("a", this).each( function() {
		$(this).hover(
			function() {
				var loaded = false;
			
				jQuery("<img>")
					.hide()
					.addClass("linklook")
					.insertAfter(this)
					.attr( { src:
//					    "http://www.websitethumbnails.net/view.php?url=" + jQuery(this).attr("href").replace("/http:\/\//", "" ) } )
					    "http://open.thumbshots.org/image.pxf?url=" + jQuery(this).attr("href") } )
					.bind( "load", function(){ 
						if (!loaded) {
							loaded = true;
							jQuery(this).fadeIn(50); 
						}
					})
					.css({ 
						position: "absolute", 
						top: jQuery(this).offsetTop() + "px", 
						left: jQuery(this).offsetRight() + 40 + "px" 
						});
			},
			function() { 
				$(this).next().filter("img").fadeOut(600, function() { $(this).remove(); });
			}
		);
	});
}

jQuery.fn.offsetRight = function() {

	var e = $(this)[0];
	var curleft = 0;
	var width = e.offsetWidth;
	if ( e.offsetParent )
		while (1) {
			curleft += e.offsetLeft;
			if( !e.offsetParent )
				break;
			e = e.offsetParent;
		}
	else if (e.x)
		curleft += e.x;
	return curleft + width
}

/**
by Peter-Paul Koch & Alex Tingle
*/
jQuery.fn.offsetLeft = function() {

	var e = $(this)[0];
	var curleft = 0;
	var width = e.offsetWidth;
	if ( e.offsetParent )
		while (1) {
			curleft += e.offsetLeft;
			if( !e.offsetParent )
				break;
			e = e.offsetParent;
		}
	else if (e.x)
		curleft += e.x;
	return curleft + width + 40;;
}

jQuery.fn.offsetTop = function() {

	var e = $(this)[0];
	var curtop = 0;
	if ( e.offsetParent )
		while (1) {
			curtop += e.offsetTop;
			if ( !e.offsetParent )
				break;
			e = e.offsetParent;
		}
	else if ( e.y )
		curtop += e.y;
	return curtop;
}
