this.imagePreview = function(){	
		
		xOffset = 200;
		yOffset = 30;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	$("img.ex").hover(function(e){
		this.t = this.alt;
		this.title = "";	
		var sourc = this.src;
		var sourc_array=sourc.split("experience/");
		var new_source = sourc_array[0] + "experience/large/" + sourc_array[1];
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='preview'><img src='"+ new_source +"' 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();
    });	
	$("img.ex").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

$(document).ready(function(){
	$('#pics').cycle({ 
    fx:     'fade', 
    speed:   800, 
    timeout: 7000, 
    pause:   1,
    next: '#pics',
    before: onBefore,
    after: onAfter
});
	imagePreview();

});

function onBefore() { 
	$('#caption').fadeOut('fast');
    $('#caption').html(""); 
} 

function onAfter() { 
    $('#caption').html(this.alt);
    $('#caption').fadeIn('slow');
}