function orderhis(theform)
{
    if (theform.NName.selectedIndex==0)
    {
        alert("Please choose a Nickname.");
        theform.NName.focus();
        return false;
    }

    if (theform.SDD.selectedIndex==0)
    {
        alert("Please select a start date.");
        theform.SDD.focus();
        return false;
    }

    if (theform.SMM.selectedIndex==0)
    {
        alert("Please select a month.");
        theform.SMM.focus();
        return false;
    }

    if (theform.SYY.selectedIndex==0)
    {
        alert("Please select the year.");
        theform.SYY.focus();
        return false;
    }

    sdtd=theform.SDD.selectedIndex
    sdtm=theform.SMM.selectedIndex
    sdty=theform.SYY.selectedIndex

    sdat=theform.SDD[sdtd].value
    smon=theform.SMM[sdtm].value
    syear=theform.SYY[sdty].value
    
    
    if ((sdtm==2 || sdtm==4 || sdtm==6 || sdtm==9 || sdtm==11) && sdtd==31)
    {
        alert("Please select the day again as this month does not have 31 days.");
        theform.SDD.focus();
        return false;
    }

    if(sdtm == 2 && sdtd == 30)
    {
        alert("Please select the day again as this month does not have 30 days.");
        theform.SDD.focus();
        return false;
    }

    if (sdty%4!=0 && sdtm==2 && sdtd==29)
    {
        alert("This is not a leap year.")
        theform.SDD.focus();
        return false;
    }


    if (theform.EDD.selectedIndex==0)
    {
        alert("Please select an end date.");
        theform.EDD.focus();
        return false;
    }

    if (theform.EMM.selectedIndex==0)
    {
        alert("Please select a month.");
        theform.EMM.focus();
        return false;
    }

    if (theform.EYY.selectedIndex==0)
    {
        alert("Please select the year.");
        theform.EYY.focus();
        return false;
    }

    edtd = theform.EDD.selectedIndex
    edtm = theform.EMM.selectedIndex
    edty = theform.EYY.selectedIndex

    edat=theform.EDD[edtd].value
    emon=theform.EMM[edtm].value
    eyear=theform.EYY[edty].value

    if ((edtm==2 || edtm==4 || edtm==6 || edtm==9 || edtm==11) && edtd==31)
    {
        alert("Please select the day again as this month does not have 31 days.");
        theform.EDD.focus();
        return false;
    }

    if (edtm==2 && edtd==30)
    {
        alert("Please select the day again as this month does not have 30 days.");
        theform.EDD.focus();
        return false;
    }
  
    if (edty%4!=0 && edtm==2 && edtd==29)
    {
        alert("This is not a leap year.");
        theform.EDD.focus();
        return false;
    }

    if (syear==eyear && smon==emon && sdat-edat>=1)
    {
        alert("Invalid entry in the date field.");
        theform.EDD.focus();
        return false;
    }

    if (syear==eyear && smon-emon>=1)
    {
        alert("Invalid entry in the month field.");
        theform.EMM.focus();
        return false;
    }

    if (syear-eyear>=1)
    {
        alert("Invalid entry in the year field.");
        theform.EYY.focus();
        return false;
    }
return true;
}
