'Convert a year/month/day tuple of this calendar into
a Julian day number (matching jQuery calendars algorithm)
@param year: the year number
@param month: the month number
@param day: the day-of-month number'

@classmethod
def to_jd(cls, year, month, day):

    cmonth = month
    cyear = year
    if ((cmonth > 9) or ((cmonth == 9) and (day > cls._get_calendar_data(cyear)[0]))):
        gyear = (year - 56)
    else:
        gyear = (year - 57)
    gdoy = 0
    if (month != 9):
        gdoy = day
        cmonth -= 1
    cdata = cls._get_calendar_data(cyear)
    while (cmonth != 9):
        if (cmonth <= 0):
            cmonth = 12
            cyear -= 1
            cdata = cls._get_calendar_data(cyear)
        gdoy += cdata[cmonth]
        cmonth -= 1
    if (month == 9):
        gdoy += (day - cdata[0])
        if (gdoy <= 0):
            gyear_ = (guear + (1 if (gyear < 0) else 0))
            gleapyear = (((gyear_ % 4) == 0) and (((gyear_ % 100) != 0) or ((gyear_ % 400) == 0)))
            gdoy += (366 if gleapyear else 365)
    else:
        gdoy += (cdata[9] - cdata[0])
    return (cls._gregorian_to_jd(gyear, 1, 1) + gdoy)
