$(function(){
/*
	$('body').click(function()
	{
		// hide others
		$('.bookOptions').css('display', 'none');
	});
*/

	
	$('.bookLink').click(function(event)
	{
		// hide others
		$('.bookOptions').css('display', 'none');
		
		// show this one
		var theID = $(this).attr('id');
		var newID = theID.replace(/launch_/,'Opt_');
		
		$('#' + newID).css('top', '0'+event.pageY+'px').css('display','inline').css('left', '0'+event.pageX+'px').show(500);
	
	});
	
	$('.bookLink2').click(function(event)
	{
		// hide others
		$('.bookOptions').css('display', 'none');
		
		// show this one
		var theID = $(this).attr('id');
		var newID = theID.replace(/launch_/,'Opt_');
		
		$('#' + newID).css('top', '0'+event.pageY+'px').css('display','inline').css('left', '0'+event.pageX+'px').show('fast');
	
	});
	
	$('.bookOptions').click(function()
	{
		return false;
	});

	
	$('.bookOptions a').click(function()
	{
		window.location = $(this).attr('href');
		return false;
	});


	$('#terms_link').click(function()
	{
		
		$('#terms_popup, #close_terms').css({'display':'block','opacity':'0'});
		$('#terms_popup, #close_terms').animate({opacity:1.0},500);
		
		return false;
	});

	$('#close_terms a').click(function()
	{
		$('#terms_popup, #close_terms').animate({opacity:0},500);
		setTimeout("$('#terms_popup, #close_terms').css({'display':'none','opacity':'0'});",500);		
		
		return false;
	});

	$('#terms_popup, #close_terms').css({'opacity':'0'});
	

	if($.browser.msie && $.browser.version == '6.0'){
		$('#terms_popup, #close_terms').css({'position':'absolute'});
	}
	
});



