// JavaScript Document

var sBaseHref = document.getElementsByTagName("base")[0].getAttribute("href");

function changeDate(url)
{
	if (url)
	{
		window.location.href = sBaseHref+url;
	}
}

function booking(url, target)
{
	if (target == undefined)
	{
		target = 'self';
	}

	if (target == 'blank')
	{
		window.open(url, '_blank');
	}
	else
	{
		window.location.href = url;
	}
}

document.observe('dom:loaded', function() {
	if ($('booking_button') != undefined && $('dateselector') != undefined)
	{
		$('dateselector').observe('change', function() {
			$('booking_button').disable();
		});
	}
});