function checksubmit ()
{
    if ((document.submitForm.beginMonth.options[document.submitForm.beginMonth.selectedIndex].value == 0
         && document.submitForm.beginYear.options[document.submitForm.beginYear.selectedIndex].value != 0)
        || (document.submitForm.beginMonth.options[document.submitForm.beginMonth.selectedIndex].value != 0
           && document.submitForm.beginYear.options[document.submitForm.begindateyear.selectedIndex].value == 0))
    {
        alert("Both Begin month and year should be selected.");
        return false;
    }
    if ((document.submitForm.endMonth.options[document.submitForm.endMonth.selectedIndex].value == 0 && document.submitForm.endYear.options[document.submitForm.endYear.selectedIndex].value != 0)
        || document.submitForm.endMonth.options[document.submitForm.endMonth.selectedIndex].value != 0 && document.submitForm.endYear.options[document.submitForm.endYear.selectedIndex].value == 0)
    {
        alert("Both Begin month and year should be selected.");
        return false;
    }
    if (document.submitForm.enddateyear.selectedIndex < document.submitForm.begindateyear.selectedIndex)
    {
        alert("Begin year should be smaller than end year.");
        return false;
    }
    if (document.submitForm.enddateyear.selectedIndex == document.submitForm.begindateyear.selectedIndex)
    {
        if (document.submitForm.enddatemonth.selectedIndex < document.submitForm.begindatemonth.selectedIndex)
        {
            alert("Start date should be before the end date.");
            return false;
        }
    }
    return true;
}