
function ConfirmDelete(){
if (confirm("Are you sure you want to delete this item?\nThis action can not be undone.\n\nAre you sure you want to continue?")==true)
return true;
else
return false;
}

function ConfirmPurge(){
if (confirm("Are you sure you want to purge expired date ranges?\nThis action can not be undone.\n\nAre you sure you want to continue?")==true)
return true;
else
return false;
}

function ConfirmRecalculatePrice(){
if (confirm("Are you sure you want to reset prices?\n\nThis action will recalculate ALL prices based on\nthe price entered in the 'Base price/night' textbox.\n\nAre you sure you want to continue?")==true)
return true;
else
return false;
}

function ConfirmBookingDelete(){
if (confirm("Are you sure you want to delete this booking?\n\nWARNING!\n\nThis action is irreversible and will also remove all additional \ninformation such as monies paid by the customer.\n\nAre you sure you want to continue?")==true)
return true;
else
return false;
}

function ConfirmCustomerDelete(){
if (confirm("Are you sure you want to delete this customer?\n\nWARNING!\n\nThis action is irreversible and will also remove all additional information\nsuch as bookings and monies paid by the customer.\n\nAre you sure you want to continue?")==true)
return true;
else
return false;
}

function ConfirmPriceBlockDelete(){
if (confirm("Are you sure you want to delete this price block?\n\nWARNING!\n\nThis action can not be undone!\nAll unsaved changes to other price blocks will be lost.\n\nAre you sure you want to continue?")==true)
return true;
else
return false;
}

function ConfirmNotificationSend(){
if (confirm("Are you sure you want to send this notification?")==true)
return true;
else
return false;
}

function Calculator(ct1,ct2,ct3)
{
	var num = ct1.value.replace(",",".");
	if (! isNaN(num))
	{
		ct2.value = (7*num).toFixed(2).replace(".",",");
		ct3.value = (30*num).toFixed(2).replace(".",",");
	}
}

function Calculatorb(ct2,ct3)
{
	var num = ct2.value.replace(",",".");
	if (! isNaN(num))
	{
		ct3.value = ((30*num)/7).toFixed(2).replace(".",",");
	}
}


var key = false;

function Calendar(day, month, year, a1, a2, a3, d1, d2, d3)
{
	if (key == false)
	{
		a1.selectedIndex = day-1;
		a2.selectedIndex = month-1;
		for (i=0; i < a3.options.length; i++)
		{  
			if (a3.options[i].value == year)
			{
				a3.selectedIndex = i;
			}
		}
		key = true;
	}
	else
	{
		d1.selectedIndex = day;
		d2.selectedIndex = month;
		for (i=0; i < d3.options.length; i++)
		{  
			if (d3.options[i].value == year)
			{
				d3.selectedIndex = i;
			}
		}
	}
	return false;
}

function ClearCalendar()
{
	key = false;
	return false;
}