#! C:/Users/Administrator/AppData/Local/Programs/Python/Python38/python.exe

print("Content-Type: text/html\n\n")
import datetime
import cgi
import cgitb
cgitb.enable()
import sys,os
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
import PyPDF2
from PyPDF2 import PdfFileWriter,PdfFileReader



def getcobracovenddate(tdict):
    duration = 11
    startyear = int(tdict['endyear'])       #end year for group coverage
    startmonth = int(tdict['endmonth'])
    startday = int(tdict['endday'])
    tevent = tdict['qualifyingevent']
    if tevent == 'term' or tevent == 'reduction':
        duration = 18
        if startmonth <= 6:
            lastmonth = startmonth + 6
            lastyear = startyear + 1
            todatestr = str(lastmonth) + '/1/' + str(lastyear)
            return todatestr
        if startmonth > 6:
            lastmonth = startmonth - 6
            lastyear = startyear + 2
            todatestr = str(lastmonth) + '/1/' + str(lastyear)
            return todatestr
    if tevent == 'death' or tevent == 'divorce' or tevent == 'child27':
        lastyear = startyear + 3
        todatestr = str(startmonth) + '/1/' + str(lastyear)
        return todatestr
    if tevent == 'medicare':
        if startmonth == 1:
            todatestr = '12/1/'+str(startyear)
        else:
            lastyear = startyear + 1
            lastmonth = startmonth - 1
            todatestr = lastmonth + '/1/'+lastyear
        return todatestr

def getqualifyingevent(tdict):
    tevent = tdict['qualifyingevent']
    if tevent == 'term':
        return 'end of employment'
    if tevent == 'death':
        return 'death of employee'
    if tevent == 'medicare':
        return 'entitlement to Medicare'
    if tevent == 'reduction':
        return 'reduction in working hours'
    if tevent == 'divorce':
        return 'divorce or legal separation'
    if tevent == 'child27':
        return 'loss of dependent child status'

def getduedate(tdict):
    #tdate = tdict['noticedate']
    #parts = tdate.split('/')
    tmonth = int(tdict['noticemonth'])
    tday = int(tdict['noticeday'])
    tyear = int(tdict['noticeyear'])
    if tmonth <= 10:
        tmonth = tmonth + 2
        tdate = str(tmonth)+'/'+str(tday)+'/'+str(tyear)
    else:
        tmonth = tmonth - 10
        tyear = tyear + 1
        tdate = str(tmonth)+'/'+str(tday)+'/'+str(tyear)
    return tdate


def getcobracovenddate(tdict):
    duration = 11
    startyear = int(tdict['endyear'])
    startmonth = int(tdict['endmonth'])
    startday = int(tdict['endday'])
    tevent = tdict['qualifyingevent']
    if tevent == 'term' or tevent == 'reduction':
        duration = 18
        if startmonth <= 6:
            lastmonth = startmonth + 6
            lastyear = startyear + 1
            todatestr = str(lastmonth) + '/1/' + str(lastyear)
            return todatestr
        if startmonth > 6:
            lastmonth = startmonth - 6
            lastyear = startyear + 2
            todatestr = str(lastmonth) + '/1/' + str(lastyear)
            return todatestr
    if tevent == 'death' or tevent == 'divorce' or tevent == 'child27':
        lastyear = startyear + 3
        todatestr = str(startmonth) + '/1/' + str(lastyear)
        return todatestr
    if tevent == 'medicare':
        if startmonth == 1:
            todatestr = '12/1/'+str(startyear)
        else:
            lastyear = startyear + 1
            lastmonth = startmonth - 1
            todatestr = lastmonth + '/1/'+lastyear
        return todatestr

if __name__ == '__main__':
    tform = cgi.FieldStorage()
    print (tform)
    print ('<p>')
    tdict = {}
    for item in tform:
        tdict[item] = tform.getvalue(item)
        print (item)
        print (' -- ')
        print (tdict[item])
        print ('<br>')
    add2percent = 'no'
    if "chkadd2percent" in tdict.keys():
        add2percent = 'yes'


    cobracovenddate = getcobracovenddate(tdict)
    agentphone = '('+ tdict['agentphone'][0:3] + ') ' +tdict['agentphone'][3:6]+'-'+ tdict['agentphone'][6:]
    print ('<p>')
    print(agentphone)
    agentemail = tdict['agentemail']

    noticedate = tdict['noticemonth'] +'/' + tdict['noticeday'] + '/' +tdict['noticeyear']
    tdict['noticedate'] = noticedate


    duedate = getduedate(tdict)
    enddate = tdict['endmonth']+'/'+tdict['endday']+'/'+tdict['endyear']
    #c = canvas.Canvas("c:/xampp/htdocs/cobranot.pdf")

    c = canvas.Canvas("c:/apache24/htdocs/wwwbin/cobranot.pdf")
    c.setFont('Helvetica-Bold', 12)

    c.drawString(10,800,'IMPORTANT INFORMATION: COBRA Continuation Coverage and other Health Coverage Alternatives')
    c.setFont('Helvetica', 12)
    c.drawString(70,770,'Date of Notice:')
    c.drawString(150,770,tdict['noticedate'])

    d = 14


    csz = tdict['emplrcity']+', '+tdict['emplrstate']+ ' '+tdict['emplrzip']



    tst = 'Dear '+ tdict['eename']
    if 'spmedrate' in tdict:
        tst = tst + ' & spouse'


    c.drawString(350,770,tdict['eename'])
    c.drawString(350,755,tdict['eeaddr'])
    eecsz = tdict['eecity']+', '+tdict['eestate']+ ' '+tdict['eezip']
    c.drawString(350,740,eecsz)


    drop = 730
    c.drawString(47,drop,tst)
    drop = drop - d -10
    c.drawString(47,drop,'This notice contains important information about your right to continue your health care ')
    drop = drop - d
    c.drawString(47,drop,'coverage in the '+tdict["emplrname"]+' group health plan, as well as other health')
    drop = drop - d
    c.drawString(47,drop,'coverage alternatives that may be available to you through the Health Insurance ')
    drop = drop -d
    c.drawString(47,drop,'Marketplace.  Please read the information contained in this notice very carefully.')
    drop = drop -d -10
    c.drawString(47,drop,'You may be able to get coverage through the Health Insurance Marketplace that costs ')
    drop = drop -d
    c.drawString(47,drop,' less than COBRA continuation coverage.  Please read the information in this notice ')
    drop = drop -d
    c.drawString(47,drop,' very carefully before you make your decision.  If you choose to elect COBRA continuation')
    drop = drop -d
    c.drawString(47,drop,' coverage, you should use the election form provided later in this notice.')

    drop = drop -d -10
    c.drawString(47,drop,'Please read the information in this notice very carefully before you make your decision.')
    drop = drop -d
    c.drawString(47,drop,'If you choose to elect COBRA continuation coverage, you should use the Election Form')
    drop = drop -d
    c.drawString(47,drop,'provided later in this notice.')

    qalifyingevent = getqualifyingevent(tdict)
    c.setFont('Helvetica-Bold', 12)
    drop = drop -d -10
    c.drawString(47,drop,'Why am I getting this notice?')
    c.setFont('Helvetica', 12)

    drop = drop -d
    c.drawString(47,drop,'You are getting this notice because your coverage under the Plan will end on '+enddate)
    drop = drop -d
    c.drawString(47,drop,'due to '+qalifyingevent)
    drop = drop -d -10
    c.drawString(47,drop,'Federal law requires that most group health plans (including this plan) give employees')
    drop = drop -d
    c.drawString(47,drop,'and their families the opportunity to continue their health coverage through COBRA')
    drop = drop -d
    c.drawString(47,drop,'continuation coverage when there is a qualifying event that would result in the loss of')
    drop = drop -d
    c.drawString(47,drop,"coveage under an emlpoyer's plan")
    c.setFont('Helvetica-Bold', 12)
    drop = drop -d -10
    c.drawString(47,drop,'What is COBRA continuation coverage?')
    c.setFont('Helvetica', 12)
    drop = drop -d
    c.drawString(47,drop,'COBRA continuation coverage is the same coverage that the Plan gives to other participants or')

    drop = drop -d
    c.drawString(47,drop,'beneficiaries who are not getting continuation coverage.  Each qualified beneficiary (described')

    drop = drop -d
    c.drawString(47,drop,'below) who elects COBRA continuation coverage will have the same rights under the Plan as')

    drop = drop -d


    c.setFont('Helvetica-Bold', 12)
    drop = drop -d - 20
    c.drawString(47,drop,'Who are the qualified beneficiaries?')
    c.setFont('Helvetica', 12)

    drop = drop -d
    c.drawString(47,drop,'Each person (qualified beneficiary) in the category(ies) checked below can elect COBRA')

    drop = drop -d
    c.drawString(47,drop,'- Employee or former employee ')

    drop = drop -d
    c.drawString(47,drop,'- Spouse or former spouse ')

    drop = drop -d
    c.drawString(47,drop,'- Dependent child(ren) covered under the Plan on the day before the event that caused the ')
    drop = drop -d
    c.drawString(47,drop,'loss of coverage ')

    drop = drop -d
    c.drawString(47,drop,'- Child who is losing coverage under the Plan because he or she is no longer a dependent ')
    drop = drop -d
    c.drawString(47,drop,'under the Plan ')

    c.setFont('Helvetica-Bold', 12)
    drop = drop -d - 20
    c.drawString(47,drop,'Are there other coverage options besides COBRA Continuation Coverage?')
    c.setFont('Helvetica', 12)

    drop = drop -d
    c.drawString(47,drop,'Yes.  Instead of enrolling in COBRA continuation coverage, there may be other more affordable')

    drop = drop -d
    c.drawString(47,drop,'coverage options for you and your family through the Health Insurance Marketplace, Medicaid,')

    drop = drop -d
    c.drawString(47,drop,'or other group health plan coverage options (such as a spousal plan) through what is called a')

    drop = drop -d
    c.drawString(47,drop,'special enrollment period.  Some of these options may cost less than COBRA continuation')

    drop = drop -d
    c.drawString(47,drop,'coverage.')

    c.drawString(47,drop,'other participants or beneficiaries covered under the Plan.  ')
    #------------------------------------------------------------------------------------------------------------------page 2--------------------------------------------------------------------------
    c.showPage()
    drop = 820


    drop = drop -d-10
    c.drawString(47,drop,'If you are eligible for other group health coverage, such as through a new employer’s plan or a ')

    drop = drop -d
    c.drawString(47,drop,'spouse’s plan (not including excepted benefits, a qualified small employer health reimbursement')

    drop = drop -d
    c.drawString(47,drop,'arrangement (QSEHRA), or a health flexible spending arrangement (FSA)), or if you are eligible')

    drop = drop -d
    c.drawString(47,drop,'arrangement (QSEHRA), or a health flexible spending arrangement (FSA)), or if you are eligible for')

    drop = drop -d
    c.drawString(47,drop,' Medicare, you are not eligible for ARP premium assistance. However, if you have individual ')

    drop = drop -d
    c.drawString(47,drop,'health insurance coverage, like a plan through a Marketplace, or if you have Medicaid, you may be ')

    drop = drop -d
    c.drawString(47,drop,'eligible for ARP premium assistance if you elect COBRA continuation coverage. You will not be')

    drop = drop -d
    c.drawString(47,drop,'eligible for a premium tax credit, or advance payments of the premium tax credit, for Marketplace')

    drop = drop -d
    c.drawString(47,drop,'coverage for months you are enrolled in COBRA continuation coverage and you may not be ')

    drop = drop -d
    c.drawString(47,drop,'eligible for months during which you remain an employee but are eligible for COBRA continuation ')

    drop = drop -d
    c.drawString(47,drop,'coverage with premium assistance because of a reduction of hours. If you’re eligible for Medicare, ')

    drop = drop -d
    c.drawString(47,drop,'consider signing up during its special enrollment period to avoid a coverage gap when your ')

    drop = drop -d
    c.drawString(47,drop,'COBRA coverage ends and a late enrollment penalty.')



    drop = drop -d -10
    c.drawString(47,drop,'You should compare your other coverage options with COBRA continuation coverage and choose ')

    drop = drop -d
    c.drawString(47,drop,'the coverage that is best for you. For example, if you move to other coverage you may pay')

    drop = drop -d
    c.drawString(47,drop,'more out of pocket than you would under COBRA because the new coverage may impose a new')

    drop = drop -d
    c.drawString(47,drop,'deductible. Also, keep in mind that if you elect COBRA continuation coverage with premium')

    drop = drop -d
    c.drawString(47,drop,'assistance, then you may qualify for a special enrollment period to enroll in Marketplace')

    drop = drop -d
    c.drawString(47,drop,'coverage when your premiumassistance ends. You may use the special enrollment period to')

    drop = drop -d
    c.drawString(47,drop,' enroll in Marketplace coverage witha tax credit if you end your COBRA continuation coverage')

    drop = drop -d
    c.drawString(47,drop,'when your premium assistance endsand you are otherwise eligible.')

    drop = drop -d-10
    c.drawString(47,drop,'When you lose job-based health coverage, it is important that you choose carefully between')

    drop = drop -d
    c.drawString(47,drop,'COBRA continuation coverage and other coverage options, because once you have made your')

    drop = drop -d
    c.drawString(47,drop,'choice, it can be difficult or impossible to switch to another coverage option until the')

    drop = drop -d
    c.drawString(47,drop,'next open enrollment period.')

    c.setFont('Helvetica-Bold', 12)
    drop = drop -d -10
    c.drawString(47,drop,'If I elect COBRA continuation coverage, when will my coverage begin and how long will')
    drop = drop -d
    c.drawString(47,drop,'the coverage last?')
    c.setFont('Helvetica', 12)


    drop = drop -d
    c.drawString(47,drop,'If elected, COBRA continuation coverage will begin on '+enddate+' and can last until '+cobracovenddate+'.')

                           #[enter April 1 or if qualifying event is after this date the date of qualifying event] through September 30, 2021.
    drop = drop -d
    c.drawString(47,drop,'If your COBRA qualifying event was the employee’s reduction in hours or involuntary')

    drop = drop -d
    c.drawString(47,drop,'termination of employment, you may be eligible for ARP premium assistance from April 1')

    drop = drop -d
    c.drawString(47,drop,'(or your COBRA eligibility date if later) through September 30, 2021.')

    drop = drop -d -10
    c.drawString(47,drop,'Continuation coverage may end before the date noted above in certain circumstances, like failure')

    drop = drop -d
    c.drawString(47,drop,'to pay premiums, fraud, or the individual becomes covered under another group health plan or')

    drop = drop -d
    c.drawString(47,drop,'entitled to Medicare.')


    c.setFont('Helvetica-Bold', 12)
    drop = drop -d -10
    c.drawString(47,drop,'Can I extend the length of COBRA continuation coverage?')
    c.setFont('Helvetica', 12)

    drop = drop -d
    c.drawString(47,drop,'If you elect continuation coverage, you may be able to extend the length of continuation')

    drop = drop -d
    c.drawString(47,drop,'coverage if a qualified beneficiary is disabled, or if a second qualifying event occurs.  You must')

    drop = drop -d
    c.drawString(47,drop,'notify '+ tdict['emplrname'] +' of a disability or a second')

    drop = drop -d
    c.drawString(47,drop,'qualifying event within a certain time period to extend the period of continuation coverage.  If')

    drop = drop -d
    c.drawString(47,drop,'you do not provide notice of a disability or second qualifying event within the required time')

    drop = drop -d
    c.drawString(47,drop,'period, it will affect your right to extend the period of continuation coverage.  ')

    drop = drop -d-10
    c.drawString(47,drop,'For more information about extending the length of COBRA continuation coverage visit')

    drop = drop -d
    c.drawString(47,drop,'http://www.dol.gov/ebsa/publications/cobraemployee.html.')


 #------------------------------------------------------------------------------------------------------------------page 3--------------------------------------------------------------------------

    c.showPage()
    drop = 810



    c.setFont('Helvetica-Bold', 12)
    drop = drop -d-10
    c.drawString(47,drop,'How much does COBRA continuation coverage cost each month?')
    c.setFont('Helvetica', 12)

    zerobol = False
    drop = drop -d

    if "eemedrate" in tdict:
        eemedrate = float(tdict['eemedrate'])
    else:
        eemedrate = 0
    if eemedrate < 5:
        zerobol = True
    if add2percent == 'yes':
        eemedrate = eemedrate * 1.02
    eemedrate = str(round(eemedrate, 2))
    if zerobol == False:
        c.drawString(47,drop,'Employee Medical Coverage: $'+str(eemedrate))
    #else:
    #    c.drawString(47,drop,'Employee Medical Coverage: NA')

    if 'eedentrate' in tdict:
        drop = drop -d
        eedentrate = float(tdict['eedentrate'])
        if add2percent == 'yes':
            eedentrate = eedentrate * 1.02
        eedentrate = str(round(eedentrate, 2))

        c.drawString(47,drop,'Employee Dental Coverage: $'+str(eedentrate))

    if 'eevisrate' in tdict:
        drop = drop -d
        eevisrate = float(tdict['eevisrate'])
        if add2percent == 'yes':
            eevisrate = eevisrate * 1.02
        eevisrate = str(round(eevisrate, 2))
        c.drawString(47,drop,'Employee Vision Coverage: $'+str(eevisrate))


    if 'spmedrate' in tdict:
        drop = drop -d - 10
        spmedrate = float(tdict['spmedrate'])
        if add2percent == 'yes':
            spmedrate = spmedrate * 1.02
        spmedrate = str(round(spmedrate, 2))
        c.drawString(47,drop,'Spouse Medical Coverage: $'+str(spmedrate))

    if 'spdentrate' in tdict:
        drop = drop -d
        spdentrate = float(tdict['spdentrate'])
        if add2percent == 'yes':
            spdentrate = spdentrate * 1.02
        spdentrate = str(round(spdentrate, 2))
        c.drawString(47,drop,'Spouse Dental Coverage: $'+str(spdentrate))

    if 'spvisrate' in tdict:
        drop = drop -d
        spvisrate = float(tdict['spvisrate'])
        if add2percent == 'yes':
            spvisrate = spvisrate * 1.02
        spvisrate = str(round(spvisrate, 2))
        c.drawString(47,drop,'Spouse Vision Coverage: $'+str(spvisrate))

    if 'chmedrate' in tdict:
        drop = drop -d -10
        chmedrate = float(tdict['chmedrate'])
        if add2percent == 'yes':
            chmedrate = chmedrate * 1.02
        chmedrate = str(round(chmedrate, 2))
        c.drawString(47,drop,'Child(ren) Medical Coverage: $'+str(chmedrate))

    if 'chdentrate' in tdict:
        drop = drop -d
        chdentrate = float(tdict['chdentrate'])
        if add2percent == 'yes':
            chdentrate = chdentrate * 1.02
        chdentrate = str(round(chdentrate, 2))
        c.drawString(47,drop,'Child(ren) Dental Coverage: $'+str(chdentrate))

    if 'chvisrate' in tdict:
        drop = drop -d
        chvisrate = float(tdict['chvisrate'])
        if add2percent == 'yes':
            chvisrate = chvisrate * 1.02
        chvisrate = str(round(chvisrate, 2))
        c.drawString(47,drop,'Child(ren) Vision Coverage: $'+str(chvisrate))


    drop = drop -d -10
    c.drawString(47,drop,'Other coverage options may cost less.  If you choose to elect continuation coverage, you do not')

    drop = drop -d
    c.drawString(47,drop,'have to send any payment with the Election Form.  Additional information about payment will')

    drop = drop -d
    c.drawString(47,drop,'be provided to you after the election form is received by the Plan.  Important information about')

    drop = drop -d
    c.drawString(47,drop,'paying your premium can be found at the end of this notice.')

    c.setFont('Helvetica-Bold', 12)
    drop = drop -d -10
    c.drawString(47,drop,'You may be able to get coverage through the Health Insurance Marketplace that costs')
    drop = drop -d
    c.drawString(47,drop,'less than COBRA continuation coverage.')
    c.setFont('Helvetica', 12)

    drop = drop -d
    c.drawString(47,drop,'To learn more, contact our agent at '+agentphone+' or '+tdict['agentemail'] )









    c.showPage()
    drop = 810










    c.setFont('Helvetica-Bold', 12)
    drop = drop -d -10
    c.drawString(47,drop,'What is the Health Insurance Marketplace?')
    c.setFont('Helvetica', 12)

    drop = drop -d
    c.drawString(47,drop,'The Marketplace offers one-stop shopping to find and compare private health insurance')

    drop = drop -d
    c.drawString(47,drop,'options.  In the Marketplace, you could be eligible for a new kind of tax credit that lowers your')

    drop = drop -d
    c.drawString(47,drop,'monthly premiums and cost-sharing reductions (amounts that lower your out-of-pocket costs for')

    drop = drop -d
    c.drawString(47,drop,'deductibles, and out-of-pocket costs will be before you make a decision to enroll.  Under the')

    drop = drop -d
    c.drawString(47,drop,'ARP, individuals and families may be eligible for a temporary increase in their premium tax')


    drop = drop -d
    c.drawString(47,drop,'credit, and advance payments of the premium tax credit, for this year, with no one who is ')

    drop = drop -d
    c.drawString(47,drop,'eligible paying more than 8.5% of their household income towards the cost of the benchmark')

    drop = drop -d
    c.drawString(47,drop,'plan or a less expensive plan for plan years 2021 and 2022. Through a Marketplace, you can')

    drop = drop -d
    c.drawString(47,drop,'also learn if you may qualify for free or low-cost coverage from Medicaid or the Children’s')

    drop = drop -d
    c.drawString(47,drop,'Health Insurance Program (CHIP). People in most states use HealthCare.gov to apply')

    drop = drop -d
    c.drawString(47,drop,'for and enroll in Marketplace coverage; if your state has its own Marketplace platform you')

    drop = drop -d
    c.drawString(47,drop,'can find contact information for your State Marketplace here:')

    drop = drop -d
    c.drawString(47,drop,'https://CoveredCa.com')


    drop = drop -d-10
    c.drawString(47,drop,'Being offered COBRA continuation coverage won’t limit your eligibility for Medicaid. It also')

    drop = drop -d
    c.drawString(47,drop,'won’t limit your eligibility for Marketplace coverage or for a subsidy through a Marketplace,')

    drop = drop -d
    c.drawString(47,drop,'if you are a former employee of the employer offering the coverage. But you won’t be eligible')

    drop = drop -d
    c.drawString(47,drop,'for a subsidy or a tax credit during any month that you’re enrolled in COBRA continuation')

    drop = drop -d
    c.drawString(47,drop,' coverage. Therefore, if you want to use a special enrollment period to enroll in Marketplace')

    drop = drop -d
    c.drawString(47,drop,'coverage with a subsidy or a tax credit, you must end your COBRA continuation coverage before')

    drop = drop -d
    c.drawString(47,drop,'your Marketplace coverage starts.')

    drop = drop -d-10







    c.setFont('Helvetica-Bold', 12)
    drop = drop -d -10
    c.drawString(47,drop,'When can I enroll in Marketplace coverage?')
    c.setFont('Helvetica', 12)

    drop = drop -d
    c.drawString(47,drop,'Marketplace-eligible consumers can enroll in Marketplace coverage if they qualify for a special')

    drop = drop -d
    c.drawString(47,drop,'enrollment period. For example, Marketplace-eligible consumers always have 60 days from the time')

    drop = drop -d
    c.drawString(47,drop,'they lose your job-based coverage to enroll in the Marketplace, or they can apply up to 60 days')

    drop = drop -d
    c.drawString(47,drop,'beforehand if they know they’ll lose coverage ahead of time. After 60 days, the special enrollment')

    drop = drop -d
    c.drawString(47,drop,'period will end and Marketplace-eligible consumers may not be able to enroll unless they qualify')

    drop = drop -d
    c.drawString(47,drop,'for another special enrollment period, so they should take action right away if they want to')

    drop = drop -d
    c.drawString(47,drop,'enroll in Marketplace coverage. In addition, during what is called an “open enrollment” period,')

    drop = drop -d
    c.drawString(47,drop,'Marketplace-eligible consumers can enroll from November 1 – December 15 in Marketplace')

    drop = drop -d
    c.drawString(47,drop,'coverage that starts on January 1. Finally, they may apply for and, if eligible, enroll in Medicaid')

    drop = drop -d
    c.drawString(47,drop,'coverage at any time.')



    drop = drop -d-10
    c.drawString(47,drop,'Additionally, under the ARP, individuals and families may be eligible for a temporary increase in')

    drop = drop -d
    c.drawString(47,drop,'their premium tax credit and advance payment of the premium tax credit for 2021 and 2022, with ')

    drop = drop -d
    c.drawString(47,drop,'no one who is eligible paying more than 8.5% of their household income towards the cost of ')

    drop = drop -d
    c.drawString(47,drop,'the benchmark plan or a less expensive plan.')

    c.setFont('Helvetica-Bold', 12)
    drop = drop -d -10
    c.drawString(47,drop,'If I sign up for COBRA continuation coverage, can I switch to coverage in the')
    drop = drop -d
    c.drawString(47,drop,'Marketplace?  What about if I choose Marketplace coverage and want to switch back to')
    drop = drop -d
    c.drawString(47,drop,'COBRA continuation coverage?')

    c.setFont('Helvetica', 12)

    drop = drop -d
    c.drawString(47,drop,'If you sign up for COBRA continuation coverage, you can switch to a Marketplace plan during a')

    drop = drop -d
    c.drawString(47,drop,'Marketplace open enrollment period.  You can also end your COBRA continuation coverage')

    drop = drop -d
    c.drawString(47,drop,'early and switch to a Marketplace plan if you have another qualifying event such as marriage or')

    drop = drop -d
    c.drawString(47,drop,'birth of a child through something called a special enrollment period.  But be careful though -')

    drop = drop -d
    c.drawString(47,drop,'if you terminate your COBRA continuation coverage early without another qualifying event,')

    drop = drop -d
    c.drawString(47,drop,'you will have to wait to enroll in Marketplace coverage until the next open enrollment period, and')

    drop = drop -d
    c.drawString(47,drop,'could end up without any health coverage in the interim.  ')

 #-----------------------------------------------------------------------------------------------------------------------------------------------------------
    c.showPage()
    drop = 810
    c.drawString(47,drop,'Once you exhaust your COBRA continuation coverage and the coverage expires, you will be')

    drop = drop -d
    c.drawString(47,drop,'eligible to enroll in Marketplace coverage through a special enrollment period, even if')

    drop = drop -d
    c.drawString(47,drop,'Marketplace open enrollment has ended. ')

    drop = drop -d -10
    c.drawString(47,drop,'If you sign up for Marketplace coverage instead of COBRA continuation coverage, you cannot')

    drop = drop -d
    c.drawString(47,drop,'switch to COBRA continuation coverage under any circumstances.  ')

    c.setFont('Helvetica-Bold', 12)
    drop = drop -d -10
    c.drawString(47,drop,'Can I enroll in another group health plan')
    c.setFont('Helvetica', 12)

    drop = drop -d -10
    c.drawString(47,drop,'You may be eligible to enroll in coverage under another group health plan (like a spouses plan),')

    drop = drop -d
    c.drawString(47,drop,'if you request enrollment within 30 days of the loss of coverage.  ')

    drop = drop -d -10
    c.drawString(47,drop,'If you or your dependent chooses to elect COBRA continuation coverage instead of enrolling in')

    drop = drop -d
    c.drawString(47,drop,'another group health plan for which you are eligible, you will have another opportunity to enroll in')

    drop = drop -d
    c.drawString(47,drop,'the other group health plan within 30 days of losing your COBRA continuation coverage.')








    c.setFont('Helvetica-Bold', 12)
    drop = drop -d -10
    c.drawString(47,drop,'What factors should I consider when choosing coverage options?')
    c.setFont('Helvetica', 12)

    drop = drop -d
    c.drawString(47,drop,'When considering you options for health coverage, you may want to think about: ')

    drop = drop -d
    c.drawString(47,drop,' - Premiums: ')

    drop = drop -d
    c.drawString(47,drop,'Your previous plan can charge up to 102% of total plan premiums for')

    drop = drop -d
    c.drawString(47,drop,'COBRA coverage.  Other options, like spousal coverage through the')


    drop = drop -d
    c.drawString(47,drop,'Marketplace, may be less expensive.')

    drop = drop -d
    c.drawString(47,drop,' - Provider Networks')

    drop = drop -d
    c.drawString(47,drop,'If you are currently getting care or treatment for a condition, a change')

    drop = drop -d
    c.drawString(47,drop,'in your health coverage may affect your access to a particular health care provider.  You')

    drop = drop -d
    c.drawString(47,drop,'may want to check to see if your current health care providers participate in a network as')

    drop = drop -d
    c.drawString(47,drop,'you consider options for health coverage.')

    drop = drop -d
    c.drawString(47,drop,' - Drug Formularies')

    drop = drop -d
    c.drawString(47,drop,'If you are currently taking medication, a change in your health')

    drop = drop -d
    c.drawString(47,drop,'coverage may affect your costs for medication and in some cases, your medication may')

    drop = drop -d
    c.drawString(47,drop,'not be covered by another plan.  You may want to check to see if your current')

    drop = drop -d
    c.drawString(47,drop,'medications are listed in drug formularies for other health coverage.')


    drop = drop -d
    c.drawString(47,drop,' - Severance Payments')

    drop = drop -d
    c.drawString(47,drop,'If you lost your job and got a severance package from your former')

    drop = drop -d
    c.drawString(47,drop,'employer, your former employer may have offered to pay some or all of your COBRA')

    drop = drop -d
    c.drawString(47,drop,'payments for a period of time.  In this scenario, you may want to contact the Department')

    drop = drop -d
    c.drawString(47,drop,'of Labor at 1-866-444-3272 to discuss your options.')

    drop = drop -d
    c.drawString(47,drop,' - Service Areas')

    drop = drop -d
    c.drawString(47,drop,'Some plans limit their benefits to specific service or coverage areas - so if')

    drop = drop -d
    c.drawString(47,drop,'you move to another area of the country, you may not be able to use your benefits.  You')

    drop = drop -d
    c.drawString(47,drop,'may want to see if your plan has a service or coverage area, or other similar limitations.')

    drop = drop -d
    c.drawString(47,drop,' - Other cost-sharing')

    drop = drop -d
    c.drawString(47,drop,'In addition to premiums or contributions for health coverage, you')

    drop = drop -d
    c.drawString(47,drop,'probably pay copayments, deductibles, coinsurance, or other amounts as you use your')

    drop = drop -d
    c.drawString(47,drop,'benefits.  You may want to check to see what the cost-sharing requirements are for other')

    drop = drop -d
    c.drawString(47,drop,'health coverage options.  For example, one option may have much lower monthly')

    drop = drop -d
    c.drawString(47,drop,'premiums, but a much higher deductible and higher copayments.')

    c.setFont('Helvetica-Bold', 12)
    drop = drop -d -10
    c.drawString(47,drop,'For more information')
    c.setFont('Helvetica', 12)

    drop = drop -d
    c.drawString(47,drop,'This notice does not fully describe continuation coverage or other rights under the Plan.  More')

    drop = drop -d
    c.drawString(47,drop,'information about continuation coverage and your rights under the Plan is available in your')

    drop = drop -d
    c.drawString(47,drop,'summary plan description or from the Plan Administrator.  ')

    drop = drop -d -10
    c.drawString(47,drop,'If you have questions about the information in this notice, your rights to coverage, or if you want')

    drop = drop -d
    c.drawString(47,drop,'a copy of your summary plan description, contact '+tdict['emplrcontact']+' at '+tdict['emplrphone']);

    c.showPage()
    drop = 750


    c.drawString(47,drop,'For more information about your rights under the Employee Retirement Income Security Act')

    drop = drop -d
    c.drawString(47,drop,'(ERISA), including COBRA, the Patient Protection and Affordable Care Act, and other laws')

    drop = drop -d
    c.drawString(47,drop,'affecting group health plans, visit the U.S. Department of Labors Employee Benefits Security')

    drop = drop -d
    c.drawString(47,drop,'Administration (EBSA) website at www.dol.gov/ebsa or call their toll-free number at 1-866-444-')

    drop = drop -d
    c.drawString(47,drop,'3272.  For more information about health insurance options available through the Health')

    drop = drop -d
    c.drawString(47,drop,'Insurance Marketplace, and to locate an assister in your area who you can talk to about the')

    drop = drop -d
    c.drawString(47,drop,'different options, visit www.HealthCare.gov.')

    c.setFont('Helvetica-Bold', 12)
    drop = drop -d -10
    c.drawString(47,drop,'Keep Your Plan Informed of Address Changes')
    c.setFont('Helvetica', 12)

    drop = drop -d
    c.drawString(47,drop,'To protect your and your rights, keep the Plan Administrator informed of any changes')

    drop = drop -d
    c.drawString(47,drop,'in your address and the addresses of family members.  You should also keep a copy of any')

    drop = drop -d
    c.drawString(47,drop,'notices you send to the Plan Administrator. ')

    drop = drop -d-10

    c.setFont('Helvetica-Bold', 12)
    c.showPage()
    drop = 780

    c.setFont('Helvetica-Bold', 14)
    drop = drop -d -10
    c.drawString(47,drop,'Cobra Continuation Coverage Election Form')
    c.setFont('Helvetica-Bold', 12)

    drop = drop -d
    c.drawString(47,drop,'Instructions: To elect COBRA continuation coverage, complete this form and return it to us.')

    drop = drop -d
    c.drawString(47,drop,'Under federal law, you have 60 days after the date of this notice to decide whether you ')

    drop = drop -d
    c.drawString(47,drop,'want to elect COBRA continuation coverage under the Plan.  ')

    drop = drop -d -10
    c.drawString(47,drop,'Send completed Election Form to:  ')

    drop = drop -d
    c.drawString(47,drop,tdict['emplrcontact'])

    drop = drop -d
    c.drawString(47,drop,tdict['emplrname'])

    drop = drop -d
    c.drawString(47,drop,tdict['emplraddr'])

    drop = drop -d
    c.drawString(47,drop,csz)

    drop = drop -d
    c.drawString(47,drop,'This Election Form must be completed and returned by US mail.')

    drop = drop -d
    c.drawString(47,drop,'It must be post-marked no later than '+duedate+'.')

    drop = drop -d
    c.drawString(47,drop,'If you do not submit a completed Election Form by the due date shown above, you will lose ')

    drop = drop -d
    c.drawString(47,drop,' your right toelect COBRA continuation coverage.  If you reject COBRA continuation coverage ')

    drop = drop -d
    c.drawString(47,drop,'before the due date, you may change your mind as long as you submit a completed Election ')

    drop = drop -d
    c.drawString(47,drop,'Form before the due date.  However, if you change your mind after first rejecting COBRA ')

    drop = drop -d
    c.drawString(47,drop,'continuation coverage, your COBRA continuation coverage will begin on the date you submit   ')

    drop = drop -d
    c.drawString(47,drop,'the completed Election Form.  Read the important information about your rights included in ')

    drop = drop -d
    c.drawString(47,drop,'the pages after the Election Form.')

    drop = drop -d -10
    c.drawString(47,drop,' (We) elect COBRA continuation coverage under the referenced employer group plan:')

    drop = drop -d
    c.drawString(47,drop,'Name	Date of Birth	Relationship to Employee	SSN (or other identifier)')



    drop = drop -d-15
    c.drawString(47,drop,'1._________________________________________________________________________')

    drop = drop -d-15
    c.drawString(47,drop,'2._________________________________________________________________________')

    drop = drop -d-15
    c.drawString(47,drop,'3._________________________________________________________________________')

    drop = drop -d-15
    c.drawString(47,drop,'4._________________________________________________________________________')

    drop = drop -d-15
    c.drawString(47,drop,'5._________________________________________________________________________')

    drop = drop -d-15
    c.drawString(47,drop,'6._________________________________________________________________________')

    drop = drop -d -10
    c.drawString(47,drop,'______________________________________               _____________________________')

    drop = drop -15
    c.drawString(47,drop,'Signature                                                                           Date')

    drop = drop -d-15
    c.drawString(47,drop,'______________________________________               _____________________________')

    drop = drop -15
    c.drawString(47,drop,'Print Name                                                                        Relationship to persons listed above')

    #drop = drop -d-25
    #c.drawString(47,drop,'______________________________________           ')

    drop = drop -d-15
    c.drawString(47,drop,'______________________________________        ')

    drop = drop -d-15
    c.drawString(47,drop,'______________________________________               _____________________________')


    drop = drop -15
    c.drawString(47,drop,'Print Address                                                                   Telephone Number')


    c.showPage()
    drop = 750

    c.setFont('Helvetica-Bold', 12)
    drop = drop -d -10
    c.drawString(47,drop,'Important Information About Payment')
    c.setFont('Helvetica', 12)

    drop = drop -d
    c.drawString(47,drop,'First payment for continuation coverage')

    drop = drop -d
    c.drawString(47,drop,'You must make your first payment for continuation coverage no later than 45 days after the date')

    drop = drop -d
    c.drawString(47,drop,'of your election (this is the date the Election Notice is postmarked).  If you do not make your first')

    drop = drop -d
    c.drawString(47,drop,'payment in full no later than 45 days after the date of your election, you will lose all continuation')

    drop = drop -d
    c.drawString(47,drop,'payment is correct.  You may contact [enter appropriate contact information, e.g., the Plan')

    drop = drop -d
    c.drawString(47,drop,'Administrator or other party responsible for COBRA administration under the Plan] to confirm')

    drop = drop -d
    c.drawString(47,drop,'the correct amount of your first payment.')

    drop = drop -d -10
    c.drawString(47,drop,'Periodic payments for continuation coverage')

    drop = drop -d
    c.drawString(47,drop,'After you make your first payment for continuation coverage, you will have to make periodic')

    drop = drop -d
    c.drawString(47,drop,'payments for each coverage period that follows.  The amount due for each coverage period for')

    drop = drop -d
    c.drawString(47,drop,'each qualified beneficiary is shown in this notice.  The periodic payments can be made on a')

    drop = drop -d
    c.drawString(47,drop,'monthly basis.  Under the Plan, each of these periodic payments for continuation coverage is due')

    drop = drop -d
    c.drawString(47,drop,'on the first of the month for which coverage is provided.')

    drop = drop -d -10
    c.drawString(47,drop,'Grace periods for periodic payments')

    drop = drop -d
    c.drawString(47,drop,'Although periodic payments are due on the dates shown above, you will be given a grace period of')

    drop = drop -d
    c.drawString(47,drop,'30 days after the first day of the coverage period to make each periodic payment.  You will be covered')

    drop = drop -d
    c.drawString(47,drop,'as long as as payment for that coverage period is made before the end of the grace period. ')

    drop = drop -d -10
    c.drawString(47,drop,'If you don not make a periodic payment before the end of the grace period for that coverage period,')

    drop = drop -d
    c.drawString(47,drop,'you will lose all rights to continuation coverage under the Plan.')



    c.save()
    rc = '<html><head>'
    rc = rc + '<META HTTP-EQUIV="Refresh" CONTENT="1; url=/cobranot.pdf">';
    rc = rc + '</head><body>Reloading</body></html>';
    print (rc)

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

    #drop = drop -d
    #c.drawString(47,drop,'')

















