$(document).ready(function() {
	
	/* Navigation */

	$('a.sub-nav-link').hover(function(event) {
		var offset = 45;
		var a = $(this);
		var c = a.attr('class').split(' ');
		if (c[1]=='destinace') offset = 70;
		a.qtip({
				overwrite: false, // Make sure we only render one tooltip
				content: {
					text: a.next('div.sub-nav') // Use the submenu as the qTip content
				},
				position: {
					my: 'top right',
					at: 'bottom left',
					viewport: false,
					container: $('#nav'),
					adjust: {
					   method: 'shift',
					   x: offset
					}
				},
				show: {
					event: event.type,
					ready: true
				},
				hide: {
				   fixed: true, // Make sure we can interact with the qTip by setting it as fixed
				   delay: 100
				},
				style: {
					tip: {
						 corner: true,
						 mimic: 'center',
						 offset: offset,
						 width: 15,
						 height: 10
					},
					classes: 'ui-tooltip-nav'
				}
		});
	}, function(){});
	
	$('a.sub-nav-link').click(function() {
		return false;
	});
	
	if (typeof($.datepicker)!='undefined') {
		$( "#AO3_StepOne2_departure_0, #AO3_StepOne2_departure_1").datepicker();
	}

});


function showTip(event, a) {

};

