function validateForm(form2)
{

var currentTime = new Date()
var thisMonth = currentTime.getMonth()+1;
var thisYear = currentTime.getYear();
var thisDay = currentTime.getDate();

if(thisDay < 10)
	{
	thisDay = "0" + thisDay
	}
if(thisMonth < 10)
	{
	thisMonth = "0" + thisMonth
	}
	
checkDate = (thisYear + '' +thisMonth + '' + thisDay);

if (document.forms.form2.StartDate.value =="" )
{
alert ( " Please enter a start date" );
document.forms.form2.StartDate.focus();
return false;
}
if (document.forms.form2.EndDate.value =="" )
{
alert ( " Please enter an end date" );
document.forms.form2.EndDate.focus();
return false;
}

startCheck = document.forms.form2.StartDate.value;
endCheck = document.forms.form2.EndDate.value;

endCheck = (endCheck.replace(/-/, ""));
endCheck = (endCheck.replace(/-/, ""));

startCheck = (startCheck.replace(/-/, ""));
startCheck = (startCheck.replace(/-/, ""));

if (startCheck > endCheck)
{
alert ( "Your end date is before your start date" );
document.forms.form2.EndDate.focus();
return false;
}
if (startCheck < checkDate)
{
alert ("Your start date is in the past");
document.forms.form2.EndDate.focus();
return false;
}

}
