jQuery(document).ready(function() {
    $('#maingraphic-image img:first').fadeIn(500, function() {
        $("#maingraphic-image").cycle({
            fx: 'fade',
            speed: 3000,
            sync: 0,
            timeout: 10000,
            fastOnEvent: 1
        });
    });
});


function penaltyAssessment() {
    var bloodID = document.getElementById('BloodBreath');
    var bloodText = bloodID.value;
    var offensesTextID = document.getElementById('PriorOffenses');
    var offensesText = offensesTextID.value;

    //Check if DATE field or EVENT field is empty
    if (bloodText.length == 0 || offensesText.length == 0) {
        alert("Please select a blood alcohol content level and the number of prior offenses.");
        return;
    }

    $('#penalty-chart').empty();
    //under, more, Refusal
    //none, one, two
    //$('#penalty-chart').append("blood: " + bloodText + "offens: " + offensesText);
    if (bloodText == "under") {
        if (offensesText == "none") {
            $('#penalty-chart').append('<br /><br /><table width="572" border="0" cellspacing="0" cellpadding="0"><tr><td><b style="font-size:24px;">Penalty Chart</b><br /><br /><b>DUI Penalties in Washington State if you had ...</b></td></tr><tr><td><ul class="side-list"><li>test result <strong>under .15%</strong> or no breath test (but not a refusal)</li><li><strong>No prior offenses</strong> in the last 7 years</li></ul></td></tr><tr><td valign="top"><table border="0" cellspacing="1" cellpadding="5"><tr><td width="258" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Administrative Penalties</td><td width="291" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Criminal Penalties</td></tr><tr><td valign="top" bgcolor="#ddecf1"><div>If breath/blood test results over .08%</div><ul class="side-list" style="margin-left:5px; margin-top:5px;"> <li>90 day license suspension for first<br />offense within seven years.</li><li>No occupational license for first 30 days.</li><li>Two year license revocation if second or subsequent administrative action within<br /> seven years.</li><li>SR-22 insurance (high risk) for three<br />years after reinstatement.</li><li>$150 reissue fee.</li></ul><span class="headercon" align="center">You must take action within 20 days!</span></td><td valign="top" bgcolor="#ddecf1"><ul class="side-list" style="margin-left:5px;"><li>$825 minimum fine; $5000 maximum.</li><li>90 day license suspension (concurrent with any administrative suspension).</li><li>SR-22 insurance (high risk) for 3 years following reinstatement.</li><li>Alcohol abuse evaluation. Up to two years of treatment.</li><li>Ignition interlock for one year, and pay the costs.</li><li>Up to five years of monitored probation, and pay the cost.</li><li>Probationary license for 5 years following reinstatement.</li><li>Exclusion from Canada.</li></ul></td></tr></table>');
        }else if (offensesText == "one") {
        $('#penalty-chart').append('<br /><br /><table width="572" border="0" cellspacing="0" cellpadding="0"><tr><td><b style="font-size:24px;">Penalty Chart</b><br /><br /><b>DUI Penalties in Washington State if you had ...</b></td></tr><tr><td><ul class="side-list"><li>Test result <strong>under .15%</strong> or no breath test (but not a refusal)</li><li><strong>One prior offense</strong> in the last 7 years </li></ul></td></tr><tr><td valign="top"><table border="0" cellspacing="1" cellpadding="5"><tr><td width="258" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Administrative Penalties</td><td width="291" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Criminal Penalties</td></tr><tr><td valign="top" bgcolor="#ddecf1"><div>If breath/blood test results over .08%</div><ul class="side-list" style="margin-left:5px; margin-top:5px;"><li>90 day license suspension for first<br /> offense within seven years.</li><li>No occupational license for first 30 days.</li><li>Two year license revocation if second or subsequent administrative action within<br /> seven years.</li><li>SR-22 insurance (high risk) for three<br /> years after reinstatement.</li><li>$150 reissue fee.</li></ul><span class="headercon" align="center">You must take action within 20 days!</span></td><td valign="top" bgcolor="#ddecf1"><ul class="side-list" style="margin-left:5px;"><li>Maximum one year jail, minimum 30 days, plus 60 days EHD.</li><li>$1025 minimum fine; $5000 maximum</li><li>Two year license revocation. No occupational license. Possible driving and written tests.</li><li>SR-22 insurance (high risk) for 3 years following reinstatement.</li><li>Alcohol abuse evaluation. Up to two years of treatment.</li><li>Ignition interlock for one-year or five years depending if required previously. Pay costs.</li><li>Up to five years of monitored probation, and pay the cost.</li><li>Probationary license for 5 years following reinstatement.</li><li>Exclusion from Canada.</li></ul></td></tr></table>');
        }else if (offensesText == "two") {
        $('#penalty-chart').append('<br /><br /><table width="572" border="0" cellspacing="0" cellpadding="0"><tr><td><b style="font-size:24px;">Penalty Chart</b><br /><br /><b>DUI Penalties in Washington State if you had ...</b></td></tr><tr><td><ul class="side-list"><li>Test result <strong>under .15%</strong> or no breath test (but not a refusal)</li><li><strong>Two or more prior offenses</strong> in the last 7 years </li></ul></td></tr><tr><td valign="top"><table border="0" cellspacing="1" cellpadding="5"><tr><td width="258" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Administrative Penalties</td><td width="291" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Criminal Penalties</td></tr><tr><td valign="top" bgcolor="#ddecf1"><div>If breath/blood test results over .08%</div><ul class="side-list" style="margin-left:5px; margin-top:5px;"><li>90 day license suspension for first<br /> offense within seven years.</li><li>No occupational license for first 30 days.</li><li>Two year license revocation if second or subsequent administrative action within seven years. No occupational license.</li><li>SR-22 insurance (high risk) for three<br /> years after reinstatement.</li><li>$150 reissue fee.</li></ul><span class="headercon" align="center">You must take action within 20 days!</span></td><td valign="top" bgcolor="#ddecf1"><ul class="side-list" style="margin-left:5px;"><li>Maximum one year jail, minimum 90 days, plus 120 days EHD.</li><li>$1725 minimum fine; $5000 maximum</li><li>Three year license revocation. No occupational license. Possible driving and written tests.</li><li>SR-22 insurance (high risk) for 3 years following reinstatement.</li><li>Alcohol abuse evaluation. Up to two years of treatment.</li><li>Ignition interlock for one-year minimum if no previous interlock requirement, five years if previously required, ten years if previously required twice. Pay costs. </li><li>Up to five years of monitored probation, and pay the cost.</li><li>Probationary license for 5 years following reinstatement.</li><li>Exclusion from Canada.</li></ul></td></tr></table>');
        }
    } else if (bloodText == "more") {
    
        if (offensesText == "none") {
            $('#penalty-chart').append('<br /><br /><table width="572" border="0" cellspacing="0" cellpadding="0"><tr><td><b style="font-size:24px;">Penalty Chart</b><br /><br /><b>DUI Penalties in Washington State if you had ...</b></td></tr><tr><td><ul class="side-list"><li>Test result <strong>.15% or more</strong> (or test refused)</li><li><strong>No prior offenses</strong> in the last 7 years </li></ul></td></tr><tr><td valign="top"><table border="0" cellspacing="1" cellpadding="5"><tr><td width="258" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Administrative Penalties</td><td width="291" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Criminal Penalties</td></tr><tr><td valign="top" bgcolor="#ddecf1"><div>If breath/blood test results over .08%</div><ul class="side-list" style="margin-left:5px; margin-top:5px;"><li>90 day license suspension for first<br /> offense within seven years.</li><li>No occupational license for first 30 days.</li><li>Two year license revocation if second or subsequent administrative action within seven years. No occupational license.</li><li>SR-22 insurance (high risk) for three<br /> years after reinstatement.</li><li>$150 reissue fee.</li></ul><span class="headercon" align="center">You must take action within 20 days!</span></td><td valign="top" bgcolor="#ddecf1"><ul class="side-list" style="margin-left:5px;"><li>Maximum one year jail, minimum 2 days, or 30 days electric home detention (EHD) (house arrest). </li><li>$1025 minimum fine; $5000 maximum</li><li>One year license suspension (in addition to administrative suspension).</li><li>SR-22 insurance (high risk) for 3 years following reinstatement.</li><li>Alcohol abuse evaluation. Up to two years of treatment.</li><li>Ignition interlock for one-year minimum if no previous interlock requirement, five years if previously required, ten years if previously required twice. Pay costs. </li><li>Up to five years of monitored probation, and pay the cost.</li><li>Probationary license for 5 years following reinstatement.</li><li>Exclusion from Canada.</li></ul></td></tr></table>');
        }else if (offensesText == "one") {
        $('#penalty-chart').append('<br /><br /><table width="572" border="0" cellspacing="0" cellpadding="0"><tr><td><b style="font-size:24px;">Penalty Chart</b><br /><br /><b>DUI Penalties in Washington State if you had ...</b></td></tr><tr><td><ul class="side-list"><li>Test result <strong>.15% or more</strong></li><li><strong>One prior offense</strong> in the last 7 years </li></ul></td></tr><tr><td valign="top"><table border="0" cellspacing="1" cellpadding="5"><tr><td width="258" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Administrative Penalties</td><td width="291" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Criminal Penalties</td></tr><tr><td valign="top" bgcolor="#ddecf1"><div>If breath/blood test results over .08%</div><ul class="side-list" style="margin-left:5px; margin-top:5px;"><li>90 day license suspension for first<br /> offense within seven years.</li><li>No occupational license for first 30 days.</li><li>Two year license revocation if second or subsequent administrative action within seven years. No occupational license.</li><li>SR-22 insurance (high risk) for three<br /> years after reinstatement.</li><li>$150 reissue fee.</li></ul><span class="headercon" align="center">You must take action within 20 days!</span></td><td valign="top" bgcolor="#ddecf1"><ul class="side-list" style="margin-left:5px;"><li>Maximum one year jail, minimum 45 days, plus 90 days EHD. </li><li>$1325 minimum fine; $5000 maximum</li><li>900 day license revocation. No occupational license. Possible driving and written tests.</li><li>SR-22 insurance (high risk) for 3 years following reinstatement.</li><li>Alcohol abuse evaluation. Up to two years of treatment.</li><li>Ignition interlock for one-year minimum if no previous interlock requirement, five years if previously required, ten years if previously required twice. Pay costs. </li><li>Up to five years of monitored probation, and pay the cost.</li><li>Probationary license for 5 years following reinstatement.</li><li>Exclusion from Canada.</li></ul></td></tr></table>');
        }else if (offensesText == "two") {
        $('#penalty-chart').append('<br /><br /><table width="572" border="0" cellspacing="0" cellpadding="0"><tr><td><b style="font-size:24px;">Penalty Chart</b><br /><br /><b>DUI Penalties in Washington State if you had ...</b></td></tr><tr><td><ul class="side-list"><li>Test result <strong>.15% or more</strong></li><li><strong>Two or prior offenses</strong> in the last 7 years </li></ul></td></tr><tr><td valign="top"><table border="0" cellspacing="1" cellpadding="5"><tr><td width="258" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Administrative Penalties</td><td width="291" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Criminal Penalties</td></tr><tr><td valign="top" bgcolor="#ddecf1"><div>If breath/blood test results over .08%</div><ul class="side-list" style="margin-left:5px; margin-top:5px;"><li>90 day license suspension for first<br /> offense within seven years.</li><li>No occupational license for first 30 days.</li><li>Two year license revocation if second or subsequent administrative action within seven years. No occupational license.</li><li>SR-22 insurance (high risk) for three<br /> years after reinstatement.</li><li>$150 reissue fee.</li></ul><span class="headercon" align="center">You must take action within 20 days!</span></td><td valign="top" bgcolor="#ddecf1"><ul class="side-list" style="margin-left:5px;"><li>Maximum one year jail, minimum 120 days, plus 150 days EHD. </li><li>$2525 minimum fine; $5000 maximum</li><li>Four year license revocation. No occupational license. Possible driving and written tests.</li><li>SR-22 insurance (high risk) for 3 years following reinstatement.</li><li>Alcohol abuse evaluation. Up to two years of treatment.</li><li>Ignition interlock for one-year minimum if no previous interlock requirement, five years if previously required, ten years if previously required twice. Pay costs. </li><li>Up to five years of monitored probation, and pay the cost.</li><li>Probationary license for 5 years following reinstatement.</li><li>Exclusion from Canada.</li></ul></td></tr></table>');
        }

    } else if (bloodText == "Refusal") {
    
        if (offensesText == "none") {
            $('#penalty-chart').append('<br /><br /><table width="572" border="0" cellspacing="0" cellpadding="0"><tr><td><b style="font-size:24px;">Penalty Chart</b><br /><br /><b>DUI Penalties in Washington State if you had ...</b></td></tr><tr><td><ul><li><strong>Test refused</strong></li><li><strong>No prior offenses</strong> in the last 7 years </li></ul></td></tr><tr><td valign="top"><table border="0" cellspacing="1" cellpadding="5"><tr><td width="258" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Administrative Penalties</td><td width="291" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Criminal Penalties</td></tr><tr><td valign="top" bgcolor="#ddecf1"><ul class="side-list" style="margin-left:5px; margin-top:5px;"><li>One year license revocation if no prior administrative actions within seven years. No occupational license.</li><li>SR-22 insurance (high risk) for three<br /> years after reinstatement.</li><li>$150 reissue fee.</li></ul><span class="headercon" align="center">You must take action within 20 days!</span></td><td valign="top" bgcolor="#ddecf1"><ul class="side-list" style="margin-left:5px;"><li>Maximum one year jail, minimum 2 days, or 30 days electric home detention (EHD) (house arrest). </li><li>$925 minimum fine; $5000 maximum</li><li>One year license suspension (in addition to administrative suspension).</li><li>SR-22 insurance (high risk) for 3 years following reinstatement.</li><li>Alcohol abuse evaluation. Up to two years of treatment.</li><li>Ignition interlock for one-year minimum if no previous interlock requirement, five years if previously required, ten years if previously required twice. Pay costs. </li><li>Up to five years of monitored probation, and pay the cost.</li><li>Probationary license for 5 years following reinstatement.</li><li>Exclusion from Canada.</li></ul></td></tr></table>');
        }else if (offensesText == "one") {
            $('#penalty-chart').append('<br /><br /><table width="572" border="0" cellspacing="0" cellpadding="0"><tr><td><b style="font-size:24px;">Penalty Chart</b><br /><br /><b>DUI Penalties in Washington State if you had ...</b></td></tr><tr><td><ul><li><strong>Test refused</strong></li><li><strong>One  prior offense</strong> in the last 7 years </li></ul></td></tr><tr><td valign="top"><table border="0" cellspacing="1" cellpadding="5"><tr><td width="258" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Administrative Penalties</td><td width="291" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Criminal Penalties</td></tr><tr><td valign="top" bgcolor="#ddecf1"><ul class="side-list" style="margin-left:5px; margin-top:5px;"><li>One year license revocation if no prior administrative actions within seven years. No occupational license.</li><li>SR-22 insurance (high risk) for three<br /> years after reinstatement.</li><li>$150 reissue fee.</li></ul><span class="headercon" align="center">You must take action within 20 days!</span></td><td valign="top" bgcolor="#ddecf1"><ul class="side-list" style="margin-left:5px;"><li>Maximum one year jail, minimum 45 days, plus 90 days EHD. </li><li>$1325 minimum fine; $5000 maximum;</li><li>900 day license revocation. No occupational license. Possible driving and written tests.</li><li>SR-22 insurance (high risk) for 3 years following reinstatement.</li><li>Alcohol abuse evaluation. Up to two years of treatment.</li><li>Ignition interlock for one-year minimum if no previous interlock requirement, five years if previously required, ten years if previously required twice. Pay costs. </li><li>Up to five years of monitored probation, and pay the cost.</li><li>Probationary license for 5 years following reinstatement.</li><li>Exclusion from Canada.</li></ul></td></tr></table>');
        }else if (offensesText == "two") {
            $('#penalty-chart').append('<br /><br /><table width="572" border="0" cellspacing="0" cellpadding="0"><tr><td><b style="font-size:24px;">Penalty Chart</b><br /><br /><b>DUI Penalties in Washington State if you had ...</b></td></tr><tr><td><ul><li><strong>Test refused</strong></li><li><strong>Two or more prior offenses</strong> in the last 7 years </li></ul></td></tr><tr><td valign="top"><table border="0" cellspacing="1" cellpadding="5"><tr><td width="258" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Administrative Penalties</td><td width="291" bgcolor="#2e5167" class="penalitychart" style="color:#fff;">Criminal Penalties</td></tr><tr><td valign="top" bgcolor="#ddecf1"><ul class="side-list" style="margin-left:5px; margin-top:5px;"><li>Two year license revocation if second or subsequent administrative action within seven years. No occupational license.</li><li>SR-22 insurance (high risk) for three<br /> years after reinstatement.</li><li>$150 reissue fee.</li></ul><span class="headercon" align="center">You must take action within 20 days!</span></td><td valign="top" bgcolor="#ddecf1"><ul class="side-list" style="margin-left:5px;"><li>Maximum one year jail, minimum 120 days, plus 150 days EHD. </li><li>$2525 minimum fine; $5000 maximum;</li><li>Four year license revocation. No occupational license. Possible driving and written tests.</li><li>SR-22 insurance (high risk) for 3 years following reinstatement.</li><li>Alcohol abuse evaluation. Up to two years of treatment.</li><li>Ignition interlock for one-year minimum if no previous interlock requirement, five years if previously required, ten years if previously required twice. Pay costs. </li><li>Up to five years of monitored probation, and pay the cost.</li><li>Probationary license for 5 years following reinstatement.</li><li>Exclusion from Canada.</li></ul></td></tr></table>');
        }

    }

}
