	function loadJourneyForm(){
		var monthL = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
		var dayL = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
 
		var intoTomorrow = false;
		var todaysDate = new Date();
		var fiveMins = new Date(todaysDate.valueOf() + 300000);
 
		if (fiveMins.getDate() > todaysDate.getDate())
			intoTomorrow = true;
 
		var hrs = fiveMins.getHours();
 
		if (hrs < 12)
			document.tpp.itd_itdTimeAMPM.selectedIndex = 0;
		 else
			document.tpp.itd_itdTimeAMPM.selectedIndex = 1;
 
		if (hrs > 12)
			hrs -= 12;
 
		if (hrs == 0)
			hrs = 12;
 
		document.tpp.itd_itdTimeHour.selectedIndex = hrs - 1;
		var min = fiveMins.getMinutes();
		document.tpp.itd_itdTimeMinute.selectedIndex = min / 5;
		var workDate = new Date(todaysDate.getFullYear(), todaysDate.getMonth(), todaysDate.getDate(), 5, 0, 0, 0);
		var dVal; var dLab;
		var el = eval('document.tpp.itd_itdDate');
		el.length = 0;
 
		for (var i = 0; i <= 7; i++) {
			dVal = workDate.getFullYear();
			if ((workDate.getMonth()+1)<10){dVal+='0'+(workDate.getMonth() + 1);}else{dVal+=''+(workDate.getMonth() + 1);}
			if (workDate.getDate()<10){dVal+='0'+workDate.getDate();}else{dVal+=''+workDate.getDate();}
 
			switch(i) {
				case 0:
					dLab = 'Today (' + dayL[workDate.getDay()] + ')';
					break;
				case 1:
					dLab = 'Tomorrow (' + dayL[workDate.getDay()] + ')';
					break;
				default:
					dLab = '' + workDate.getDate() + '-' + monthL[workDate.getMonth()] + '-' + workDate.getFullYear() + ' (' + dayL[workDate.getDay()] + ')';
					break;
			}
			el.options[el.options.length] = new Option(dLab,dVal,false,false);
			workDate = new Date(workDate.valueOf() + 86400000);
		}
 
		if (intoTomorrow)
			el.selectedIndex = 1;
		else
			el.selectedIndex = 0;
 
		return true;
	}
 
	function fromFocus() {
		if (document.tpp.itd_name_origin.value == 'suburb, station, landmark')
			document.tpp.itd_name_origin.value = '';
 
		return true;
	}
 
	function fromBlur() {
		if (document.tpp.itd_name_origin.value == '')
			document.tpp.itd_name_origin.value = 'suburb, station, landmark';
 
		return true;
	}
 
	function toFocus() {
		if (document.tpp.itd_name_destination.value == 'suburb, station, landmark')
			document.tpp.itd_name_destination.value = '';
 
		return true;
	}
 
	function toBlur() {
		if (document.tpp.itd_name_destination.value == '')
			document.tpp.itd_name_destination.value = 'suburb, station, landmark';
 
		return true;
	}
 
	function forceCheckbox () {
		document.tpp.TransCb.checked = true;
	}
 
	function validateFormValue() {
		if (document.tpp.itd_name_origin.value == 'suburb, station, landmark' || document.tpp.itd_name_origin.value == '' || document.tpp.itd_name_destination.value == 'suburb, station, landmark' || document.tpp.itd_name_destination.value == '') {
			alert('You must provide both a from and to location');
			return false;
		} else {
			return true;
		}
	}
 
	function moreOptionsClick() {
		if (document.tpp.itd_name_origin.value != 'suburb, station, landmark')
			document.moreOptions.itd_name_origin.value = document.tpp.itd_name_origin.value;
 
		if (document.tpp.itd_name_destination.value != 'suburb, landmark or stop')
			document.moreOptions.itd_name_destination.value = document.tpp.itd_name_destination.value;
 
		document.moreOptions.itd_itdDate.value  = document.tpp.itd_itdDate[document.tpp.itd_itdDate.selectedIndex].value;
		document.moreOptions.itd_itdTimeHour.value    = document.tpp.itd_itdTimeHour[document.tpp.itd_itdTimeHour.selectedIndex].value;
		document.moreOptions.itd_itdTimeMinute.value    = document.tpp.itd_itdTimeMinute[document.tpp.itd_itdTimeMinute.selectedIndex].value;
		document.moreOptions.itd_itdTripDateTimeDepArr.value = document.tpp.itd_itdTripDateTimeDepArr[document.tpp.itd_itdTripDateTimeDepArr.selectedIndex].value;
 
		if(document.tpp.transMode3.checked == true)
			document.moreOptions.Vehicle.value =	"Bus";
		else
			document.moreOptions.Vehicle.value =	"Bus,Train,Ferry";
 
		document.moreOptions.submit();
 
		return false;
	}
 
function validateOnSubmit()
{
	var validateSummary;
	var invalid;
	
	validateSummary = "";
	invalid = null;
	
	//FROM Check
	if (document.journey.FromSeType[0].selected == true) {
		if (document.journey.FromStreet.value == "" || document.journey.FromStreet.value == "Enter street number and name")
		{
			if (document.journey.FromSuburb.value == "" || document.journey.FromSuburb.value == "Enter suburb or town") 
			{
				validateSummary += "Enter From street and/or From suburb";
				document.getElementById('validateFromStreet').innerHTML = '*';
				document.getElementById('validateFromSuburb').innerHTML = '*';
				document.journey.FromStreet.value = 'Enter street number and name';
			    document.journey.FromSuburb.value = 'Enter suburb or town';
				if (invalid == null) //sets focus to Street
				{
				invalid = document.journey.FromStreet;
				}
			}
			else
			{
				document.getElementById('validateFromStreet').innerHTML = '';
				document.getElementById('validateFromSuburb').innerHTML = '';
			}				
		}
		else
		{
			document.getElementById('validateFromStreet').innerHTML = '';
			document.getElementById('validateFromSuburb').innerHTML = '';
		}						
	}
	
	if (document.journey.FromSeType[1].selected == true) {
		if (document.journey.FromSuburb.value == "" || document.journey.FromSuburb.value == "Enter station/stop")
		{
			validateSummary += "Enter From station/stop";
			document.getElementById('validateFromStreet').innerHTML = '';
			document.getElementById('validateFromSuburb').innerHTML = '*';
			document.journey.FromSuburb.value = 'Enter station/stop';
			if (invalid == null) //sets focus to Suburb
			{
				invalid = document.journey.FromSuburb;
			}
		}
		else
		{
			document.getElementById('validateFromSuburb').innerHTML = '';
		}						
	}
	
	if (document.journey.FromSeType[2].selected == true) {		
		if (document.journey.FromSuburb.value == "" || document.journey.FromSuburb.value == "Enter landmark")
		{
			validateSummary += "Enter From landmark";
			document.getElementById('validateFromStreet').innerHTML = '';
			document.getElementById('validateFromSuburb').innerHTML = '*';
			document.journey.FromSuburb.value = 'Enter landmark';
			if (invalid == null) //sets focus to Suburb
			{
				invalid = document.journey.FromSuburb;
			}
		}
		else
		{
			document.getElementById('validateFromSuburb').innerHTML = '';
		}										
	}
	//End FROM Check
 
	//TO Check
	if (document.journey.ToSeType[0].selected == true) {
		if (document.journey.ToStreet.value == "" || document.journey.ToStreet.value == "Enter street number and name")
		{
			if (document.journey.ToSuburb.value == "" || document.journey.ToSuburb.value == "Enter suburb or town") 
			{
				validateSummary += "Enter To street and/or To suburb";
				document.getElementById('validateToStreet').innerHTML = '*';
				document.getElementById('validateToSuburb').innerHTML = '*';
				document.journey.ToStreet.value = 'Enter street number and name';
			    document.journey.ToSuburb.value = 'Enter suburb or town';
				if (invalid == null) //sets focus to Street
				{
				invalid = document.journey.ToStreet;
				}
			}
			else
			{
				document.getElementById('validateToStreet').innerHTML = '';
				document.getElementById('validateToSuburb').innerHTML = '';
			}				
		}
		else
		{
			document.getElementById('validateToStreet').innerHTML = '';
			document.getElementById('validateToSuburb').innerHTML = '';
		}						
	}
	
	if (document.journey.ToSeType[1].selected == true) {
		if (document.journey.ToSuburb.value == "" || document.journey.ToSuburb.value == "Enter station/stop")
		{
			validateSummary += "Enter To station/stop";
			document.getElementById('validateToStreet').innerHTML = '';
			document.getElementById('validateToSuburb').innerHTML = '*';
			document.journey.ToSuburb.value = 'Enter station/stop';
			if (invalid == null) //sets focus to Suburb
			{
				invalid = document.journey.ToSuburb;
			}
		}
		else
		{
			document.getElementById('validateToSuburb').innerHTML = '';
		}			
	}
	
	if (document.journey.ToSeType[2].selected == true) {		
		if (document.journey.ToSuburb.value == "" || document.journey.ToSuburb.value == "Enter landmark")
		{
			validateSummary += "Enter To landmark";
			document.getElementById('validateToStreet').innerHTML = '';
			document.getElementById('validateToSuburb').innerHTML = '*';
			document.journey.ToSuburb.value = 'Enter landmark';
			if (invalid == null) //sets focus to Suburb
			{
				invalid = document.journey.ToSuburb;
			}
		}
		else
		{
			document.getElementById('validateToSuburb').innerHTML = '';
		}									
	}
	//End TO Check
 
 
  	if (validateSummary == "") //all validation passes:
 	{
		assignValueToLocType();
		return true;
 	}
 
 	else
 	{
	   alert("Please make sure you have entered the 'From' and 'To' locations.");
	   document.getElementById('validateSummary').innerHTML = 'Please review the following:' + validateSummary;
	   invalid.focus();
	   return false;
	}
 
 
}
