function tripvalidate()
{	

	if(document.getElementById("Age1").value=="" || document.getElementById("TripCost1").value=="")
	{
		alert("Please enter the age and trip cost for the first traveler and then click Get Quote.");
		document.getElementById("TripCost1").focus();
		return false;
	}
	if(document.getElementById("Age2").value!="" && document.getElementById("TripCost2").value=="")
	{
		alert("Please enter the age and trip cost for the second traveler and then click Get Quote.");
		document.getElementById("TripCost2").focus(); 
		return false;
	}
	if (document.tripminiform.CountryOfResidence.value=="")
	{
		alert("Please select the correct place of residence.");
		document.tripminiform.CountryOfResidence.focus(); 
		return false;
	}
	if(document.tripminiform.TripLength.value == "")
	{
		alert("Please enter the trip length and then click Get Quote.");
		document.tripminiform.TripLength.focus();
		return false;
	}
	if(document.tripminiform.TripLength.value >365)
	{
		alert("Trip Length cannot be greater than one year");
		document.tripminiform.TripLength.focus();
		return false;
	}	
}

function gomaintrip()
{
	if((document.getElementById("Age1").value!="" && document.getElementById("TripCost1").value=="")||
		(document.getElementById("Age1").value=="" && document.getElementById("TripCost1").value!=""))
	{
		alert("Please enter the age and trip cost for the first traveler and then click Get Quote.");
		document.getElementById("TripCost1").focus();
		return false;
	}
 	if((document.getElementById("Age2").value!="" && document.getElementById("TripCost2").value=="")||
		(document.getElementById("Age2").value=="" && document.getElementById("TripCost2").value!=""))
	{
		alert("Please enter the age and trip cost for the second traveler and then click Get Quote.");
		document.getElementById("TripCost2").focus(); 
		return false;
	}
	document.tripminiform.ra.value=document.tripminiform.CountryOfResidence.value;
	document.tripminiform.ta1.value=document.tripminiform.Age1.value;
	document.tripminiform.ta2.value=document.tripminiform.Age2.value;
	document.tripminiform.tc1.value=document.tripminiform.TripCost1.value;
	document.tripminiform.tc2.value=document.tripminiform.TripCost2.value;
	document.tripminiform.tl.value=document.tripminiform.TripLength.value;
	document.tripminiform.action='/results/tripmoreoptions/';
	document.tripminiform.submit();

}

