/*
 * Image preview script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
 
this.imagePreview = function(){	
	/* CONFIG */
		
		xOffset = 10;
		yOffset = 30;
		//$("a.preview, img.preview").thumbsuserp();
			//$("a.preview img, img.preview").thumbsImguser();
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("a.preview").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='preview'><img src='"+ this.href +"' alt='Image 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();
    });	
	$("a.preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
			
	});			
};


// starting the script on page load
$(document).ready(function(){
	imagePreview();
});




this.imagescreenshort = function(){	
	/* CONFIG */
		
		xOffset = 10;
		yOffset = 30;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("a.screenshort").hover(function(e){
		this.t = this.title;
		this.title = "";
		var url="http://www.artviper.net/screenshots/screener.php?url="+this.href;
		var slashPos = (this.href).indexOf('/');
		if (slashPos >= 0) {
		 url=url.substring(0, url.length-1);
		}
		
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshort'><img src='"+ url +"' alt='Image screenshort' />"+ c +"</p>");								          
		$("#screenshort")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#screenshort").remove();
    });	
	$("a.screenshort").mousemove(function(e){
		$("#screenshort")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
			
	});			
};


// starting the script on page load
$(document).ready(function(){
	imagescreenshort();
	
});

this.imagescreenshortuser = function(){	
	/* CONFIG */
		
		xOffset = 10;
		yOffset = 30;
	//	$("a.screenshortuser, img.screenshortuser").thumbsuser();
		//	$("a.screenshortuser img, img.screenshortuser").thumbsImguser();
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */

	$("a.screenshortuser").hover(function(e){
		this.t = this.title;
		this.title = "";
		//alert(this.href);
		var url= this.href.split("^")[1];
		//alert(url);
				
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshortuser'><img src='"+ url +"' alt='Image screenshort' />"+ c +"</p>");								          
		$("#screenshortuser")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#screenshortuser").remove();
    });	
	$("a.screenshortuser").mousemove(function(e){
		$("#screenshortuser")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
			
	});	
	
	$("a.screenshortuser").click(function(e){
		$("#screenshortuser")
			this.href= this.href.split("^")[0];
			
			window.location.href=this.href;
	});	
};


// starting the script on page load
$(document).ready(function(){
	imagescreenshortuser();
	
});