// JScript source code

function DisplayLocationTab(x)
{
	myDivFromDublinAirport = document.getElementById("FromDublinAirport")
	myDivFromM50 = document.getElementById("FromM50")
	myDivFromDublinPort = document.getElementById("FromDublinPort")
	myDivFromCityCentreByBus = document.getElementById("FromCityCentreByBus")
	myDivTravellingByBusFromAirport = document.getElementById("TravellingByBusFromAirport")
	
	switch (x) 
	{
		case "1":
			myDivFromDublinAirport.style.display = 'block';
			myDivFromM50.style.display = 'none';
			myDivFromDublinPort.style.display = 'none';
			myDivFromCityCentreByBus.style.display = 'none';
			myDivTravellingByBusFromAirport.style.display = 'none';	
			break;
		case "2":
			myDivFromDublinAirport.style.display = 'none';
			myDivFromM50.style.display = 'block';
			myDivFromDublinPort.style.display = 'none';
			myDivFromCityCentreByBus.style.display = 'none';
			myDivTravellingByBusFromAirport.style.display = 'none';	
			break;
		case "3":
			myDivFromDublinAirport.style.display = 'none';
			myDivFromM50.style.display = 'none';
			myDivFromDublinPort.style.display = 'block';
			myDivFromCityCentreByBus.style.display = 'none';
			myDivTravellingByBusFromAirport.style.display = 'none';	
			break;
		case "4":
			myDivFromDublinAirport.style.display = 'none';
			myDivFromM50.style.display = 'none';
			myDivFromDublinPort.style.display = 'none';
			myDivFromCityCentreByBus.style.display = 'block';
			myDivTravellingByBusFromAirport.style.display = 'none';	
			break;
		case "5":
			myDivFromDublinAirport.style.display = 'none';
			myDivFromM50.style.display = 'none';
			myDivFromDublinPort.style.display = 'none';
			myDivFromCityCentreByBus.style.display = 'none';
			myDivTravellingByBusFromAirport.style.display = 'block';	
			break;
	}
}

function DisplayMenuTab(x)
{
	myDivMenuA = document.getElementById("MenuA")
	myDivMenuB = document.getElementById("MenuB")
	myDivMenuC = document.getElementById("MenuC")
	myDivMenuPrices = document.getElementById("MenuPrices")
	myDivMenuPic = document.getElementById("MenuPic")
	
	switch (x) 
	{
		case "1":
			myDivMenuA.style.display = 'block';
			myDivMenuB.style.display = 'none';
			myDivMenuC.style.display = 'none';
			myDivMenuPrices.style.display = 'none';
			myDivMenuPic.innerHTML = "<img src='images/FullIrishBreakfast.jpg' alt='' width='200' height='133' class='thumbborder'>";
			break;
		case "2":
			myDivMenuA.style.display = 'none';
			myDivMenuB.style.display = 'block';
			myDivMenuC.style.display = 'none';
			myDivMenuPrices.style.display = 'none';
			myDivMenuPic.innerHTML = "<img src='images/ContinentalBreakfast.jpg' alt='' width='200' height='200' class='thumbborder'>";
			break;
		case "3":
			myDivMenuA.style.display = 'none';
			myDivMenuB.style.display = 'none';
			myDivMenuC.style.display = 'block';
			myDivMenuPrices.style.display = 'none';
			myDivMenuPic.innerHTML = "<img src='images/VegetarianBreakfast.jpg' alt='' width='200' height='133' class='thumbborder'>";
			break;
		case "4":
			myDivMenuA.style.display = 'none';
			myDivMenuB.style.display = 'none';
			myDivMenuC.style.display = 'none';
			myDivMenuPrices.style.display = 'block';
			myDivMenuPic.innerHTML = "<img src='images/DiningRoom.jpg' alt='' width='200' height='150' class='thumbborder'>";
			break;
	}
}

function DisplayRoomsTab(x)
{
	myDivFamilyRoom = document.getElementById("FamilyRoom")
	myDivTripleRoom = document.getElementById("TripleRoom")
	myDivTwinRoom = document.getElementById("TwinRoom")
	myDivDoubleRoom = document.getElementById("DoubleRoom")
	myDivSingleRoom = document.getElementById("SingleRoom")
	myDivRoomPrices = document.getElementById("RoomPrices")
	myDivBedPic = document.getElementById("BedPic")
	
	switch (x) 
	{
		case "1":
			myDivFamilyRoom.style.display = 'block';
			myDivTripleRoom.style.display = 'none';
			myDivTwinRoom.style.display = 'none';
			myDivDoubleRoom.style.display = 'none';
			myDivSingleRoom.style.display = 'none';
			myDivRoomPrices.style.display = 'none';
			myDivBedPic.innerHTML = "<img src='images/FamilyRoom.gif' alt='' width='239' height='175' class='thumbborder'>";
			break;
		case "2":
			myDivFamilyRoom.style.display = 'none';
			myDivTripleRoom.style.display = 'block';
			myDivTwinRoom.style.display = 'none';
			myDivDoubleRoom.style.display = 'none';
			myDivSingleRoom.style.display = 'none';
			myDivRoomPrices.style.display = 'none';
			myDivBedPic.innerHTML = "<img src='images/TripleRoom.jpg' alt='' width='239' height='175' class='thumbborder'>";
			break;
		case "3":
			myDivFamilyRoom.style.display = 'none';
			myDivTripleRoom.style.display = 'none';
			myDivTwinRoom.style.display = 'block';
			myDivDoubleRoom.style.display = 'none';
			myDivSingleRoom.style.display = 'none';
			myDivRoomPrices.style.display = 'none';
			myDivBedPic.innerHTML = "<img src='images/TwinRoom.jpg' alt='' width='239' height='175' class='thumbborder'>";
			break;
		case "4":
			myDivFamilyRoom.style.display = 'none';
			myDivTripleRoom.style.display = 'none';
			myDivTwinRoom.style.display = 'none';
			myDivDoubleRoom.style.display = 'block';
			myDivSingleRoom.style.display = 'none';
			myDivRoomPrices.style.display = 'none';
			myDivBedPic.innerHTML = "<img src='images/DoubleRoom.gif' alt='' width='239' height='175' class='thumbborder'>";
			break;
		case "5":
			myDivFamilyRoom.style.display = 'none';
			myDivTripleRoom.style.display = 'none';
			myDivTwinRoom.style.display = 'none';
			myDivDoubleRoom.style.display = 'none';
			myDivSingleRoom.style.display = 'block';
			myDivRoomPrices.style.display = 'none';
			myDivBedPic.innerHTML = "<img src='images/StandardRoom.jpg' alt='' width='239' height='175' class='thumbborder'>";
			break;	
		case "6":
			myDivFamilyRoom.style.display = 'none';
			myDivTripleRoom.style.display = 'none';
			myDivTwinRoom.style.display = 'none';
			myDivDoubleRoom.style.display = 'none';
			myDivSingleRoom.style.display = 'none';
			myDivRoomPrices.style.display = 'block';
			break;
	}
}

function DisplayAttTab(x)
{
	myDivAttIntroduction = document.getElementById("AttIntroduction");
	myDivAttTrinityCollege = document.getElementById("AttTrinityCollege");
	myDivAttGuinessBrewery = document.getElementById("AttTheGuinessBrewery");
	myDivAttKilmainhamGaol = document.getElementById("AttKilmainhamGaol");
	myDivAttMuseums = document.getElementById("AttMuseums");
	myDivAttTempleBar = document.getElementById("AttTempleBar");
	myDivAttOther = document.getElementById("AttOther");
	myDivAttPic = document.getElementById("AttPic");
	
	switch (x) 
	{
		case "1":
			myDivAttIntroduction.style.display = 'block';
			myDivAttTrinityCollege.style.display = 'none';
			myDivAttGuinessBrewery.style.display = 'none';
			myDivAttKilmainhamGaol.style.display = 'none';
			myDivAttMuseums.style.display = 'none';
			myDivAttTempleBar.style.display = 'none';
			myDivAttOther.style.display = 'none';
			myDivAttPic.innerHTML = "<img src='images/intro.jpg' alt='' width='199' height='200' class='thumbborder'>";
			break;
		case "2":
			myDivAttIntroduction.style.display = 'none';
			myDivAttTrinityCollege.style.display = 'block';
			myDivAttGuinessBrewery.style.display = 'none';
			myDivAttKilmainhamGaol.style.display = 'none';
			myDivAttMuseums.style.display = 'none';
			myDivAttTempleBar.style.display = 'none';
			myDivAttOther.style.display = 'none';
			myDivAttPic.innerHTML = "<img src='images/TrinityCollege.jpg' alt='' width='133' height='200' class='thumbborder'>";
			break;
		case "3":
			myDivAttIntroduction.style.display = 'none';
			myDivAttTrinityCollege.style.display = 'none';
			myDivAttGuinessBrewery.style.display = 'block';
			myDivAttKilmainhamGaol.style.display = 'none';
			myDivAttMuseums.style.display = 'none';
			myDivAttTempleBar.style.display = 'none';
			myDivAttOther.style.display = 'none';
			myDivAttPic.innerHTML = "<img src='images/Guiness.jpg' alt='' width='134' height='200' class='thumbborder'>";
			break;
		case "4":
			myDivAttIntroduction.style.display = 'none';
			myDivAttTrinityCollege.style.display = 'none';
			myDivAttGuinessBrewery.style.display = 'none';
			myDivAttKilmainhamGaol.style.display = 'block';
			myDivAttMuseums.style.display = 'none';
			myDivAttTempleBar.style.display = 'none';
			myDivAttOther.style.display = 'none';
			myDivAttPic.innerHTML = "<img src='images/kilmainhamgoal.gif' alt='' width='216' height='150' class='thumbborder'>";
			break;
		case "5":
			myDivAttIntroduction.style.display = 'none';
			myDivAttTrinityCollege.style.display = 'none';
			myDivAttGuinessBrewery.style.display = 'none';
			myDivAttKilmainhamGaol.style.display = 'none';
			myDivAttMuseums.style.display = 'block';
			myDivAttTempleBar.style.display = 'none';
			myDivAttOther.style.display = 'none';
			myDivAttPic.innerHTML = "<img src='images/Musuems.jpg' alt='' width='245' height='184' class='thumbborder'>";
			break;
		case "6":
			myDivAttIntroduction.style.display = 'none';
			myDivAttTrinityCollege.style.display = 'none';
			myDivAttGuinessBrewery.style.display = 'none';
			myDivAttKilmainhamGaol.style.display = 'none';
			myDivAttMuseums.style.display = 'none';
			myDivAttTempleBar.style.display = 'block';
			myDivAttOther.style.display = 'none';
			myDivAttPic.innerHTML = "<img src='images/templebar.jpg' alt='' width='245' height='181' class='thumbborder'>";
			break;
		case "7":
			myDivAttIntroduction.style.display = 'none';
			myDivAttTrinityCollege.style.display = 'none';
			myDivAttGuinessBrewery.style.display = 'none';
			myDivAttKilmainhamGaol.style.display = 'none';
			myDivAttMuseums.style.display = 'none';
			myDivAttTempleBar.style.display = 'none';
			myDivAttOther.style.display = 'block';
			myDivAttPic.innerHTML = "<img src='images/other.jpg' alt='' width='245' height='184' class='thumbborder'>";
			break;
	}
}

function CheckFormReservation()
{
	if (document.frmReservation.txtName.value == "")
	{
		alert("Please enter your full name.");
		document.frmReservation.txtName.focus();
		return false;
	}
	if (document.frmReservation.txtEmail.value == "")
	{
		alert("Please enter your email address.");
		document.frmReservation.txtEmail.focus();
		return false;
	}
	if (document.frmReservation.txtPhone.value == "")
	{
		alert("Please enter your phone number including any internation prefixes if outside of the Republic of Ireland.");
		document.frmReservation.txtPhone.focus();
		return false;
	}
	if (document.frmReservation.txtAddress.value == "")
	{
		alert("Please enter your full postal address.");
		document.frmReservation.txtAddress.focus();
		return false;
	}
	CheckInDate = document.frmReservation.optCheckInDate.value+"/"+document.frmReservation.optCheckInMonth.value+"/"+document.frmReservation.optCheckInYear.value;
	CheckOutDate = document.frmReservation.optCheckOutDate.value+"/"+document.frmReservation.optCheckOutMonth.value+"/"+document.frmReservation.optCheckOutYear.value;
	DateNow = document.frmReservation.txtToday.value;
	
	var one_day = 1000*60*60*24;
	
	var x = CheckInDate.split("/");
	var y = CheckOutDate.split("/");
	var w = DateNow.split("/");
	
	var NewCheckInDate = new Date(x[2],(x[1]-1),x[0]);
	var NewCheckOutDate = new Date(y[2],(y[1]-1),y[0]);
	var NewDateNow = new Date(w[2],(w[1]-1),w[0]);
	
	Diff = Math.ceil((NewCheckOutDate.getTime() - NewCheckInDate.getTime()) / (one_day));
	Diff = Diff + 1;
	
	//Check if Check Out Date is before Check In Date
	if (Diff < 1)
	{
		alert("Your Check In date must be before your Check Out Date.  Please reselect your dates.");
		document.frmReservation.optCheckInDate.focus();
		return false;
	}
	
	//Check if Check In Date is before Today
	Diff = Math.ceil((NewCheckInDate.getTime() - NewDateNow.getTime()) / (one_day));
	Diff = Diff + 1;
	if (Diff < 1)
	{
		alert("Your Check In Date is before today.  Please reselect your Check In date.");
		document.frmReservation.optCheckInDate.focus();
		return false;
	}
	if (document.frmReservation.optRoomType.value == "none")
	{
		alert("Please select the room type that you would prefer during your stay.");
		document.frmReservation.optRoomType.focus();
		return false;
	}
	if (document.frmReservation.txtExpectedArrival.value == "")
	{
		alert("Please enter your expected time of arrival including your flight number as this will allow us to plan our day properly.");
		document.frmReservation.txtExpectedArrival.focus();
		return false;
	}
	
	
	
	return true;
}

function winOpen(strURL)
{    
    window.open(strURL,'800x600','menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=yes,resizable=yes,left=0,top=0,width=660,height=600')
}

function CallNullClick()
{
	return false;
}

