// JavaScript Document

var ticket_open = false;

var parking_y = -90;

$(document).ready(
	function()
	{
	    html_init();
    }
);

function html_init() {
	$('div.ticket a.open').mouseover(function() {
	    if (!ticket_open) {
	        $('div.ticket').css('right','-295px');
		}
	}).mouseout(function() {
	    if (!ticket_open) {
	        $('div.ticket').css('right','-310px');
		}
	}).click(function() {
	    if (!ticket_open) {
	        ticket_open = true;
	        $('div.ticket').animate(
		    	{right:0},
		        1000 * 0.5,
		        null,
		    	function() {}
		    );
		} else {
		    $('div.ticket').animate(
		    	{right:-310 + 'px'},
		        1000 * 0.5,
		        null,
		    	function() { ticket_open = false; }
		    );
		}

		return false;
	});

	$('div.parking').css('bottom',parking_y + 'px');
	$('div.parking a').click(function() {
		var btm = parseInt($('div.parking').css('bottom'));
		var new_y = parking_y;
		if (btm < 0) {
			new_y = 0;
		}

		$('div.parking').animate(
	    	{bottom:new_y + 'px'},
	        1000 * 0.5,
	        null,
	    	function() { }
	    );
		return false;
	});
}
