this.imgPreview = function(){	
	/* CONFIG */
		
		xOffset = 50;
		yOffset = 30;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("div.thumb a").live({
        mouseenter:
           function(e)
           {
				/*this.t = this.title;
				this.title = "";*/
				var h = $(this).parent().parent().parent().find('a.view').attr('href');
				$(this).attr('href',h);
				
				/*var t = $(this).parent().parent().parent().find('a[class^=view]').html();*/
				var t = "";
				var name = $(this).parent().parent().parent().find('ul.object > li.name > a').html();
				var mark = $(this).parent().parent().parent().find('ul.object > li.mark > a').html();
				var collection = $(this).parent().parent().parent().find('ul.object > li.collection > a').html();
				var model = $(this).parent().parent().parent().find('ul.object > li.model > a').html();
				
				t = name;
				
				if(mark != undefined) t += " " + mark;
				if(collection != undefined) t += " " + collection;
				if(model != undefined) t += " " + model;
				var i = $(this).attr('value');

				//var c = (this.t != "") ? "<br/>" + this.t : "";
				//$("#shot").remove();
				$("body").append("<div id='shot'><img  src='"+ i +"' alt='" + t + "' /><p>"+ t +"</p></div>");		
				$("#shot")
					.css("top",(e.pageY - xOffset) + "px")
					.css("left",(e.pageX + yOffset) + "px")
					.fadeIn("fast");
           },
        mouseleave:
           function()
           {
				$('#shot').remove();
           }
       }
    );

	
	/*live('hover', function(e){
		/*this.t = this.title;
		this.title = "";*/
		/*var h = $(this).parent().parent().parent().find('a.view').attr('href');
		$(this).attr('href',h);
		
		/*var t = $(this).parent().parent().parent().find('a[class^=view]').html();*/
		/*var t = "";
		var name = $(this).parent().parent().parent().find('ul.object > li.name > a').html();
		var mark = $(this).parent().parent().parent().find('ul.object > li.mark > a').html();
		var collection = $(this).parent().parent().parent().find('ul.object > li.collection > a').html();
		var model = $(this).parent().parent().parent().find('ul.object > li.model > a').html();
		
		t = name;
		
		if(mark != undefined) t += " " + mark;
		if(collection != undefined) t += " " + collection;
		if(model != undefined) t += " " + model;
		var i = $(this).attr('value');

		//var c = (this.t != "") ? "<br/>" + this.t : "";
		//$("#shot").remove();
		$("body").append("<div id='shot'><img  src='"+ i +"' alt='" + t + "' /><p>"+ t +"</p></div>");		
		$("#shot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		//this.title = this.t;	
		$(this).remove();
    });	*/
	$("a.shot").live('mousemove', function(e){
		$("#shot")
			.css("top",(e.pageY + xOffset) + "px")
			.css("left",(e.pageX - yOffset) + "px");
	});			
};


// starting the script on page load
$(document).ready(function(){
	imgPreview();
});
