$(document).ready(function() {
	
	/*
	 * add class on hover
	 */
	
	$(".bookable").hover(function(){
		$(this).addClass("hovered");
	},
	function(){
		$(this).removeClass("hovered");
	});
	
	/*
	 * show bookingform on click
	 */
	
	$(".bookable").click(function(){
		
		$('head').append('<link rel="stylesheet" href="fileadmin/templates/css/print.css" type="text/css" media="print" />');
		
		$.ajax({
			url: "",
			data: "eID=bookingsystem&booking=" + $(this).attr("id"),
			success: function(html){
				$.blockUI({
					message: html,
					css: { 
						width: '700px',
						height: '500px',
						top:  ($(window).height() - 500) / 2 + 'px', 
				        left: ($(window).width() - 700) / 2 + 'px',
						border: '1px solid #fff',
						backgroundColor: '#CDE1E8',
						cursor: 'default'
					}
				});
				
				$(".blockOverlay, #close_liveblog").click( function(){
					$.unblockUI(); 
				});
			}
		});
	});
});