jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", ( $(window).height() - this.outerHeight() ) / 2+$(window).scrollTop() + "px");
    this.css("left", ( $(window).width() - this.outerWidth() ) / 2+$(window).scrollLeft() + "px");
    return this;
}




////
// Document Ready
//
$(document).ready(function() {
	
	
	//hide abstracts and add styles for popup
	$('.abstract').hide().addClass('snazz').append('<div class="close">Close</div>');
	$('.paperno').attr('title', 'Click to view the abstract for this session');
	$('.seepaper span').attr('title', 'Click to view the abstract for this session');
	
	
	
	
	
	
	
	$('.paperno').click(function()
	{
		$('div.abstract.up').hide().removeClass('up')
		$(this).parent().children('.abstract').stop(true, true).center().slideToggle(200).toggleClass('up');
	});
	
	$('.seepaper span').click(function()
	{
		$('div.abstract.up').hide().removeClass('up')
		$(this).parent().parent().children('.abstract').stop(true, true).center().slideToggle(200).toggleClass('up');
	});
	
	
	$('.abstract.snazz .close').click(function()
	{
		$(this).parent().stop(true, true).slideToggle(200);
	});
});
