// JScript source code

function checkvisitmonth(form)  {
    var months = new Array(16);
    months[0]  = "October";
    months[1]  = "November";
    months[2]  = "December";
    months[3]  = "January";
    months[4]  = "February";
    months[5]  = "March";
    months[6]  = "April";
    months[7]  = "May";
    months[8]  = "June";
    months[9]  = "July";
    months[10]  = "August";
    months[11]  = "September";
    months[12]  = "October";
    months[13] = "November";
    months[14] = "December";
    var now = new Date();
    var month = now.getMonth();
    month = month + 3
    var monthname   = months[month];
    if (!(document.pim_activity.PatientVisitMonth.value == months[month-1] | document.pim_activity.PatientVisitMonth.value == months[month] | document.pim_activity.PatientVisitMonth.value == months[month-2] | document.pim_activity.PatientVisitMonth.value == months[month-3]) | (document.pim_activity.PatientVisitMonth.value=="month")) 
    {
    	alert('Patient must have been seen within the last three months');
    	return false;
    }
	} 
	
	
function checkvisityear(form)  {
    var months = new Array(16);
    months[0]  = "October";
    months[1]  = "November";
    months[2]  = "December";
    months[3]  = "January";
    months[4]  = "February";
    months[5]  = "March";
    months[6]  = "April";
    months[7]  = "May";
    months[8]  = "June";
    months[9]  = "July";
    months[10]  = "August";
    months[11]  = "September";
    months[12]  = "October";
    months[13] = "November";
    months[14] = "December";
    var now = new Date();
    var month = now.getMonth();
    month = month + 3
    var monthname   = months[month];
    if (month < 6) 
        {
            if (document.pim_activity.PatientVisitMonth.value == months[0] | document.pim_activity.PatientVisitMonth.value == months[1] | document.pim_activity.PatientVisitMonth.value == months[2] ) 
            {
                if (! (document.pim_activity.PatientVisitYear.value == 2006)) 
                {
                     alert('Patient must have been seen within the last three months 2');
    	             return false;
    	         }
    	     }
    	     else
             {
                if (! (document.pim_activity.PatientVisitYear.value == 2007)) 
                {
                     alert('Patient must have been seen within the last three months 2');
    	             return false;
    	         }
    	     }   	     
    	}
    else
        {
        if (! (document.pim_activity.PatientVisitYear.value == 2007)) 
                {
                     alert('Patient must have been seen within the last three months *');
    	             return false;
    	        }
    	 }
	} 
	
