this.youtubePreview = 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.ppreview").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='preview' style='text-align:center'><img src='"+ this.rel +"' alt='Image preview' />"+ c +"<br/>"+ $(this).attr('title')+"</p>");								 
		$("#preview")
			.css("top",(e.pageY -430) + "px")
			.css("left",(e.pageX - 500) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });	
	$("a.ppreview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - 430) + "px")
			.css("left",(e.pageX - 500) + "px");
	});

	$(".invisible").click(function(){
		$("#id_location").val($(this).attr('id'));
		$("#com").attr("name","invisible");
		$("#frm").submit();
	});
	$(".visible").click(function(){
		$("#id_location").val($(this).attr('id'));
		$("#com").attr("name","visible");
		$("#frm").submit();
	});
};


// starting the script on page load
$(document).ready(function(){
	youtubePreview();
});
