function isBeforeToday(checkDate) 
{
    today = new Date();
    today.setHours(0);
    today.setMinutes(0);
    today.setSeconds(0);
    today.setMilliseconds(0);
    if (checkDate.getTime() < today.getTime())
      return true;
}

function isValidDate(day, month, year) 
{
	if((month == 1)||(month==3)||(month==5)||(month==7)||(month==8)||(month==10)||(month==12)) {
	    if ( day > 31 || day < 1 ) return false;
	} else
	if((month == 4)||(month==6)||(month==9)||(month==11)) {
	    if ( day > 30 || day < 1 ) return false;
	} else
	if((year - 1960) % 4 != 0) {
	    if ( day > 28 || day < 1 ) return false;
	} else
	    if ( day > 29 || day < 1 ) return false;

	return true;
}
