function tryitinerary(itinerary_form)
{
	var pnr_error=check_pnr(itinerary_form.pnr_num.value);
	var last_name_error=check_pnr_last_name(itinerary_form.pnr_last_name.value);

	var error_num=0;

	error_num=pnr_error+last_name_error;

	if (error_num!=0)
	{
	alert("The field(s) highlighted in pink were invalid.\n\n Please re-enter and submit again.");
	
	}
	else {itinerary_form.submit();}


}

function check_pnr(pnr_code)
{
	if (pnr_code=="")
	{	document.getElementById("pnr_num").style.backgroundColor="#FF99CC";
		return (1);}
	else { 
		if(isNaN(pnr_code)) 
		{	document.getElementById("pnr_num").style.backgroundColor="#FFFFFF";
			return (0);
		}
		else{
			document.getElementById("pnr_num").style.color="#FF99CC";
			return (1);
		}
	}
}

function check_pnr_last_name(last_name)
{
	if (last_name=="")
	{	document.getElementById("pnr_last_name").style.backgroundColor="#FF99CC";
		return (1);}
	else { 
		if(isNaN(last_name)) 
		{	document.getElementById("pnr_last_name").style.backgroundColor="#FFFFFF";
			return (0);
		}
		else{
			document.getElementById("pnr_last_name").style.color="#FF99CC";
			return (1);
		}
	}
}
