this.psHover = function(){	
	$(".imghover").hover(
	function(e){
		var hover = $(this).attr("src");
		var src = $(this).attr("hover");
		$(this).attr("src",src);
		$(this).attr("hover",hover);
    },
	function(){
		var id = this.id;
		var hover = $(this).attr("src");
		var src = $(this).attr("hover");
		$(this).attr("src",src);
		$(this).attr("hover",hover);
    });	
};

$(document).ready(function(){
	psHover();
});


this.psTooltip = function(){	
		
		xOffset = 10;
		yOffset = 20;		
	
	$(".tooltip").hover(function(e){											  
		var title = $(this).attr('title');
		this.t = title;
		var heading = $(this).attr('heading');
		if(heading){
			$("body").append("<p id='tooltip'><b>"+ heading +"</b><br>"+ title +"</p>");
		}else{
			$("body").append("<p id='tooltip'>"+ title +"</p>");	
		}
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$(".tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};




$(document).ready(function(){
	psTooltip();
});

this.psPreview = function(){	
	
		xOffset = 10;
		yOffset = 30;
		
	$(".preview").hover(function(e){
		this.t = $(this).attr("title");
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='preview'><img src='"+ $(this).attr("rel") +"' alt='url preview' />"+ c +"</p>");								 
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });	
	$(".preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};


$(document).ready(function(){
	psPreview();
});