﻿<!--

//	Enable the input

	document.InputForm.AppType[0].disabled = false;
	document.InputForm.AppType[1].disabled = false;
	document.InputForm.AppType[2].disabled = false;
	document.InputForm.Submit.disabled = false;
			
function typeChange()
{

	today = new Date();
	deadline = new Date("Fri Apr 30 23:59:59 EDT 2011");
	unavailable = new Date("Wed Jun 30 23:59:50 EDT 2011");

	
	if (today > unavailable)
	{
		alert ('We are sorry, applications are no longer being accepted.')
		document.InputForm.AppType[0].checked = false;
		document.InputForm.AppType[0].disabled = true;
		document.InputForm.AppType[1].checked = false;
		document.InputForm.AppType[1].disabled = true;
		document.InputForm.AppType[2].checked = false;
		document.InputForm.AppType[2].disabled = true;
		document.InputForm.Submit.disabled = true;
	}
	else
	{
		if (document.InputForm.AppType[0].checked)
		{
			if (today > unavailable)
			{
				alert ('Regional qualifier applications are closed.')
				document.InputForm.AppType[0].checked = false;
				document.InputForm.AppType[0].disabled = true;
			}
		}
		if (document.InputForm.AppType[1].checked)
		{
			if (today < deadline)
			{
				alert ('Applications for open slots begin on 1 May 2011 Eastern Daylight Time.')
				document.InputForm.AppType[1].checked = false;
				document.InputForm.AppType[1].disabled = true;
				document.InputForm.AppType[2].checked = false;
				document.InputForm.AppType[2].disabled = true;
			}
		}
	}
}

function validit()
{

  var radioSelected = false;
  for (i = 0;  i < document.InputForm.AppType.length;  i++)
  {
    if (document.InputForm.AppType[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
    alert("Please tell us which type of application you are applying for.");
    document.InputForm.AppType[0].focus();
    return false;
  }

	if (document.InputForm.AppType[2].checked == true)
		document.InputForm.action = "intl-application.asp";
	else
		document.InputForm.action = "application.asp";

	return true;
}


//-->

