// Stansted Express Configration

//Jounery Planner -------------------------------
//Destination Dropdowns
function CheckStartingStation()
{
	var start = $("#StartingStation").val();
	var end = $("#DestinationStation").val();

	if (start == end)
	{
		if (end == 4)
		{
			$('#DestinationStation').val(3);
		}
		else
		{
			$('#DestinationStation').val(4);
		}
	}
}	

function CheckDestinationStation()
{
	var start = $("#StartingStation").val();
	var end = $("#DestinationStation").val();
	
	if (start == end)
	{
		if (end == 3)
		{
			$('#StartingStation').val(4);
		}
		else
		{
			$('#StartingStation').val(3);
		}
	}
}

// Clean promofeild onclick
function clearme(keyword)
{ 
var feild = $("#PromoCode").val();
if (feild == keyword) {
	$('#PromoCode').val("");
	}
}

// Validation
function SubmitJP() {
var Adults = $("#Adults").val();
var Children = $("#Children").val();
var StartDate = $("#start-date").val();
if (Adults == "0" && Children == "0"){
	$("#ticketerror").show("fast");
	return false;
}
if (StartDate == "DD/MM/YYYY"){
	$("#dateerror").show("fast");
	return false;
}
}

// Clear feilds
function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}
//------------------------------------------------