$(function(){
    $('a.new-window').click(function(){
        window.open(this.href);
        return false;
    });
	
	$('li.headlink').hover(
			function() { $('ul', this).css('display', 'block'); },
			function() { $('ul', this).css('display', 'none'); });
});

this.screenshotPreview = function(){	
	/* CONFIG */
		
		xOffset = 0;
		yOffset = -520;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("a.screenshot").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshot'><img src='"+ this.rel +"' alt='url preview' />"+ c +"</p>");								 
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#screenshot").remove();
    });	
	$("a.screenshot").mousemove(function(e){
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};


// starting the script on page load
$(document).ready(function(){
	screenshotPreview();
});


$(document).ready(function() { 
	$("a#video-link").fancybox({
		'overlayShow': false, 
		'overlayOpacity': .5,
		'frameWidth': 490,
		'frameHeight': 350
	});	
	
	$('#roundtable').innerfade({ speed: 'slow', timeout: 4000, type: 'sequence', containerheight: '88px' }); 
}); 
