/* Newsifer.com jQuery Magic */

this.imagePreview = function(){	

	xOffset = 10;
	yOffset = 30;

	$("a.nicepreview").hover(function(e) {
		this.t = this.title;
		this.title = "";	
		var imgsrc = $(this).find("img").attr("src");
		var imgalt = $(this).find("img").attr("alt");
		var newimg = (imgalt == "" || imgalt == undefined) ? imgsrc : imgalt;
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='imgPreview'><img src='"+ newimg +"' alt='Image preview' />"+ c +"</p>");								 
		$("#imgPreview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function() {
		this.title = this.t;
		$("#imgPreview").remove();
    });	
	$("a.nicepreview").mousemove(function(e){
		$("#imgPreview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};


$(document).ready(function(){
	imagePreview();
	$("a[rel^='prettyPhoto']").prettyPhoto();
});

